public void buildCluster ( String secured ) { if ( secured == null ) { this . cluster = Cluster . builder ( ) . addContactPoint ( this . host ) . build ( ) ; this . cluster . getConfiguration ( ) . getQueryOptions ( ) . setConsistencyLevel ( ConsistencyLevel . ONE ) ; } else { try { this . cluster = Cluster . builder ( ) . addContactPoint ( this . host ) . withCredentials ( "user" , "pass" ) . withSSL ( ) . build ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }
Build a Cassandra cluster .