/** * @return the placement_strategy */ public String getPlacement_strategy(String schemaName) { Schema schema = getSchema(schemaName); String placementStrategy = SimpleStrategy.class.getName(); if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty()) { placementStrategy = schema.getSchemaProperties().getProperty(CassandraConstants.PLACEMENT_STRATEGY); } if (logger.isInfoEnabled()) { logger.info("Returning placement strategy value {}", placementStrategy); } return placementStrategy; }
/** * @return the replication_factor */ public String getReplication_factor(String schemaName) { Schema schema = getSchema(schemaName); String replication = "1"; if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty()) { replication = schema.getSchemaProperties().getProperty(CassandraConstants.REPLICATION_FACTOR); } if (logger.isInfoEnabled()) { logger.info("Returning replication factor value {}", replication); } return replication; }
/** * Gets the bucket property. * * @param property * the property * @return the bucket property */ public String getBucketProperty(String property) { List<Schema> list = csmd.getDataStore(CouchbaseConstants.COUCHBASE).getSchemas(); if (!list.isEmpty()) { Schema schema = list.get(0); Properties prop = schema.getSchemaProperties(); return (String) prop.get(property); } return null; }
tableProperties = s.getSchemaProperties(); tables = s.getTables();
tableProperties = s.getSchemaProperties(); tables = s.getTables();
public boolean isInvertedIndexingEnabled(String schemaName) { DataStore dataStore = getDataStore(dataStoreName); boolean result = false; if (schemaName != null && dataStore != null && dataStore.getSchemas() != null) { for (Schema schema : dataStore.getSchemas()) { if (schema != null && schemaName.equals(schema.getName()) && schema.getSchemaProperties() != null && schema.getSchemaProperties() != null) { result = Boolean.parseBoolean((String) schema.getSchemaProperties().get( CassandraConstants.INVERTED_INDEXING_ENABLED)); break; } } } return result; }
/** * @return the placement_strategy */ public String getPlacement_strategy(String schemaName) { Schema schema = getSchema(schemaName); String placementStrategy = SimpleStrategy.class.getName(); if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty()) { placementStrategy = schema.getSchemaProperties().getProperty(CassandraConstants.PLACEMENT_STRATEGY) ; } if (logger.isInfoEnabled()) { logger.info("Returning placement strategy value {}", placementStrategy); } return placementStrategy; }
/** * @return the replication_factor */ public String getReplication_factor(String schemaName) { Schema schema = getSchema(schemaName); String replication = "1"; if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty()) { replication = schema.getSchemaProperties().getProperty(CassandraConstants.REPLICATION_FACTOR); } if (logger.isInfoEnabled()) { logger.info("Returning replication factor value {}", replication); } return replication; }
/** * Sets the properties. * * @param ksDef * the ks def * @param strategy_options * the strategy_options */ private void setProperties(KsDef ksDef, Map<String, String> strategy_options) { Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName); if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName) && schema.getSchemaProperties() != null) { setKeyspaceProperties(ksDef, schema.getSchemaProperties(), strategy_options, schema.getDataCenters()); } else { setDefaultReplicationFactor(strategy_options); } }
&& schema.getSchemaProperties() != null) Properties schemaProperties = schema.getSchemaProperties(); if (placement_strategy.equalsIgnoreCase(SimpleStrategy.class.getSimpleName()) || placement_strategy.equalsIgnoreCase(SimpleStrategy.class.getName()))
Assert.assertNull(store.getSchemas().get(0).getSchemaProperties()); Assert.assertNotNull(store.getConnection()); Assert.assertNotNull(store.getConnection().getProperties()); Assert.assertNotNull(store.getSchemas().get(0).getDataCenters()); Assert.assertEquals(2, store.getSchemas().get(0).getDataCenters().size()); Assert.assertNotNull(store.getSchemas().get(0).getSchemaProperties()); Assert.assertEquals(3, store.getSchemas().get(0).getSchemaProperties().size());
tableProperties = s.getSchemaProperties(); tables = s.getTables();
/** * Sets the properties. * * @param ksDef * the ks def * @param strategy_options * the strategy_options */ private void setProperties(KsDef ksDef, Map<String, String> strategy_options) { Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName); if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName) && schema.getSchemaProperties() != null) { setKeyspaceProperties(ksDef, schema.getSchemaProperties(), strategy_options, schema.getDataCenters()); } else { setDefaultReplicationFactor(strategy_options); } }
public boolean isInvertedIndexingEnabled(String schemaName) { DataStore dataStore = getDataStore(dataStoreName); boolean result = false; if (schemaName != null && dataStore != null && dataStore.getSchemas() != null) { for (Schema schema : dataStore.getSchemas()) { if (schema != null && schemaName.equals(schema.getName()) && schema.getSchemaProperties() != null && schema.getSchemaProperties() != null) { result = Boolean.parseBoolean((String) schema.getSchemaProperties().get( CassandraConstants.INVERTED_INDEXING_ENABLED)); break; } } } return result; }