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


Java StringByteIterator.getStringMap方法代码示例

本文整理汇总了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;
	}
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:21,代码来源:BagriDocClient.java

示例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;
	}
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:21,代码来源:BagriDocClient.java

示例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;
	}
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:22,代码来源:BagriQueryClient.java

示例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;
	}
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:22,代码来源:BagriQueryClient.java

示例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;
}
 
开发者ID:SyncFree,项目名称:SwiftCloud,代码行数:12,代码来源:SwiftRegisterPerKeyClient.java


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