DruidConfig
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:
require 'druid_config'
Initialization
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, )
Available options:
- discovery_path: string with the discovery path of druid inside Zookeeper directory structure.
Usage
Call methods defined in DruidConfig::Cluster to access to the data. To get more information about data returned in methods, check Druid documentation.
leader: leaderload_status: load statusload_status: load queuemetadata_datasources: Hash with metadata of datasourcesmetadata_datasources_segments: Hash with metadata of segmentsdatasources: all data sourcesdatasource: a concrete data sourcerules: all rules defined in the clustertiers: tiersserversornodes: all nodes of the clusterphysical_serversorphysical_nodes: array of URIs of nodeshistoricals: historical nodesrealtimes: realtime nodesworkers: worker nodesphysical_workers: array of URIs of worker nodesservices: Hash with physical nodes and the services they are running
Entities
Some methods return an instance of an Entity class. These entities provide multiple methods to access data. Defined entities are inside druid_config/entities folder.
Exceptions
Sometimes the Gem 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 DruidApiError exception will be raised.
Collaborate
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
License
DruidConfig gem is released under the Affero GPL license. Copyright redBorder