jDruid

Druid client for Java

License

License

Categories

Categories

Infer Application Testing & Monitoring Code Analysis druid Data Databases
GroupId

GroupId

com.inferlytics
ArtifactId

ArtifactId

jdruid
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

jDruid
Druid client for Java
Project URL

Project URL

https://github.com/InferlyticsOSS/jDruid
Source Code Management

Source Code Management

https://github.com/InferlyticsOSS/jDruid

Download jdruid

How to add to project

<!-- https://jarcasting.com/artifacts/com.inferlytics/jdruid/ -->
<dependency>
    <groupId>com.inferlytics</groupId>
    <artifactId>jdruid</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.inferlytics/jdruid/
implementation 'com.inferlytics:jdruid:0.1.1'
// https://jarcasting.com/artifacts/com.inferlytics/jdruid/
implementation ("com.inferlytics:jdruid:0.1.1")
'com.inferlytics:jdruid:jar:0.1.1'
<dependency org="com.inferlytics" name="jdruid" rev="0.1.1">
  <artifact name="jdruid" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.inferlytics', module='jdruid', version='0.1.1')
)
libraryDependencies += "com.inferlytics" % "jdruid" % "0.1.1"
[com.inferlytics/jdruid "0.1.1"]

Dependencies

compile (6)

Group / Artifact Type Version
io.druid : druid-processing jar 0.9.0
org.slf4j : slf4j-api jar 1.7.21
org.slf4j : slf4j-log4j12 jar 1.7.21
com.fasterxml.jackson.core : jackson-databind jar 2.7.3
com.squareup.retrofit2 : retrofit jar 2.0.1
com.squareup.retrofit2 : converter-jackson jar 2.0.1

test (2)

Group / Artifact Type Version
org.testng : testng jar 6.8.8
com.inferlytics : druidlet jar 0.1.1

Project Modules

There are no modules declared in this project.

jDruid

Simple Java Druid client

##Build Status

jDruid is configured on Travis CI. The current status of the master branch is given below:

##Setting it up

###From scratch

You can clone this repository and build the client by using

mvn clean package 

This will generate jdruid-0.1.0.jar in the target folder which can be used in your project.

###Maven

jDruid is available on Bintray and Maven Central:

<dependency>
    <groupId>com.inferlytics</groupId>
    <artifactId>jdruid</artifactId>
    <version>0.1.1</version>
</dependency>

##Usage

jDruid provides the following methods:

  1. topN
  2. groupBy
  3. timeseries
  4. query

The first three return results in Lists with native Druid types. The query is a generic "catch all" method, which can run any valid Query and returns a List of Map<String, Object>

It should be fairly simple to use:

Query query = Druids.newTimeseriesQueryBuilder().build();
DruidClient client = new DruidClient("http://localhost:8082/druid/v2");
List<Result> results = client.timeseries(query);

##Extending functionality

The query() method should be generic enough to support any valid Druid Query, which returns a List<Map<String, Object>>, which can be converted to your custom POJO using the either the Jackson ObjectMapper provided by Druid, which can be instantiated by calling new DefaultObjectMapper(), or use Gson or any other valid SerDe provider.

##Help

If you run into any issues while using jDruid, please feel free to drop an email to [email protected], or raise an issue.

com.inferlytics

InferlyticsOSS

Inferlytics Open Source Software

Versions

Version
0.1.1
0.1.0