Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/haducloc/appslandia-scaling

Appslandia Scaling
https://github.com/haducloc/appslandia-scaling

java rocksdb

Last synced: about 2 months ago
JSON representation

Appslandia Scaling

Awesome Lists containing this project

README

        

# Appslandia Scaling

## Features

- **Facebook RocksDB** Utilizing

## Installation

### Maven
```XML

com.appslandia
appslandia-scaling
{LATEST_VERSION}

com.appslandia
appslandia-common
{LATEST_VERSION}

```

### Gradle
```
dependencies {
compile 'com.appslandia:appslandia-scaling:{LATEST_VERSION}'
compile 'com.appslandia:appslandia-common:{LATEST_VERSION}'
}
```

## Sample Usage

### RocksDB
``` java
List descriptors = new ArrayList<>();

// DEFAULT_COLUMN_FAMILY is required at index 0
descriptors.add(RocksUtils.newCfDescriptor(RocksManager.DEFAULT_COLUMN_FAMILY, new ColumnFamilyOptions()));
descriptors.add(RocksUtils.newCfDescriptor("other_column_family", new ColumnFamilyOptions()));

DBOptions dbOptions = RocksUtils.newDBOptions().setCreateIfMissing(true).setCreateMissingColumnFamilies(true);
boolean readOnlyMode = false;
RocksCloseable rocksCloseable = RocksUtils.newRocksCloseable().add(descriptors).add(dbOptions);

try (RocksManager db = RocksManager.open("database_dir", dbOptions, readOnlyMode, descriptors, rocksCloseable)) {

// db.put, db.get, db.delete, db.newRocksIterator, db.newRocksEntryIterator, etc.

} catch (RocksDBException ex) {
ex.printStackTrace();
}
```

## Questions?
Please feel free to contact me if you have any questions or comments.
Email: [email protected]

## License
This code is distributed under the terms and conditions of the [MIT license](LICENSE).