Hector is a high-level client API for Apache Cassandra. Named after Hector, a warrior of Troy in Greek mythology, it is a substitute for the Cassandra Java Client, or Thrift, that is encapsulated by Hector. It also has Maven repository access.
As Cassandra is shipped with the low-level Thrift protocol, there was a potential to develop a better protocol for application developers. Hector was developed by Ran Tavory as a high-level interface that overlays the shortcomings of Thrift. It is licensed with the MIT License that allows to use, modify, split and change the design.
The high-level features of Hector are
Hector exposes availability counters and statistics through JMX.
Hector follows two load balancing policies with the <code>LoadBalancingPolicy</code> interface. The default is called <code>RoundRobinBalancingPolicy</code> and is a simple round-robin distribution algorithm. The <code>LeastActiveBalancingPolicy</code> routes requests to the pools having the lowest number of active connections, ensuring a good spread of utilisation across the cluster. .
The <code>ExhaustedPolicy</code> determines how the underlying client connection pools are controlled. Currently, three options are available:
As an example, an implementation of a simple distributed hashtable over Cassandra is listed.