GithubHelp home page GithubHelp logo

funcguy / jredisbloom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redisbloom/jredisbloom

0.0 1.0 0.0 1.05 MB

Java Client for RedisBloom probabilistic module

Home Page: https://redisbloom.io

License: BSD 2-Clause "Simplified" License

Java 100.00%

jredisbloom's Introduction

license GitHub issues CircleCI Maven Central Javadocs Codecov Language grade: Java

JRedisBloom

A Java Client Library for RedisBloom

Overview

This project contains a Java library abstracting the API of the RedisBloom Redis module, that implements a high performance bloom filter with an easy-to-use API

See http://redisbloom.io for installation instructions of the module.

Official Releases

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jrebloom</artifactId>
      <version>1.2.0</version>
    </dependency>
  </dependencies>

Snapshots

  <repositories>
    <repository>
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

and

  <dependencies>
    <dependency>
      <groupId>com.redislabs</groupId>
      <artifactId>jrebloom</artifactId>
      <version>2.0.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

Usage example

Initializing the client:

import io.rebloom.client.Client

Client client = new Client("localhost", 6378);

Adding items to a bloom filter (created using default settings):

client.add("simpleBloom", "Mark");
// Does "Mark" now exist?
client.exists("simpleBloom", "Mark"); // true
client.exists("simpleBloom", "Farnsworth"); // False

Use multi-methods to add/check multiple items at once:

client.addMulti("simpleBloom", "foo", "bar", "baz", "bat", "bag");

// Check if they exist:
boolean[] rv = client.existsMulti("simpleBloom", "foo", "bar", "baz", "bat", "mark", "nonexist");

Reserve a customized bloom filter:

client.createFilter("specialBloom", 10000, 0.0001);
client.add("specialBloom", "foo");

Use cluster client to call redis cluster Initializing the cluster client:

Set<HostAndPort> jedisClusterNodes = new HashSet<>();
jedisClusterNodes.add(new HostAndPort("localhost", 7000));
ClusterClient cclient = new ClusterClient(jedisClusterNodes);

Adding items to a bloom filter (created using default settings):

cclient.add("simpleBloom", "Mark");
// Does "Mark" now exist?
cclient.exists("simpleBloom", "Mark"); // true
cclient.exists("simpleBloom", "Farnsworth"); // False

all method of ClusterClient is same to Client.

jredisbloom's People

Contributors

gkorland avatar joyang1 avatar mnunberg avatar dvirsky avatar

Watchers

James Cloos avatar

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.