use of com.aerospike.client.policy.Policy in project aerospike-client-java by aerospike.
the class TestQueryFilter method prepare.
@BeforeClass
public static void prepare() {
RegisterTask rtask = client.register(null, TestQueryFilter.class.getClassLoader(), "udf/filter_example.lua", "filter_example.lua", Language.LUA);
rtask.waitTillComplete();
Policy policy = new Policy();
// Do not timeout on index create.
policy.socketTimeout = 0;
IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.STRING);
itask.waitTillComplete();
writeRecord(keyPrefix + 1, "Charlie", "cpass");
writeRecord(keyPrefix + 2, "Bill", "hknfpkj");
writeRecord(keyPrefix + 3, "Doug", "dj6554");
}
use of com.aerospike.client.policy.Policy in project aerospike-client-java by aerospike.
the class TestQueryKey method prepare.
@BeforeClass
public static void prepare() {
Policy policy = new Policy();
// Do not timeout on index create.
policy.socketTimeout = 0;
IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC);
itask.waitTillComplete();
WritePolicy writePolicy = new WritePolicy();
writePolicy.sendKey = true;
for (int i = 1; i <= size; i++) {
Key key = new Key(args.namespace, args.set, keyPrefix + i);
Bin bin = new Bin(binName, i);
client.put(writePolicy, key, bin);
}
}
use of com.aerospike.client.policy.Policy in project aerospike-client-java by aerospike.
the class TestQueryPredExp method prepare.
@BeforeClass
public static void prepare() {
Policy policy = new Policy();
// Do not timeout on index create.
policy.socketTimeout = 0;
IndexTask task = client.createIndex(policy, args.namespace, setName, indexName, binName, IndexType.NUMERIC);
task.waitTillComplete();
for (int i = 1; i <= size; i++) {
Key key = new Key(args.namespace, setName, keyPrefix + i);
List<Integer> list = null;
Map<String, String> map = null;
if (i == 1) {
list = new ArrayList<Integer>(5);
list.add(1);
list.add(2);
list.add(4);
list.add(9);
list.add(20);
// map will be null, which means mapbin will not exist in this record.
} else if (i == 2) {
list = new ArrayList<Integer>(3);
list.add(5);
list.add(9);
list.add(100);
// map will be null, which means mapbin will not exist in this record.
} else if (i == 3) {
map = new HashMap<String, String>();
map.put("A", "AAA");
map.put("B", "BBB");
map.put("C", "BBB");
// list will be null, which means listbin will not exist in this record.
} else {
list = new ArrayList<Integer>(0);
map = new HashMap<String, String>(0);
}
client.put(null, key, new Bin(binName, i), new Bin("bin2", i), new Bin("listbin", list), new Bin("mapbin", map));
}
}
use of com.aerospike.client.policy.Policy in project aerospike-client-java by aerospike.
the class TestQueryString method prepare.
@BeforeClass
public static void prepare() {
Policy policy = new Policy();
// Do not timeout on index create.
policy.socketTimeout = 0;
IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.STRING);
task.waitTillComplete();
for (int i = 1; i <= size; i++) {
Key key = new Key(args.namespace, args.set, keyPrefix + i);
Bin bin = new Bin(binName, valuePrefix + i);
client.put(null, key, bin);
}
}
Aggregations