use of com.aerospike.client.query.RecordSet in project aerospike-client-java by aerospike.
the class TestQueryFilterSet method queryDouble.
@Test
public void queryDouble() {
Statement stmt = new Statement();
stmt.setNamespace(args.namespace);
stmt.setSetName(set2);
QueryPolicy policy = new QueryPolicy();
policy.filterExp = Exp.build(Exp.gt(Exp.floatBin(binB), Exp.val(21.5)));
RecordSet rs = client.query(policy, stmt);
try {
int count = 0;
while (rs.next()) {
count++;
}
assertEquals(1, count);
} finally {
rs.close();
}
}
use of com.aerospike.client.query.RecordSet in project aerospike-client-java by aerospike.
the class TestQueryFilterSet method queryKeyExists.
@Test
public void queryKeyExists() {
Statement stmt = new Statement();
stmt.setNamespace(args.namespace);
stmt.setSetName(set3);
QueryPolicy policy = new QueryPolicy();
policy.filterExp = Exp.build(Exp.keyExists());
RecordSet rs = client.query(policy, stmt);
try {
int count = 0;
while (rs.next()) {
count++;
}
assertEquals(20, count);
} finally {
rs.close();
}
}
use of com.aerospike.client.query.RecordSet in project aerospike-client-java by aerospike.
the class TestQueryInteger method queryInteger.
@Test
public void queryInteger() {
int begin = 14;
int end = 18;
Statement stmt = new Statement();
stmt.setNamespace(args.namespace);
stmt.setSetName(args.set);
stmt.setBinNames(binName);
stmt.setFilter(Filter.range(binName, begin, end));
RecordSet rs = client.query(null, stmt);
try {
int count = 0;
while (rs.next()) {
count++;
}
assertEquals(5, count);
} finally {
rs.close();
}
}
use of com.aerospike.client.query.RecordSet in project aerospike-client-java by aerospike.
the class TestQueryRPS method query.
@Ignore
@Test
public void query() {
Statement stmt = new Statement();
stmt.setNamespace(args.namespace);
stmt.setSetName(args.set);
stmt.setFilter(Filter.range(binName1, 0, n_records));
stmt.setRecordsPerSecond(rps);
RecordSet rs = client.query(null, stmt);
drainRecords(rs);
for (Node n : client.getNodes()) {
checkRuntime(n, stmt);
}
}
use of com.aerospike.client.query.RecordSet in project aerospike-client-java by aerospike.
the class TestQueryGeo method queryGeo1.
@Test
public void queryGeo1() {
String region = "{ \"type\": \"Point\", \"coordinates\": [ -122.0986857, 37.4214209 ] }";
Statement stmt = new Statement();
stmt.setNamespace(args.namespace);
stmt.setSetName(setNameRegions);
QueryPolicy policy = new QueryPolicy();
policy.filterExp = Exp.build(Exp.geoCompare(Exp.geoBin("loc"), Exp.geo(region)));
RecordSet rs = client.query(policy, stmt);
try {
int count = 0;
while (rs.next()) {
// System.out.println(rs.getRecord().toString());
count++;
}
assertEquals(5, count);
} finally {
rs.close();
}
}
Aggregations