GigaSpaces XAP 9.7.2 API

org.openspaces.persistency.cassandra
Class HectorCassandraClientConfigurer

java.lang.Object
  extended by org.openspaces.persistency.cassandra.HectorCassandraClientConfigurer

public class HectorCassandraClientConfigurer
extends Object

A configurer for creating HectorCassandraClient instances.

Since:
9.1.1
Author:
Dan Kilman

Field Summary
protected  String clusterName
           
protected  Integer columnFamilyGcGraceSeconds
           
protected  String hosts
           
protected  String keyspaceName
           
protected  Integer port
           
protected  CassandraConsistencyLevel readConsistencyLevel
           
protected  CassandraConsistencyLevel writeConsistencyLevel
           
 
Constructor Summary
HectorCassandraClientConfigurer()
           
 
Method Summary
 HectorCassandraClientConfigurer clusterName(String clusterName)
          (Optional) Sets the cluster name used internally by the hector library.
 HectorCassandraClientConfigurer columnFamilyGcGraceSeconds(Integer columnFamilyGcGraceSeconds)
          (Optional) Sets the gcGraceSeconds that will be used when creating column families for types.
 HectorCassandraClient create()
           
 HectorCassandraClientConfigurer hosts(String hosts)
          Cassandra hosts
 HectorCassandraClientConfigurer keyspaceName(String keyspaceName)
          Sets the keyspaceName of the keyspace to connect to.
 HectorCassandraClientConfigurer port(Integer port)
          Sets the port matching the host name of the Cassandra cluster to connect to.
 HectorCassandraClientConfigurer readConsistencyLevel(CassandraConsistencyLevel readConsistencyLevel)
          (Optional)
 HectorCassandraClientConfigurer writeConsistencyLevel(CassandraConsistencyLevel writeConsistencyLevel)
          (Optional)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hosts

protected String hosts

port

protected Integer port

clusterName

protected String clusterName

keyspaceName

protected String keyspaceName

columnFamilyGcGraceSeconds

protected Integer columnFamilyGcGraceSeconds

readConsistencyLevel

protected CassandraConsistencyLevel readConsistencyLevel

writeConsistencyLevel

protected CassandraConsistencyLevel writeConsistencyLevel
Constructor Detail

HectorCassandraClientConfigurer

public HectorCassandraClientConfigurer()
Method Detail

hosts

public HectorCassandraClientConfigurer hosts(String hosts)
Cassandra hosts

Parameters:
hosts - Command delimited list of Cassandra hosts (hostnames or ipaddresses)
Returns:
this instance.

port

public HectorCassandraClientConfigurer port(Integer port)
Sets the port matching the host name of the Cassandra cluster to connect to.

Parameters:
port - The cassandra port. Set null to use the default port number CassandraHost#DEFAULT_PORT
Returns:
this instance.

keyspaceName

public HectorCassandraClientConfigurer keyspaceName(String keyspaceName)
Sets the keyspaceName of the keyspace to connect to.

Parameters:
keyspaceName - The keyspace name.
Returns:
this instance.

clusterName

public HectorCassandraClientConfigurer clusterName(String clusterName)
(Optional) Sets the cluster name used internally by the hector library. Use this if you plan to connect to more than one cassandra cluster in the same JVM.

Parameters:
clusterName - The cluster 'tag' name.
Returns:
this instance.

columnFamilyGcGraceSeconds

public HectorCassandraClientConfigurer columnFamilyGcGraceSeconds(Integer columnFamilyGcGraceSeconds)
(Optional) Sets the gcGraceSeconds that will be used when creating column families for types. If null will use default value

Parameters:
columnFamilyGcGraceSeconds -
Returns:
this instance.

readConsistencyLevel

public HectorCassandraClientConfigurer readConsistencyLevel(CassandraConsistencyLevel readConsistencyLevel)
(Optional)

Parameters:
readConsistencyLevel - The consistencly level used for read by id operations. (default: CassandraConsistencyLevel.QUORUM)
Returns:
this instance.

writeConsistencyLevel

public HectorCassandraClientConfigurer writeConsistencyLevel(CassandraConsistencyLevel writeConsistencyLevel)
(Optional)

Parameters:
writeConsistencyLevel - The consistencly level used for write/update/remove operations. (default: CassandraConsistencyLevel.QUORUM)
Returns:

create

public HectorCassandraClient create()
Returns:
An instance of HectorCassandraClient matching this configurer configuration.

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.