Package org.eso.ias.sink.ltdb
Class CassandraLtdbFeeder
java.lang.Object
org.eso.ias.sink.ltdb.CassandraLtdbFeeder
The helper to interact with cassandra.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getErrors
(boolean reset) Return the number of errors recorded so farlong
getValuesStored
(boolean reset) Return the number of IASValues stored in the LTDBvoid
Connect to cassandra and allocate resourcesvoid
stop()
Close the connection with cassandravoid
Store the IASValue encoded by the passed JSON string by delegating tostore(IASValue)
void
store
(Collection<String> jsonStrings) Store the IASValues encoded by the passed JSON strings by delegating tostore(IASValue)
-
Field Details
-
closed
public volatile boolean closedSignal that the connection ha sbeen closed
-
-
Constructor Details
-
CassandraLtdbFeeder
public CassandraLtdbFeeder()
-
-
Method Details
-
start
Connect to cassandra and allocate resources- Parameters:
contactPoints
- Cassandra contact points (nor null neither empty)keyspace
- keyspace (nor null neither empty)ttl
- the time to leave in hours (if <=0, no TTL)
-
stop
public void stop()Close the connection with cassandra -
store
Store the IASValues encoded by the passed JSON strings by delegating tostore(IASValue)
- Parameters:
jsonStrings
- a collection of JSON strings encoding IASValues
-
store
Store the IASValue encoded by the passed JSON string by delegating tostore(IASValue)
- Parameters:
jsonString
- the JSON string encoding a IASValue
-
getErrors
public long getErrors(boolean reset) Return the number of errors recorded so far- Parameters:
reset
- if true reset the number of errors recorded so far- Returns:
- the number of errors
-
getValuesStored
public long getValuesStored(boolean reset) Return the number of IASValues stored in the LTDB- Parameters:
reset
- if true reset the number of IASValues stored in the LTDB so far- Returns:
- the number of IASValues stored in the LTDB
-