private void setKeyspaceProperties ( KsDef ksDef , Properties schemaProperties , Map < String , String > strategyOptions , List < DataCenter > dcs ) { String placementStrategy = schemaProperties . getProperty ( CassandraConstants . PLACEMENT_STRATEGY , SimpleStrategy . class . getSimpleName ( ) ) ; if ( placementStrategy . equalsIgnoreCase ( SimpleStrategy . class . getSimpleName ( ) ) || placementStrategy . equalsIgnoreCase ( SimpleStrategy . class . getName ( ) ) ) { String replicationFactor = schemaProperties . getProperty ( CassandraConstants . REPLICATION_FACTOR , CassandraConstants . DEFAULT_REPLICATION_FACTOR ) ; strategyOptions . put ( "replication_factor" , replicationFactor ) ; } else if ( placementStrategy . equalsIgnoreCase ( NetworkTopologyStrategy . class . getSimpleName ( ) ) || placementStrategy . equalsIgnoreCase ( NetworkTopologyStrategy . class . getName ( ) ) ) { if ( dcs != null && ! dcs . isEmpty ( ) ) { for ( DataCenter dc : dcs ) { strategyOptions . put ( dc . getName ( ) , dc . getValue ( ) ) ; } } } else { strategyOptions . put ( "replication_factor" , CassandraConstants . DEFAULT_REPLICATION_FACTOR ) ; } ksDef . setStrategy_class ( placementStrategy ) ; ksDef . setDurable_writes ( Boolean . parseBoolean ( schemaProperties . getProperty ( CassandraConstants . DURABLE_WRITES ) ) ) ; }
Sets the keyspace properties .