TiKV Java Client
Go to file
Jian Zhang 19a9ab0ae3
[close #436] fix license header for org.tikv.common (#452)
2021-12-30 17:14:30 +08:00
.ci ignore ci test with TxnKV (#281) 2021-09-30 13:37:22 +08:00
.github [close #436] fix license header for org.tikv.common (#452) 2021-12-30 17:14:30 +08:00
config ignore ci test with TxnKV (#281) 2021-09-30 13:37:22 +08:00
dev Reform java client to combine with TiSpark's java client (#91) 2020-10-21 19:10:18 +08:00
docs [to #348] add introduction for the whole document (#428) 2021-12-22 21:34:42 +08:00
metrics/grafana add grafana metrics for circuit break (#398) 2021-12-14 14:30:34 +08:00
scripts support DataEncode in BackupMeta (#287) 2021-10-25 10:10:27 +08:00
src [close #436] fix license header for org.tikv.common (#452) 2021-12-30 17:14:30 +08:00
.gitignore [to #348] Add javadoc (#447) 2021-12-28 09:33:26 +08:00
LICENSE init 2018-11-15 17:11:42 +08:00
Makefile add Makeflie to simplify build/test/format tasks (#346) 2021-11-29 17:25:41 +08:00
README.md [to #348] Add javadoc (#447) 2021-12-28 09:33:26 +08:00
pom.xml set autoReleaseAfterClose to true (#450) 2021-12-30 14:07:43 +08:00
shell.nix fix build issue in `nix-shell --pure` (#190) 2021-06-09 09:48:21 +08:00

README.md

TiKV JAVA Client

A Java client for TiDB/TiKV. It is supposed to:

  • Communicate via gRPC
  • Talk to Placement Driver searching for a region
  • Talk to TiKV for reading/writing data and the resulted data is encoded/decoded just like what we do in TiDB.
  • Talk to Coprocessor for calculation pushdown

Quick Start

TiKV Java Client is designed to communicate with pd and tikv, please run TiKV and PD in advance.

Build java client from source file:

mvn clean install -Dmaven.test.skip=true

Add maven dependency to pom.xml:

<dependency>
	<groupId>org.tikv</groupId>
	<artifactId>tikv-client-java</artifactId>
	<version>3.1.0</version>
</dependency>

Create a RawKVClient and communicates with TiKV:

import org.tikv.common.TiConfiguration;
import org.tikv.common.TiSession;
import org.tikv.raw.RawKVClient;

public class Main {
	public static void main() {
		// You MUST create a raw configuration if you are using RawKVClient.
		TiConfiguration conf = TiConfiguration.createRawDefault(YOUR_PD_ADDRESSES);
		TiSession session = TiSession.create(conf);
		RawKVClient client = session.createRawClient();
	}
}

Find more demo in KVRawClientTest

Documentation

See Java Client Documents for references about how to config and monitor Java Client.

An API reference is also available.

Community

See Contribution Guide for references about how to contribute to this project.

License

Apache 2.0 license. See the LICENSE file for details.