All Projects → pilosa → java-pilosa

pilosa / java-pilosa

Licence: BSD-3-Clause license
Java client library for Pilosa

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to java-pilosa

Pilosa
Pilosa is an open source, distributed bitmap index that dramatically accelerates queries across multiple, massive data sets.
Stars: ✭ 2,224 (+12255.56%)
Mutual labels:  pilosa
getting-started
Code and Data for Getting Started documentation
Stars: ✭ 20 (+11.11%)
Mutual labels:  pilosa

Java Client for Pilosa

This repo archived Sept 2022 as part of the transition from Pilosa to FeatureBase. Please contact community[at]featurebase[dot]com with any questions.

Javadocs

Java client for Pilosa high performance distributed index.

What's New?

See: CHANGELOG

Requirements

  • JDK 7 and higher
  • Maven 3 and higher

Install

Add the following dependency in your pom.xml:

<dependencies>
    <dependency>
        <groupId>com.pilosa</groupId>
        <artifactId>pilosa-client</artifactId>
        <version>1.4.0</version>
    </dependency>
</dependencies>

Usage

Quick overview

Assuming Pilosa server is running at localhost:10101 (the default):

// Create the default client
PilosaClient client = PilosaClient.defaultClient();

// Retrieve the schema
Schema schema = client.readSchema();

// Create an Index object
Index myindex = schema.index("myindex");

// Create a Field object
Field myfield = myindex.field("myfield");

// make sure the index and field exists on the server
client.syncSchema(schema);

// Send a Set query. PilosaException is thrown if execution of the query fails.
client.query(myfield.set(5, 42));

// Send a Row query. PilosaException is thrown if execution of the query fails.
QueryResponse response = client.query(myfield.row(5));

// Get the result
QueryResult result = response.getResult();

// Act on the result
if (result != null) {
    List<Long> columns = result.getRow().getColumns();
    System.out.println("Got columns: " + columns);
}

// You can batch queries to improve throughput
response = client.query(
    myindex.batchQuery(
        myfield.row(5),
        myfield.row(10)
    )
);
for (Object r : response.getResults()) {
    // Act on the result
}

Documentation

Data Model and Queries

See: Data Model and Queries

Executing Queries

See: Server Interaction

Importing and Exporting Data

See: Importing Data

Contributing

See: CONTRIBUTING

License

See: LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].