Git Product home page Git Product logo

cassandra-zstd's Introduction

cassandra-zstd

This will allow you to use Zstandard compression in Cassandra 3.x

Zstandard

Zstandard is a Facebooks efficient opensource compression algorithm that can be located here: zstd

It is implemented in C library, so to make it usable in Java this project is used: zstd-jni

Installation

You can build the project yourself or access it via Gradle:

compile 'com.github.matejtymes:cassandra-zstd:0.2.0'

Maven:

<dependency>
    <groupId>com.github.matejtymes</groupId>
    <artifactId>cassandra-zstd</artifactId>
    <version>0.2.0</version>
</dependency>

or your other preferred dependency manager.

Then you have to copy the final jar and its zstd-jni dependency into the cassandra folder

cp cassandra-zstd-{version}.jar {cassandra_home}/lib
cp zstd-jni-{version}.jar {cassandra_home}/lib

Configuration

To create a new table with Zstandard compression enabled you have to add this setting to it:

CREATE TABLE KEYSPACE_NAME.TABLE_NAME (
  ...
) WITH compression = { 'sstable_compression': 'org.apache.cassandra.io.compress.ZstdCompressor', [options] }

To update the compression algorithm on already existing table please execute this command:

ALTER TABLE KEYSPACE_NAME.TABLE_NAME 
WITH compression = { 'sstable_compression': 'org.apache.cassandra.io.compress.ZstdCompressor', [options] }

Options

There is currently only one option available

  • compression_level - if no value is defined 1 will be used as the default value. (To find more details about the compression levels please consult the Picking a compression level section in here)

You can choose to omit the options and the defaults will be used:

... WITH compression = { 'sstable_compression': 'org.apache.cassandra.io.compress.ZstdCompressor' }

or you can define your own value:

... WITH compression = { 'sstable_compression': 'org.apache.cassandra.io.compress.ZstdCompressor',  'compression_level': '16'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.