DruidConfig is a gem to access the information about Druid cluster status. You can check a node capacity, number of segments, tiers... It uses zookeeper to get coordinator and overlord URIs.
To use in your application, add this line to your Gemfile:
Query Druid data
The purpose of this gem is to query Druid cluster status. If you want to query Druid data, I recommend you to use ruby-druid gem.
Cluster is the base class to perform queries. To initialize it send the Zookeeper URI and options as arguments:
cluster = DruidConfig::Cluster.new(zookeeper_uri, options)
- discovery_path: string with the discovery path of druid inside Zookeeper directory structure.
Call methods defined in
DruidConfig::Cluster to access to the data. To get more information about data returned in methods, check Druid documentation.
load_status: load status
load_status: load queue
metadata_datasources: Hash with metadata of datasources
metadata_datasources_segments: Hash with metadata of segments
datasources: all data sources
datasource: a concrete data source
rules: all rules defined in the cluster
nodes: all nodes of the cluster
physical_nodes: array of URIs of nodes
historicals: historical nodes
realtimes: realtime nodes
workers: worker nodes
physical_workers: array of URIs of worker nodes
complete_tasks: tasks in the cluster based in their status
task: load a task based on an identifier
services: Hash with physical nodes and the services they are running
Some methods return an instance of an
Entity class. These entities provide multiple methods to access data. Defined entities are inside
This exception will be raised when you try to perform a query to a Druid Coordinator or Overlord but there aren't any node of that type available.
Sometimes the Gem have available nodes, but it can't access to Druid API. In this case, the gem automatically will reset the Zookeeper connection and retry the query. If second query fails too, a
DruidConfig::Exceptions::DruidApiError exception will be raised.
To contribute DruidConfig:
- Create an issue with the contribution: bug, enhancement or feature
- Fork the repository and make all changes you need
- Write test on new changes
- Create a pull request when you finish
DruidConfig gem is released under the Affero GPL license. Copyright redBorder