Skip to content

Commit

Permalink
CLIENT-2454 Support new proxy client that is used in our database-as-…
Browse files Browse the repository at this point in the history
…a-service (dbaas) offering.

- Use IAerospikeClient interface in examples, benchmarks and test.
- Add new proxy client directory. Main class is AerospikeClientProxy.
- Add SuiteProxy for tests that can be run against the proxy server.
  • Loading branch information
BrianNichols committed Aug 1, 2023
1 parent 80c508c commit 669069f
Show file tree
Hide file tree
Showing 134 changed files with 11,374 additions and 514 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and upload proxy client to JFrog

on:
push:
branches:
- stage
# TODO: snapshots_private has been removed from base parent pom.xml. Need to add workflow code to write snapshots_private to local pipeline pom.xml (this workflow will not work until that is done)

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Java client
uses: actions/checkout@v2

- name: Set up settings.xml for Maven
uses: s4u/maven-settings-action@v2.8.0
with:
servers: '[{"id": "snapshots_private", "username": "${{ secrets.JFROG_USERNAME }}", "password": "${{ secrets.JFROG_MAVEN_TOKEN }}"}]'

- name: Build Java client
run: mvn install

- name: Upload to JFrog
run: mvn deploy
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ apidocs
*.out
*.jar
*.iml
.idea/
.idea/
dependency-reduced-pom.xml
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,16 @@ Aerospike Java Client Package

Aerospike Java client. This package contains full source code for these projects.

* client: Java client library.
* examples: Java client examples.
* benchmarks: Java client benchmarks.
* test: Java client unit tests.
* client: Java native client library.
* proxy: Java proxy client library for dbaas (database as a service).
* examples: Java client examples.
* benchmarks: Java client benchmarks.
* test: Java client unit tests.

Prerequisites:

* Java 1.8 or greater.
* Maven 3.0 or greater.

AerospikeClient now supports synchronous and asynchronous methods. Asynchronous
methods can utilize either Netty event loops or direct NIO event loops.

The Netty library artifacts (netty-transport and netty-handler) are declared optional.
If your application's build file (pom.xml) declares these Netty library artifacts as
dependencies, then the Netty libraries will be included in your application's jar.
Otherwise, you application's jar will not include any Netty code.
* Java 8+
* Maven 3.0+

The source code can be imported into any Java IDE.
Maven build scripts are also provided.
Expand Down
43 changes: 22 additions & 21 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<artifactId>aerospike-client</artifactId>
</dependency>

<dependency>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-proxy-client</artifactId>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
Expand Down Expand Up @@ -61,34 +66,30 @@
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.aerospike.benchmarks.Main</mainClass>
</manifest>
</archive>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>make-my-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>jar-with-dependencies</shadedClassifierName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.aerospike.benchmarks.Main</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

</project>
8 changes: 4 additions & 4 deletions benchmarks/src/com/aerospike/benchmarks/InsertTaskAsync.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 All @@ -16,17 +16,17 @@
*/
package com.aerospike.benchmarks;

import com.aerospike.client.AerospikeClient;
import com.aerospike.client.AerospikeException;
import com.aerospike.client.Bin;
import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.Key;
import com.aerospike.client.async.EventLoop;
import com.aerospike.client.listener.WriteListener;
import com.aerospike.client.util.RandomShift;

public final class InsertTaskAsync extends InsertTask {

private final AerospikeClient client;
private final IAerospikeClient client;
private final EventLoop eventLoop;
private final RandomShift random;
private final WriteListener listener;
Expand All @@ -37,7 +37,7 @@ public final class InsertTaskAsync extends InsertTask {
private final boolean useLatency;

public InsertTaskAsync(
AerospikeClient client,
IAerospikeClient client,
EventLoop eventLoop,
Arguments args,
CounterStore counters,
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/src/com/aerospike/benchmarks/InsertTaskSync.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 All @@ -16,20 +16,20 @@
*/
package com.aerospike.benchmarks;

import com.aerospike.client.AerospikeClient;
import com.aerospike.client.AerospikeException;
import com.aerospike.client.Bin;
import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.Key;
import com.aerospike.client.util.RandomShift;
import com.aerospike.client.util.Util;

public final class InsertTaskSync extends InsertTask implements Runnable {

private final AerospikeClient client;
private final IAerospikeClient client;
private final long keyStart;
private final long keyCount;

public InsertTaskSync(AerospikeClient client, Arguments args, CounterStore counters, long keyStart, long keyCount) {
public InsertTaskSync(IAerospikeClient client, Arguments args, CounterStore counters, long keyStart, long keyCount) {
super(args, counters);
this.client = client;
this.keyStart = keyStart;
Expand Down
Loading

0 comments on commit 669069f

Please sign in to comment.