public void loadTestData(String keyspace, String path) {
        KeyspaceMetadata md = session.getCluster().getMetadata().getKeyspace(keyspace);
        if (md == null) {
            LOGGER.info("Creating keyspace {} using {}", keyspace, path);
            createKeyspace(keyspace);
        }
        List<String> scriptLines = loadScript(path);
        LOGGER.info("Executing {} lines ", scriptLines.size());
        for (String cql : scriptLines) {
            ResultSet result = session.execute(cql);
            LOGGER.debug("Executing: {}", cql);
        }
        LOGGER.info("Using existing keyspace {}", keyspace);
    }
public void loadTestData ( String keyspace , String path ) { KeyspaceMetadata md = session . getCluster ( ) . getMetadata ( ) . getKeyspace ( keyspace ) ; if ( md == null ) { LOGGER . info ( "Creating keyspace {} using {}" , keyspace , path ) ; createKeyspace ( keyspace ) ; } List < String > scriptLines = loadScript ( path ) ; LOGGER . info ( "Executing {} lines " , scriptLines . size ( ) ) ; for ( String cql : scriptLines ) { ResultSet result = session . execute ( cql ) ; LOGGER . debug ( "Executing: {}" , cql ) ; } LOGGER . info ( "Using existing keyspace {}" , keyspace ) ; }
Load a {@code keyspace} in Cassandra using the CQL sentences in the
script path. The script is executed if the keyspace does not exists in
Cassandra.

@param keyspace The name of the keyspace.
@param path     The path of the CQL script.