Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REL-2539 Java Client 8.1.2 for JDK8 #327

Merged
merged 18 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
58c0032
CLIENT-2839 Add methods for copying default policies:
BrianNichols Mar 26, 2024
c95dd91
CLIENT-2843 Add getKeyRecord() in RecordSet and RecordSequenceRecordSet.
agrgr Mar 28, 2024
b2102be
CLIENT-2842 Use default batch policy (ClientPolicy batchWritePolicyDe…
BrianNichols Mar 28, 2024
5ffd6fb
CLIENT-2868 Add readTouchTtlPercent command line option to benchmarks.
BrianNichols Apr 5, 2024
8b11ca7
Code cleanup in benchmarks.
Apr 5, 2024
d5edebc
Propagate the original LuaC compile() exception details in AerospikeE…
griffinjm Apr 15, 2024
e0dc58b
CLIENT-2902 Only validate error code instead of entire error string i…
BrianNichols Apr 25, 2024
c136578
Upgrade to netty 4.1.108.Final and commons-cli 1.7.0 per snyk.
BrianNichols May 7, 2024
1f8ffa9
Update version 8.1.1
BrianNichols May 7, 2024
5081d47
Update copyright year in Crypto.java.
BrianNichols May 8, 2024
155391e
CLIENT-2933 If binNames array is specified and empty, read all bins.
BrianNichols May 13, 2024
3657d79
CLIENT-2962 Remove unnecessary imports.
BrianNichols May 21, 2024
b9831bf
CLIENT-2971 Make metrics classes public in javadoc.
BrianNichols May 28, 2024
d604732
CLIENT-2972 Allow scan to work in a mixed cluster of server 5.7 and 6…
BrianNichols May 29, 2024
fddac7e
CLIENT-2978 Support new server 7.1 info command error response strings.
BrianNichols May 30, 2024
524b74a
CLIENT-3002 Change ReadModeSC doc from server to client perspective.
BrianNichols Jun 14, 2024
df263d2
Upgrade to netty 4.1.110.Final and commons-cli 1.8.0 per snyk.
BrianNichols Jun 24, 2024
97a654f
Update version 8.1.2
BrianNichols Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-parent</artifactId>
<version>8.1.0</version>
<version>8.1.2</version>
</parent>
<artifactId>aerospike-benchmarks</artifactId>
<packaging>jar</packaging>
Expand Down
18 changes: 6 additions & 12 deletions benchmarks/src/com/aerospike/benchmarks/InsertTaskSync.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -16,9 +16,6 @@
*/
package com.aerospike.benchmarks;

import java.util.HashMap;
import java.util.Map;

import com.aerospike.client.AerospikeException;
import com.aerospike.client.Bin;
import com.aerospike.client.IAerospikeClient;
Expand Down Expand Up @@ -87,11 +84,11 @@ private void runCommand(long keyCurrent, RandomShift random) {
private void put(Key key, Bin[] bins) {
if (counters.write.latency != null) {
long begin = System.nanoTime();

if (! skipKey(key)) {
client.put(args.writePolicy, key, bins);
}

long elapsed = System.nanoTime() - begin;
counters.write.count.getAndIncrement();
counters.write.latency.add(elapsed);
Expand All @@ -103,11 +100,8 @@ private void put(Key key, Bin[] bins) {
counters.write.count.getAndIncrement();
}
}

private boolean skipKey(Key key) {
if (args.partitionIds != null && !args.partitionIds.contains(Partition.getPartitionId(key.digest))) {
return true;
}
return false;
}
return args.partitionIds != null && !args.partitionIds.contains(Partition.getPartitionId(key.digest));
}
}
4 changes: 2 additions & 2 deletions benchmarks/src/com/aerospike/benchmarks/KeyType.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -17,5 +17,5 @@
package com.aerospike.benchmarks;

public enum KeyType {
STRING, INTEGER;
STRING, INTEGER
}
12 changes: 6 additions & 6 deletions benchmarks/src/com/aerospike/benchmarks/LatencyManager.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -20,9 +20,9 @@

public interface LatencyManager {

public void add(long elapsed);
void add(long elapsed);

public void printHeader(PrintStream stream);
void printHeader(PrintStream stream);

/**
* Print latency percents for specified cumulative ranges.
Expand All @@ -32,9 +32,9 @@ public interface LatencyManager {
* affects performance. Fortunately, the values will even out over time
* (ie. no double counting).
*/
public void printResults(PrintStream stream, String prefix);
void printResults(PrintStream stream, String prefix);

public void printSummaryHeader(PrintStream stream);
void printSummaryHeader(PrintStream stream);

public void printSummary(PrintStream stream, String prefix);
void printSummary(PrintStream stream, String prefix);
}
26 changes: 13 additions & 13 deletions benchmarks/src/com/aerospike/benchmarks/LatencyManagerYcsb.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -25,21 +25,21 @@ public class LatencyManagerYcsb implements LatencyManager {
public static final String BUCKETS = "histogram.buckets";
public static final String BUCKETS_DEFAULT = "1000";

private AtomicInteger _buckets;
private AtomicLongArray histogram;
private AtomicLong histogramoverflow;
private AtomicInteger operations;
private AtomicLong totallatency;
private AtomicInteger warmupCount;
private final AtomicInteger _buckets;
private final AtomicLongArray histogram;
private final AtomicLong histogramoverflow;
private final AtomicInteger operations;
private final AtomicLong totallatency;
private final AtomicInteger warmupCount;
private volatile boolean warmupComplete = false;

//keep a windowed version of these stats for printing status
private AtomicInteger windowoperations;
private AtomicLong windowtotallatency;
private final AtomicInteger windowoperations;
private final AtomicLong windowtotallatency;

private AtomicLong min;
private AtomicLong max;
private String name;
private final AtomicLong min;
private final AtomicLong max;
private final String name;

public LatencyManagerYcsb(String name, int warmupCount) {
this.name = name;
Expand Down Expand Up @@ -125,7 +125,7 @@ public void printResults(PrintStream exporter, String prefix) {
}
}
buffer.append(']');
exporter.println(buffer.toString());
exporter.println(buffer);
windowoperations.set(0);
windowtotallatency.set(0);
}
Expand Down
82 changes: 50 additions & 32 deletions benchmarks/src/com/aerospike/benchmarks/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public static void main(String[] args) {
}
}

