当前位置: 首页>>代码示例>>Java>>正文


Java StringByteIterator.putAllAsByteIterators方法代码示例

本文整理汇总了Java中com.yahoo.ycsb.StringByteIterator.putAllAsByteIterators方法的典型用法代码示例。如果您正苦于以下问题:Java StringByteIterator.putAllAsByteIterators方法的具体用法?Java StringByteIterator.putAllAsByteIterators怎么用?Java StringByteIterator.putAllAsByteIterators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.yahoo.ycsb.StringByteIterator的用法示例。


在下文中一共展示了StringByteIterator.putAllAsByteIterators方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readImpl

import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
protected int readImpl(TxnHandle txn, String table, String key, Set<String> fields,
        HashMap<String, ByteIterator> result) throws WrongTypeException, NoSuchObjectException,
        VersionNotFoundException, NetworkException {
    @SuppressWarnings("unchecked")
    final LWWStringMapRegisterCRDT register = txn.get(new CRDTIdentifier(table, key), false,
            LWWStringMapRegisterCRDT.class, notificationsSubscriber);
    final HashMap<String, String> value = register.getValue();
    if (value == null) {
        return ERROR_NOT_FOUND;
    }
    if (fields == null) {
        StringByteIterator.putAllAsByteIterators(result, value);
    } else {
        for (final String field : fields) {
            result.put(field, new StringByteIterator(value.get(field)));
        }
    }
    return 0;
}
 
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:20,代码来源:SwiftRegisterPerKeyClient.java

示例2: readImpl

import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
protected int readImpl(TxnHandle txn, String table, String key, Set<String> fields,
        HashMap<String, ByteIterator> result) throws WrongTypeException, NoSuchObjectException,
        VersionNotFoundException, NetworkException {
    @SuppressWarnings("unchecked")
    final PutOnlyLWWStringMapCRDT map = txn.get(new CRDTIdentifier(table, key), false,
            PutOnlyLWWStringMapCRDT.class, notificationsSubscriber);
    if (fields == null) {
        final HashMap<String, String> value = map.getValue();
        StringByteIterator.putAllAsByteIterators(result, value);
    } else {
        for (final String field : fields) {
            final String keyValue = map.get(field);
            if (keyValue == null) {
                return ERROR_NOT_FOUND;
            }
            result.put(field, new StringByteIterator(keyValue));
        }
    }
    return 0;
}
 
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:21,代码来源:SwiftMapPerKeyClient.java

示例3: read

import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) {
    try {
       Map<String, String> row;
       if (clustered) {
          row = AtomicMapLookup.getAtomicMap(infinispanManager.getCache(table), key, false);
       } else {
          Cache<String, Map<String, String>> cache = infinispanManager.getCache(table);
          row = cache.get(key);
       }
       if (row != null) {
          result.clear();
          if (fields == null || fields.isEmpty()) {
StringByteIterator.putAllAsByteIterators(result, row);
          } else {
      for (String field : fields) result.put(field, new StringByteIterator(row.get(field)));
          }
       }
       return OK;
    } catch (Exception e) {
       return ERROR;
    }
 }
 
开发者ID:pbailis,项目名称:hat-vldb2014-code,代码行数:23,代码来源:InfinispanClient.java

示例4: read

import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
public int read(String table, String key, Set<String> fields,
		HashMap<String, ByteIterator> result) {
	if ( checkStore(table) == ERROR ) {
		return ERROR;
	}
	
	Versioned<HashMap<String, String>> versionedValue = storeClient.get(key);
	
	if ( versionedValue == null )
		return NOT_FOUND;
	
	if ( fields != null ) {
		for (String field : fields) {
			String val = versionedValue.getValue().get(field);
			if ( val != null )
			    result.put(field, new StringByteIterator(val));
		}
	} else {
		StringByteIterator.putAllAsByteIterators(result, versionedValue.getValue());
	}
	return OK;
}
 
开发者ID:pbailis,项目名称:hat-vldb2014-code,代码行数:24,代码来源:VoldemortClient.java


注:本文中的com.yahoo.ycsb.StringByteIterator.putAllAsByteIterators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。