Skip to content

Commit

Permalink
CLIENT-2323 Remove all references to single-bin mode. Server version …
Browse files Browse the repository at this point in the history
…6.4 will remove single-bin functionality.
  • Loading branch information
BrianNichols committed Jul 25, 2023
1 parent 64ca6a5 commit 8251537
Show file tree
Hide file tree
Showing 61 changed files with 159 additions and 258 deletions.
4 changes: 0 additions & 4 deletions client/src/com/aerospike/client/AerospikeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@
* writing and reading records, and selecting sets of records. Write operations
* include specialized functionality such as append/prepend and arithmetic
* addition.
* <p>
* Each record may have multiple bins, unless the Aerospike server nodes are
* configured as "single-bin". In "multi-bin" mode, partial records may be
* written or read by specifying the relevant subset of bins.
*/
public class AerospikeClient implements IAerospikeClient, Closeable {
//-------------------------------------------------------
Expand Down
31 changes: 1 addition & 30 deletions client/src/com/aerospike/client/Bin.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public final class Bin {

/**
* Constructor, specifying bin name and string value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -51,7 +50,6 @@ public Bin(String name, String value) {

/**
* Constructor, specifying bin name and byte array value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -63,7 +61,6 @@ public Bin(String name, byte[] value) {

/**
* Constructor, specifying bin name, byte array value and particle type.
* For servers configured as "single-bin", enter a null or empty name.
* For internal use only.
*
* @param name bin name, current limit is 15 characters
Expand All @@ -77,7 +74,6 @@ public Bin(String name, byte[] value, int type) {

/**
* Constructor, specifying bin name and byte array segment value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value byte array value
Expand All @@ -91,7 +87,6 @@ public Bin(String name, byte[] value, int offset, int length) {

/**
* Constructor, specifying bin name and byte value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -104,7 +99,6 @@ public Bin(String name, byte value) {
/**
* Constructor, specifying bin name and short value.
* The server will convert all shorts to longs.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -117,7 +111,6 @@ public Bin(String name, short value) {
/**
* Constructor, specifying bin name and integer value.
* The server will convert all integers to longs.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -129,7 +122,6 @@ public Bin(String name, int value) {

/**
* Constructor, specifying bin name and long value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -141,8 +133,6 @@ public Bin(String name, long value) {

/**
* Constructor, specifying bin name and double value.
* <p>
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -154,8 +144,6 @@ public Bin(String name, double value) {

/**
* Constructor, specifying bin name and float value.
* <p>
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -167,7 +155,6 @@ public Bin(String name, float value) {

/**
* Constructor, specifying bin name and boolean value.
* For servers configured as "single-bin", enter a null or empty name.
* Either a boolean or integer bin is sent to the server, depending
* on configuration {@link com.aerospike.client.Value#UseBoolBin}.
*
Expand All @@ -181,14 +168,6 @@ public Bin(String name, boolean value) {

/**
* Create bin with a list value. The list value will be serialized as a server list type.
* <p>
* If connecting to Aerospike 2 servers, use the following instead:
* <pre>
* {@code
* Bin bin = new Bin(name, (Object)list);
* }
* </pre>
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -200,7 +179,6 @@ public Bin(String name, List<?> value) {

/**
* Create bin with a map value. The map value will be serialized as a server map type.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -212,7 +190,6 @@ public Bin(String name, Map<?,?> value) {

/**
* Create bin with a sorted map value. The map value will be serialized as a server ordered map type.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -228,7 +205,6 @@ public Bin(String name, SortedMap<?,?> value) {
* Use {@link Bin#Bin(String, SortedMap)} if the map is sorted (like TreeMap).
* <p>
* Create bin with a map value and order. The map value will be serialized as a server map type.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value, pass in a {@link java.util.SortedMap} instance if map order is sorted.
Expand All @@ -242,8 +218,7 @@ public Bin(String name, Map<?,?> value, MapOrder mapOrder) {

/**
* Create a map bin from a list of key/value entries. The value will be serialized as a
* server map type with specified mapOrder. For servers configured as "single-bin", enter
* a null or empty name.
* server map type with specified mapOrder.
*
* @param name bin name, current limit is 15 characters
* @param value list of key/value entries already in desired sorted order
Expand All @@ -256,7 +231,6 @@ public Bin(String name, List<? extends Entry<?,?>> value, MapOrder mapOrder) {

/**
* Constructor, specifying bin name and value.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
* @param value bin value
Expand All @@ -274,7 +248,6 @@ public Bin(String name, Value value) {
* To disable this constructor, set {@link com.aerospike.client.Value#DisableSerializer} to true.
*
* @param name bin name, current limit is 15 characters.
* For servers configured as "single-bin", enter a null or empty name.
* @param value bin value
*/
public Bin(String name, Object value) {
Expand All @@ -290,7 +263,6 @@ public Bin(String name, Object value) {
* To disable this method, set {@link com.aerospike.client.Value#DisableSerializer} to true.
*
* @param name bin name, current limit is 15 characters.
* For servers configured as "single-bin", enter a null or empty name.
* @param value bin value
*/
public static Bin asBlob(String name, Object value) {
Expand All @@ -299,7 +271,6 @@ public static Bin asBlob(String name, Object value) {

/**
* Create bin with a null value. This is useful for bin deletions within a record.
* For servers configured as "single-bin", enter a null or empty name.
*
* @param name bin name, current limit is 15 characters
*/
Expand Down
3 changes: 1 addition & 2 deletions client/src/com/aerospike/client/Record.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -58,7 +58,6 @@ public Record(

/**
* Get bin value given bin name.
* Enter empty string ("") for servers configured as single-bin.
*/
public Object getValue(String name) {
return (bins == null)? null : bins.get(name);
Expand Down
5 changes: 2 additions & 3 deletions client/src/com/aerospike/client/ResultCode.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -148,8 +148,7 @@ public final class ResultCode {
public static final int PARTITION_UNAVAILABLE = 11;

/**
* Operation is not supported with configured bin type (single-bin or
* multi-bin).
* Operation is not supported with configured bin type.
*/
public static final int BIN_TYPE_ERROR = 12;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/Add.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -34,7 +34,7 @@ public Add(Console console) {
@Override
public void runExample(AerospikeClient client, Parameters params) throws Exception {
Key key = new Key(params.namespace, params.set, "addkey");
String binName = params.getBinName("addbin");
String binName = "addbin";

// Delete record if it already exists.
client.delete(params.writePolicy, key);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/Append.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -33,7 +33,7 @@ public Append(Console console) {
@Override
public void runExample(AerospikeClient client, Parameters params) throws Exception {
Key key = new Key(params.namespace, params.set, "appendkey");
String binName = params.getBinName("appendbin");
String binName = "appendbin";

// Delete record if it already exists.
client.delete(params.writePolicy, key);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/AsyncBatch.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -53,7 +53,7 @@ public class AsyncBatch extends AsyncExample {
public void runExample(AerospikeClient client, EventLoop eventLoop) {
this.client = client;
this.eventLoop = eventLoop;
this.binName = params.getBinName("batchbin");
this.binName = "batchbin";

initializeKeys();
writeRecords();
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/AsyncExample.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -96,7 +96,7 @@ public static void runExamples(Console console, Parameters params, List<String>

try {
EventLoop eventLoop = eventLoops.get(0);
params.setServerSpecific(client);
//params.setServerSpecific(client);

for (String exampleName : examples) {
runExample(exampleName, client, eventLoop, params, console);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/AsyncPutGet.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -35,7 +35,7 @@ public class AsyncPutGet extends AsyncExample {
@Override
public void runExample(AerospikeClient client, EventLoop eventLoop) {
Key key = new Key(params.namespace, params.set, "putgetkey");
Bin bin = new Bin(params.getBinName("putgetbin"), "value");
Bin bin = new Bin("putgetbin", "value");

runPutGetInline(client, eventLoop, key, bin);
runPutGetWithRetry(client, eventLoop, key, bin);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/AsyncQuery.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -43,7 +43,7 @@ public class AsyncQuery extends AsyncExample {
public void runExample(AerospikeClient client, EventLoop eventLoop) {
String indexName = "asqindex";
String keyPrefix = "asqkey";
String binName = params.getBinName("asqbin");
String binName = "asqbin";
int size = 50;

createIndex(client, indexName, binName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -43,7 +43,7 @@ private void register(AerospikeClient client) {

private void writeUsingUdfAsync(final AerospikeClient client, final EventLoop eventLoop) {
final Key key = new Key(params.namespace, params.set, "audfkey1");
final Bin bin = new Bin(params.getBinName("audfbin1"), "string value");
final Bin bin = new Bin("audfbin1", "string value");

console.info("Write with udf: namespace=%s set=%s key=%s value=%s", key.namespace, key.setName, key.userKey, bin.value);

Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/Batch.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -39,7 +39,7 @@ public Batch(Console console) {
public void runExample(AerospikeClient client, Parameters params) throws Exception {
String keyPrefix = "batchkey";
String valuePrefix = "batchvalue";
String binName = params.getBinName("batchbin");
String binName = "batchbin";
int size = 8;

writeRecords(client, params, keyPrefix, binName, valuePrefix, size);
Expand Down
11 changes: 3 additions & 8 deletions examples/src/com/aerospike/examples/DeleteBin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -34,15 +34,10 @@ public DeleteBin(Console console) {
*/
@Override
public void runExample(AerospikeClient client, Parameters params) throws Exception {
if (params.singleBin) {
console.info("Delete bin is not applicable to single bin servers.");
return;
}

console.info("Write multi-bin record.");
Key key = new Key(params.namespace, params.set, "delbinkey");
String binName1 = params.getBinName("bin1");
String binName2 = params.getBinName("bin2");
String binName1 = "bin1";
String binName2 = "bin2";
Bin bin1 = new Bin(binName1, "value1");
Bin bin2 = new Bin(binName2, "value2");
client.put(params.writePolicy, key, bin1, bin2);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/Example.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -45,7 +45,7 @@ public static void runExamples(Console console, Parameters params, List<String>
AerospikeClient client = new AerospikeClient(policy, hosts);

try {
params.setServerSpecific(client);
//params.setServerSpecific(client);

for (String exampleName : examples) {
runExample(exampleName, client, params, console);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/com/aerospike/examples/Expire.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 Aerospike, Inc.
* Copyright 2012-2023 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.
Expand Down Expand Up @@ -41,7 +41,7 @@ public void runExample(AerospikeClient client, Parameters params) throws Excepti
*/
private void expireExample(AerospikeClient client, Parameters params) throws Exception {
Key key = new Key(params.namespace, params.set, "expirekey ");
Bin bin = new Bin(params.getBinName("expirebin"), "expirevalue");
Bin bin = new Bin("expirebin", "expirevalue");

console.info("Put: namespace=%s set=%s key=%s bin=%s value=%s expiration=2",
key.namespace, key.setName, key.userKey, bin.name, bin.value);
Expand Down
Loading

0 comments on commit 8251537

Please sign in to comment.