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


Java AerospikeClient.scanAll方法代码示例

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


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

示例1: runScan

import com.aerospike.client.AerospikeClient; //导入方法依赖的package包/类
/**
 * Scan all nodes in parallel and read all records in a List.
 * @param client
 * @param namespace
 * @param set
 */
public List<Record> runScan(AerospikeClient client, String namespace, String set) 
		throws Exception 
{
	console.debug("Scan parallel: namespace=" + namespace + " set=" + set);
	recordCount = 0;
	long begin = System.currentTimeMillis();
	ScanPolicy policy = new ScanPolicy();
	client.scanAll(policy, namespace, set, this);

	long end = System.currentTimeMillis();
	double seconds =  (double)(end - begin) / 1000.0;
	console.debug("Total records returned: " + recordCount);
	console.debug("Elapsed time: " + seconds + " seconds");
	double performance = Math.round((double)recordCount / seconds);
	console.debug("Records/second: " + performance);
	return recordList;
}
 
开发者ID:aerospike,项目名称:url-tracker,代码行数:24,代码来源:ScanSet.java

示例2: runScan

import com.aerospike.client.AerospikeClient; //导入方法依赖的package包/类
/**
 * Scan all nodes in parallel and return the KEYS of all of the records
 * in a list.
 * @param client
 * @param namespace
 * @param set
 */
public List<Key> runScan(AerospikeClient client, String namespace, String set) 
		throws Exception 
{
	console.debug("Scan parallel: namespace=" + namespace + " set=" + set);
	recordCount = 0;
	long begin = System.currentTimeMillis();
	ScanPolicy policy = new ScanPolicy();
	client.scanAll(policy, namespace, set, this);

	long end = System.currentTimeMillis();
	double seconds =  (double)(end - begin) / 1000.0;
	console.debug("Total records returned: " + recordCount);
	console.debug("Elapsed time: " + seconds + " seconds");
	double performance = Math.round((double)recordCount / seconds);
	console.debug("Records/second: " + performance);
	return keyList;
}
 
开发者ID:aerospike,项目名称:url-tracker,代码行数:25,代码来源:ScanKeySet.java


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