本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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;
}