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