diff --git a/test/src/com/aerospike/test/async/TestAsyncQuery.java b/test/src/com/aerospike/test/async/TestAsyncQuery.java index 9fc83d674..fe4a8199a 100644 --- a/test/src/com/aerospike/test/async/TestAsyncQuery.java +++ b/test/src/com/aerospike/test/async/TestAsyncQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -43,11 +43,8 @@ public class TestAsyncQuery extends TestAsync { @BeforeClass public static void initialize() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestIndex.java b/test/src/com/aerospike/test/sync/query/TestIndex.java index 0fa99555c..404dc484c 100644 --- a/test/src/com/aerospike/test/sync/query/TestIndex.java +++ b/test/src/com/aerospike/test/sync/query/TestIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -37,14 +37,11 @@ public class TestIndex extends TestSync { @Test public void createDrop() { - Policy policy = new Policy(); - policy.setTimeout(0); - IndexTask task; // Drop index if it already exists. try { - task = client.dropIndex(policy, args.namespace, args.set, indexName); + task = client.dropIndex(args.indexPolicy, args.namespace, args.set, indexName); task.waitTillComplete(); } catch (AerospikeException ae) { @@ -53,10 +50,10 @@ public void createDrop() { } } - task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); task.waitTillComplete(); - task = client.dropIndex(policy, args.namespace, args.set, indexName); + task = client.dropIndex(args.indexPolicy, args.namespace, args.set, indexName); task.waitTillComplete(); // Ensure all nodes have dropped the index. diff --git a/test/src/com/aerospike/test/sync/query/TestQueryAverage.java b/test/src/com/aerospike/test/sync/query/TestQueryAverage.java index 2cc06a5c6..02c47ab89 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryAverage.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryAverage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -50,11 +50,8 @@ public static void prepare() { RegisterTask rtask = client.register(null, TestQueryAverage.class.getClassLoader(), "udf/average_example.lua", "average_example.lua", Language.LUA); rtask.waitTillComplete(); - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); itask.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryBlob.java b/test/src/com/aerospike/test/sync/query/TestQueryBlob.java index 588ba4faa..d7f1587bb 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryBlob.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryBlob.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -50,13 +50,10 @@ public class TestQueryBlob extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.totalTimeout = 5000; - - IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.BLOB); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.BLOB); task.waitTillComplete(); - task = client.createIndex(policy, args.namespace, args.set, indexNameList, binNameList, IndexType.BLOB, IndexCollectionType.LIST); + task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexNameList, binNameList, IndexType.BLOB, IndexCollectionType.LIST); task.waitTillComplete(); for (int i = 1; i <= size; i++) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryCollection.java b/test/src/com/aerospike/test/sync/query/TestQueryCollection.java index 3b7e258d1..5736a8391 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryCollection.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryCollection.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -55,11 +55,8 @@ public static void prepare() { RegisterTask rtask = client.register(null, TestQueryCollection.class.getClassLoader(), "udf/record_example.lua", "record_example.lua", Language.LUA); rtask.waitTillComplete(); - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.STRING, IndexCollectionType.MAPKEYS); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.STRING, IndexCollectionType.MAPKEYS); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryContext.java b/test/src/com/aerospike/test/sync/query/TestQueryContext.java index e4b499d8c..cbc1e448c 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryContext.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -48,11 +48,9 @@ public class TestQueryContext extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - try { IndexTask task = client.createIndex( - policy, args.namespace, args.set, indexName, binName, + args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC, IndexCollectionType.DEFAULT, CTX.listRank(-1) ); diff --git a/test/src/com/aerospike/test/sync/query/TestQueryExecute.java b/test/src/com/aerospike/test/sync/query/TestQueryExecute.java index bacee3ca1..470af26a7 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryExecute.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryExecute.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -57,11 +57,8 @@ public static void prepare() { RegisterTask rtask = client.register(null, TestQueryExecute.class.getClassLoader(), "udf/record_example.lua", "record_example.lua", Language.LUA); rtask.waitTillComplete(); - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName1, IndexType.NUMERIC); + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName1, IndexType.NUMERIC); itask.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryFilter.java b/test/src/com/aerospike/test/sync/query/TestQueryFilter.java index dd0d506ee..f49e9cf94 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryFilter.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -50,11 +50,8 @@ 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(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.STRING); + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.STRING); itask.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryFilterExp.java b/test/src/com/aerospike/test/sync/query/TestQueryFilterExp.java index b6211baad..94d1653b7 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryFilterExp.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryFilterExp.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -55,11 +55,8 @@ public class TestQueryFilterExp extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, setName, indexName, binName, IndexType.NUMERIC); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, setName, indexName, binName, IndexType.NUMERIC); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryGeo.java b/test/src/com/aerospike/test/sync/query/TestQueryGeo.java index 118d27e80..692941066 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryGeo.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryGeo.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -45,11 +45,8 @@ public class TestQueryGeo extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, setName, indexName, binName, IndexType.GEO2DSPHERE); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, setName, indexName, binName, IndexType.GEO2DSPHERE); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryInteger.java b/test/src/com/aerospike/test/sync/query/TestQueryInteger.java index c7bfd4778..186ef6f42 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryInteger.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryInteger.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -42,11 +42,8 @@ public class TestQueryInteger extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryKey.java b/test/src/com/aerospike/test/sync/query/TestQueryKey.java index 013c9d931..c986c70ac 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryKey.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -44,11 +44,8 @@ public class TestQueryKey extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); itask.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQueryRPS.java b/test/src/com/aerospike/test/sync/query/TestQueryRPS.java index 4b332cb89..59bca48fe 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryRPS.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryRPS.java @@ -66,11 +66,8 @@ public static void prepare() { rtask0.waitTillComplete(); rtask1.waitTillComplete(); - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName1, IndexType.NUMERIC); itask.waitTillComplete(); } diff --git a/test/src/com/aerospike/test/sync/query/TestQueryString.java b/test/src/com/aerospike/test/sync/query/TestQueryString.java index 1ffb2ed36..92a2ea96a 100644 --- a/test/src/com/aerospike/test/sync/query/TestQueryString.java +++ b/test/src/com/aerospike/test/sync/query/TestQueryString.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -45,11 +45,8 @@ public class TestQueryString extends TestSync { @BeforeClass public static void prepare() { - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask task = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.STRING); + IndexTask task = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.STRING); task.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/sync/query/TestQuerySum.java b/test/src/com/aerospike/test/sync/query/TestQuerySum.java index 4acbf6371..ce7042095 100644 --- a/test/src/com/aerospike/test/sync/query/TestQuerySum.java +++ b/test/src/com/aerospike/test/sync/query/TestQuerySum.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -51,11 +51,8 @@ public static void prepare() { RegisterTask rtask = client.register(null, TestQuerySum.class.getClassLoader(), "udf/sum_example.lua", "sum_example.lua", Language.LUA); rtask.waitTillComplete(); - Policy policy = new Policy(); - policy.socketTimeout = 0; // Do not timeout on index create. - try { - IndexTask itask = client.createIndex(policy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); + IndexTask itask = client.createIndex(args.indexPolicy, args.namespace, args.set, indexName, binName, IndexType.NUMERIC); itask.waitTillComplete(); } catch (AerospikeException ae) { diff --git a/test/src/com/aerospike/test/util/Args.java b/test/src/com/aerospike/test/util/Args.java index 10c6d934e..b6965038a 100644 --- a/test/src/com/aerospike/test/util/Args.java +++ b/test/src/com/aerospike/test/util/Args.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 Aerospike, Inc. + * Copyright 2012-2024 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. @@ -36,6 +36,7 @@ import com.aerospike.client.cluster.Node; import com.aerospike.client.policy.AuthMode; import com.aerospike.client.policy.ClientPolicy; +import com.aerospike.client.policy.Policy; import com.aerospike.client.policy.TlsPolicy; import com.aerospike.client.util.Util; @@ -49,6 +50,7 @@ public class Args { public String password; public String namespace; public String set; + public final Policy indexPolicy; public TlsPolicy tlsPolicy; public EventLoopType eventLoopType = EventLoopType.DIRECT_NIO; public int socketTimeout = 30000; @@ -63,6 +65,9 @@ public Args() { namespace = "test"; set = "test"; + indexPolicy = new Policy(); + indexPolicy.setTimeout(10000); + String argString = System.getProperty("args"); if (argString == null || argString.trim().length() == 0) {