ntc-jrocksdb

ntc-jrocksdb is a module swapper java RocksDB

License

License

GroupId

GroupId

com.streetcodevn
ArtifactId

ArtifactId

ntc-jrocksdb
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ntc-jrocksdb
ntc-jrocksdb is a module swapper java RocksDB
Project URL

Project URL

https://github.com/congnghia0609/ntc-jrocksdb
Source Code Management

Source Code Management

https://github.com/congnghia0609/ntc-jrocksdb/tree/master

Download ntc-jrocksdb

How to add to project

<!-- https://jarcasting.com/artifacts/com.streetcodevn/ntc-jrocksdb/ -->
<dependency>
    <groupId>com.streetcodevn</groupId>
    <artifactId>ntc-jrocksdb</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.streetcodevn/ntc-jrocksdb/
implementation 'com.streetcodevn:ntc-jrocksdb:1.0.0'
// https://jarcasting.com/artifacts/com.streetcodevn/ntc-jrocksdb/
implementation ("com.streetcodevn:ntc-jrocksdb:1.0.0")
'com.streetcodevn:ntc-jrocksdb:jar:1.0.0'
<dependency org="com.streetcodevn" name="ntc-jrocksdb" rev="1.0.0">
  <artifact name="ntc-jrocksdb" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.streetcodevn', module='ntc-jrocksdb', version='1.0.0')
)
libraryDependencies += "com.streetcodevn" % "ntc-jrocksdb" % "1.0.0"
[com.streetcodevn/ntc-jrocksdb "1.0.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
ch.qos.logback : logback-classic jar 1.2.3
ch.qos.logback : logback-core jar 1.2.3
org.rocksdb : rocksdbjni jar 6.8.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

ntc-jrocksdb

ntc-jrocksdb is a module swapper java RocksDB

Maven

<dependency>
    <groupId>com.streetcodevn</groupId>
    <artifactId>ntc-jrocksdb</artifactId>
    <version>1.0.0</version>
</dependency>

Usage

NRSerializer nrs = new NRSerializer();
String dbPath = "./db";
RDBSingleConnection conn = RDBSingleConnection.getInstance(dbPath);


String key = "nghiatc";
String value = "handsome";
// Put Data
conn.put(key, value);
// Get Data
String rs1 = conn.get(key);
Assert.assertEquals(value, rs1);
String rs2 = nrs.deserializeString(conn.getByte(nrs.serializeString(key)));
Assert.assertEquals(value, rs2);
// Delete Data
conn.delete(key);
String rs3 = conn.get(key);
Assert.assertEquals(null, rs3);


conn.close();

License

This code is under the Apache License v2.

Versions

Version
1.0.0