private Arguments args = new Arguments();
private Host[] hosts;
private final Arguments args = new Arguments();
private final Host[] hosts;
private EventLoopType eventLoopType = EventLoopType.DIRECT_NIO;
private int port = 3000;
private long nKeys;
Expand All @@ -112,8 +112,8 @@ public static void main(String[] args) {
private String filepath;

private EventLoops eventLoops;
private ClientPolicy clientPolicy = new ClientPolicy();
private CounterStore counters = new CounterStore();
private final ClientPolicy clientPolicy = new ClientPolicy();
private final CounterStore counters = new CounterStore();

public Main(String[] commandLineArgs) throws Exception {
boolean hasTxns = false;
Expand Down Expand Up @@ -221,6 +221,11 @@ public Main(String[] commandLineArgs) throws Exception {
" 0: Default to namespace expiration time\n" +
" >0: Actual given expiration time"
);
options.addOption("rt", "readTouchTtlPercent", true,
"Read touch TTL percent is expressed as a percentage of the TTL (or expiration) sent on the most\n" +
"recent write such that a read within this interval of the record’s end of life will generate a touch.\n" +
"Range: 0 - 100"
);
options.addOption("g", "throughput", true,
"Set a target transactions per second for the client. The client should not exceed this " +
"average throughput."
Expand Down Expand Up @@ -395,6 +400,14 @@ public Main(String[] commandLineArgs) throws Exception {
}
}

if (line.hasOption("readTouchTtlPercent")) {
args.readPolicy.readTouchTtlPercent = Integer.parseInt(line.getOptionValue("readTouchTtlPercent"));
if (args.readPolicy.readTouchTtlPercent < 0 || args.readPolicy.readTouchTtlPercent > 100) {
throw new Exception("Invalid readTouchTtlPercent: " + args.readPolicy.readTouchTtlPercent +
" Range: 0 - 100");
}
}

if (line.hasOption("port")) {
this.port = Integer.parseInt(line.getOptionValue("port"));
}
Expand Down Expand Up @@ -1053,19 +1066,21 @@ else if (! level.equals("all")) {
if (args.workload != Workload.INITIALIZE) {
System.out.println("read policy:");
System.out.println(
" connectTimeout: " + args.readPolicy.connectTimeout
+ ", socketTimeout: " + args.readPolicy.socketTimeout
+ ", totalTimeout: " + args.readPolicy.totalTimeout
+ ", timeoutDelay: " + args.readPolicy.timeoutDelay
+ ", maxRetries: " + args.readPolicy.maxRetries
+ ", sleepBetweenRetries: " + args.readPolicy.sleepBetweenRetries
);
" connectTimeout: " + args.readPolicy.connectTimeout
+ ", socketTimeout: " + args.readPolicy.socketTimeout
+ ", totalTimeout: " + args.readPolicy.totalTimeout
+ ", timeoutDelay: " + args.readPolicy.timeoutDelay
+ ", maxRetries: " + args.readPolicy.maxRetries
+ ", sleepBetweenRetries: " + args.readPolicy.sleepBetweenRetries
);

System.out.println(
" readModeAP: " + args.readPolicy.readModeAP
+ ", readModeSC: " + args.readPolicy.readModeSC
+ ", replica: " + args.readPolicy.replica
+ ", reportNotFound: " + args.reportNotFound);
" readModeAP: " + args.readPolicy.readModeAP
+ ", readModeSC: " + args.readPolicy.readModeSC
+ ", replica: " + args.readPolicy.replica
+ ", readTouchTtlPercent: " + args.readPolicy.readTouchTtlPercent
+ ", reportNotFound: " + args.reportNotFound
);
}

System.out.println("write policy:");
Expand All @@ -1078,7 +1093,10 @@ else if (! level.equals("all")) {
+ ", sleepBetweenRetries: " + args.writePolicy.sleepBetweenRetries
);

System.out.println(" commitLevel: " + args.writePolicy.commitLevel);
System.out.println(
" commitLevel: " + args.writePolicy.commitLevel
+ ", expiration: " + args.writePolicy.expiration
);

if (args.batchSize > 1) {
System.out.println("batch size: " + args.batchSize
Expand All @@ -1100,25 +1118,25 @@ else if (! level.equals("all")) {
System.out.print("bin[" + binCount + "]: ");

switch (spec.type) {
case INTEGER:
System.out.println("integer");
break;
case INTEGER:
System.out.println("integer");
break;

case STRING:
System.out.println("string[" + spec.size + "]");
break;
case STRING:
System.out.println("string[" + spec.size + "]");
break;

case BYTES:
System.out.println("byte[" + spec.size + "]");
break;
case BYTES:
System.out.println("byte[" + spec.size + "]");
break;

case RANDOM:
System.out.println("random[" + (spec.size * 8) + "]");
break;
case RANDOM:
System.out.println("random[" + (spec.size * 8) + "]");
break;

case TIMESTAMP:
System.out.println("timestamp");
break;
case TIMESTAMP:
System.out.println("timestamp");
break;
}
binCount++;
}
Expand All @@ -1143,7 +1161,7 @@ private static void logUsage(Options options) {
String syntax = Main.class.getName() + " [<options>]";
formatter.printHelp(pw, 100, syntax, "options:", options, 0, 2, null);

System.out.println(sw.toString());
System.out.println(sw);
}

private static String getLatencyUsage(String latencyString) {
Expand Down
46 changes: 23 additions & 23 deletions benchmarks/src/com/aerospike/benchmarks/RWTask.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -59,41 +59,41 @@ public void stop() {
protected void runCommand(RandomShift random) {
try {
switch (args.workload) {
case READ_UPDATE:
case READ_REPLACE:
readUpdate(random);
break;
case READ_UPDATE:
case READ_REPLACE:
readUpdate(random);
break;

case READ_MODIFY_UPDATE:
readModifyUpdate(random);
break;
case READ_MODIFY_UPDATE:
readModifyUpdate(random);
break;

case READ_MODIFY_INCREMENT:
readModifyIncrement(random);
break;
case READ_MODIFY_INCREMENT:
readModifyIncrement(random);
break;

case READ_MODIFY_DECREMENT:
readModifyDecrement(random);
break;
case READ_MODIFY_DECREMENT:
readModifyDecrement(random);
break;

case READ_FROM_FILE:
readFromFile(random);
break;
case READ_FROM_FILE:
readFromFile(random);
break;

case TRANSACTION:
runTransaction(random);
break;
case TRANSACTION:
runTransaction(random);
break;

default:
break;
default:
break;
}
}
catch (Exception e) {
if (args.debug) {
e.printStackTrace();
}
else {
System.out.println("Exception - " + e.toString());
System.out.println("Exception - " + e);
}
}
}
Expand Down
Loading
Loading