Search in sources :

Example 1 with QueryRecordExecutor

use of com.aerospike.client.query.QueryRecordExecutor in project aerospike-client-java by aerospike.

the class AerospikeClient method queryNode.

/**
	 * Execute query on a single server node and return record iterator.  The query executor puts
	 * records on a queue in a separate thread.  The calling thread concurrently pops records off 
	 * the queue through the record iterator.
	 * 
	 * @param policy				generic configuration parameters, pass in null for defaults
	 * @param statement				database query command
	 * @param node					server node to execute query
	 * @return						record iterator
	 * @throws AerospikeException	if query fails
	 */
public final RecordSet queryNode(QueryPolicy policy, Statement statement, Node node) throws AerospikeException {
    if (policy == null) {
        policy = queryPolicyDefault;
    }
    QueryRecordExecutor executor = new QueryRecordExecutor(cluster, policy, statement, node);
    executor.execute();
    return executor.getRecordSet();
}
Also used : QueryRecordExecutor(com.aerospike.client.query.QueryRecordExecutor)

Example 2 with QueryRecordExecutor

use of com.aerospike.client.query.QueryRecordExecutor in project aerospike-client-java by aerospike.

the class AerospikeClient method query.

//--------------------------------------------------------
// Query functions
//--------------------------------------------------------
/**
	 * Execute query on all server nodes and return record iterator.  The query executor puts 
	 * records on a queue in separate threads.  The calling thread concurrently pops records off 
	 * the queue through the record iterator.
	 * 
	 * @param policy				query configuration parameters, pass in null for defaults
	 * @param statement				database query command
	 * @return						record iterator
	 * @throws AerospikeException	if query fails
	 */
public final RecordSet query(QueryPolicy policy, Statement statement) throws AerospikeException {
    if (policy == null) {
        policy = queryPolicyDefault;
    }
    QueryRecordExecutor executor = new QueryRecordExecutor(cluster, policy, statement, null);
    executor.execute();
    return executor.getRecordSet();
}
Also used : QueryRecordExecutor(com.aerospike.client.query.QueryRecordExecutor)

Aggregations

QueryRecordExecutor (com.aerospike.client.query.QueryRecordExecutor)2