Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Repository files navigation

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 clientPilosaClientclient = PilosaClient.defaultClient();
// Retrieve the schemaSchemaschema = client.readSchema();
// Create an Index objectIndexmyindex = schema.index("myindex");
// Create a Field objectFieldmyfield = myindex.field("myfield");
// make sure the index and field exists on the serverclient.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.QueryResponseresponse = client.query(myfield.row(5));
// Get the resultQueryResultresult = response.getResult();
// Act on the resultif (result != null) {
List<Long> columns = result.getRow().getColumns();
System.out.println("Got columns: " + columns);
}
// You can batch queries to improve throughputresponse = client.query(
myindex.batchQuery(
myfield.row(5),
myfield.row(10)
)
);
for (Objectr : 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

About

Java client library for Pilosa

Topics

Resources

Contributing

Stars

19 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages