private void createPreparedStatements ( ) { // create a generic select statement for retrieving from metrics_locator Select . Where select = QueryBuilder . select ( ) . all ( ) . from ( CassandraModel . CF_METRICS_LOCATOR_NAME ) . where ( eq ( KEY , bindMarker ( ) ) ) ; getValue = DatastaxIO . getSession ( ) . prepare ( select ) ; // create a generic insert statement for inserting into metrics_locator Insert insert = QueryBuilder . insertInto ( CassandraModel . CF_METRICS_LOCATOR_NAME ) . using ( ttl ( TenantTtlProvider . LOCATOR_TTL ) ) . value ( KEY , bindMarker ( ) ) . value ( COLUMN1 , bindMarker ( ) ) . value ( VALUE , bindMarker ( ) ) ; putValue = DatastaxIO . getSession ( ) . prepare ( insert ) . setConsistencyLevel ( ConsistencyLevel . LOCAL_ONE ) ; }
Create all prepared statements use in this class for metrics_locator