Name: jetcd
Owner: CoreOS
Description: etcd java client
Created: 2016-07-20 04:14:11.0
Updated: 2018-05-23 11:32:34.0
Pushed: 2018-05-23 11:32:32.0
Homepage: null
Size: 908
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
jetcd is the official java client for etcdv3.
Note: jetcd is work-in-progress and may break backward compatibility.
Java 8 or above is required.
endency>
roupId>com.coreos</groupId>
rtifactId>jetcd-core</artifactId>
ersion>0.0.2</version>
pendency>
Development snapshots are available in Sonatypes's snapshot repository.
ndencies {
compile 'com.coreos:jetcd-core:0.0.2'
Download latest jetcd-core jar from Maven and all its dependent jars:
grpc-core-1.10.0.jar grpc-netty-1.10.0.jar grpc-protobuf-1.10.0.jar grpc-stub-1.10.0.jar slf4j-api-1.7.2.jar
reate client
nt client = Client.builder().endpoints("http://localhost:2379").build();
vClient = client.getKVClient();
Sequence key = ByteSequence.fromString("test_key");
Sequence value = ByteSequence.fromString("test_value");
ut the key-value
ient.put(key, value).get();
et the CompletableFuture
letableFuture<GetResponse> getFuture = kvClient.get(key);
et the value from CompletableFuture
esponse response = getFuture.get();
elete the key
teResponse deleteRangeResponse = kvClient.delete(key).get();
For full etcd v3 API, plesase refer to API_Reference.
The examples are standalone projects that show usage of jetcd.
The project follows Semantic Versioning.
The current major version is zero (0.y.z). Anything may change at any time. The public API should not be considered stable.
The project is to be tested against a three node etcd
setup, which automatically launched via Testcontainers framework.
For more info and prerequisites visit official website
It should work on either macOS or Linux.
n test
O] T E S T S
O] -------------------------------------------------------
O] Running TestSuite
NING] Tests run: 104, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 31.308 s - in TestSuite
O]
O] Results:
O]
NING] Tests run: 104, Failures: 0, Errors: 0, Skipped: 3
O] Reactor Summary:
O]
O] jetcd .............................................. SUCCESS [ 0.010 s]
O] jetcd-core ......................................... SUCCESS [ 55.480 s]
O] jetcd-discovery-dns-srv ............................ SUCCESS [ 3.225 s]
O] jetcd-watch-example ................................ SUCCESS [ 0.291 s]
O] jetcd-simple-ctl ................................... SUCCESS [ 0.028 s]
O] jetcd-examples ..................................... SUCCESS [ 0.000 s]
O] ------------------------------------------------------------------------
O] BUILD SUCCESS
O] ------------------------------------------------------------------------
O] Total time: 59.929 s
O] Finished at: 2018-02-13T12:51:13-08:00
O] Final Memory: 84M/443M
See CONTRIBUTING for details on submitting patches and the contribution workflow.
See reporting bugs for details about reporting any issues.
jetcd is under the Apache 2.0 license. See the LICENSE file for details.