本文整理汇总了Java中com.yahoo.ycsb.StringByteIterator.getStringMap方法的典型用法代码示例。如果您正苦于以下问题:Java StringByteIterator.getStringMap方法的具体用法?Java StringByteIterator.getStringMap怎么用?Java StringByteIterator.getStringMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.yahoo.ycsb.StringByteIterator
的用法示例。
在下文中一共展示了StringByteIterator.getStringMap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insert
import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes" })
public Status insert(final String table, final String key, final HashMap<String, ByteIterator> values) {
HashMap fields;
if (byteFormat) {
fields = convertContent(values);
} else {
fields = StringByteIterator.getStringMap(values);
}
try {
if (xRepo.getDocumentManagement().storeDocument(key, fields, insertProps) == null) {
logger.debug("insert; document was not created for some reason; key: {}", key);
return Status.UNEXPECTED_STATE;
}
return Status.OK;
} catch (Exception ex) {
logger.error("insert.error", ex);
return Status.ERROR;
}
}
示例2: update
import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes" })
public Status update(final String table, final String key, final HashMap<String, ByteIterator> values) {
HashMap fields;
if (byteFormat) {
fields = convertContent(values);
} else {
fields = StringByteIterator.getStringMap(values);
}
try {
if (xRepo.getDocumentManagement().storeDocument(key, fields, updateProps) == null) {
logger.debug("update; document was not updated for some reason; key: {}", key);
return Status.UNEXPECTED_STATE;
}
return Status.OK;
} catch (Exception ex) {
logger.error("update.error", ex);
return Status.ERROR;
}
}
示例3: insert
import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public Status insert(final String table, final String key, final HashMap<String, ByteIterator> values) {
HashMap<String, Object> params = new HashMap<>();
params.put("uri", URI.create(key));
HashMap content = StringByteIterator.getStringMap(values);
content.put("key", key);
params.put("content", content);
params.put("props", insertProps);
try (ResultCursor cursor = xRepo.getQueryManagement().executeQuery(qStore, params, queryProps)) {
if (cursor.isEmpty()) {
logger.debug("insert; document was not created for some reason; key: {}", key);
return Status.UNEXPECTED_STATE;
} else {
return Status.OK;
}
} catch (Exception ex) {
logger.error("insert.error; key: {}", key, ex);
return Status.ERROR;
}
}
示例4: update
import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public Status update(final String table, final String key, final HashMap<String, ByteIterator> values) {
HashMap<String, Object> params = new HashMap<>();
params.put("uri", URI.create(key));
HashMap content = StringByteIterator.getStringMap(values);
content.put("key", key);
params.put("content", content);
params.put("props", updateProps);
try (ResultCursor cursor = xRepo.getQueryManagement().executeQuery(qStore, params, queryProps)) {
if (cursor.isEmpty()) {
logger.debug("update; document was not updated for some reason; key: {}", key);
return Status.UNEXPECTED_STATE;
} else {
return Status.OK;
}
} catch (Exception ex) {
logger.error("update.error; key: {}", key, ex);
return Status.ERROR;
}
}
示例5: insertImpl
import com.yahoo.ycsb.StringByteIterator; //导入方法依赖的package包/类
@Override
protected int insertImpl(TxnHandle txn, String table, String key, HashMap<String, ByteIterator> values)
throws WrongTypeException, NoSuchObjectException, VersionNotFoundException, NetworkException {
@SuppressWarnings("unchecked")
final LWWStringMapRegisterCRDT register = txn.get(new CRDTIdentifier(table, key), true,
LWWStringMapRegisterCRDT.class, notificationsSubscriber);
final HashMap<String, String> value = StringByteIterator.getStringMap(values);
register.set(value);
return 0;
}