tables = s.getTables();
tables = s.getTables();
public Table getColumnFamily(String schemaName, String cfName) { Schema schema = getSchema(schemaName); if (schema != null) { if (schema.getTables() != null) { for (Table table : schema.getTables()) { if (table != null && table.getName() != null && table.getName().equalsIgnoreCase(cfName)) { return table; } } if (logger.isWarnEnabled()) { logger.warn("No column family schema found, returning null."); } } } return null; }
tables = s.getTables();
for (Table table : schema.getTables())
tables = s.getTables();
for (Table table : schema.getTables())
/** * @param tableInfo * @return CfDef object */ private CfDef getTableMetadata(TableInfo tableInfo) { CfDef cfDef = new CfDef(); cfDef.setKeyspace(databaseName); cfDef.setName(tableInfo.getTableName()); cfDef.setKey_validation_class(CassandraValidationClassMapper.getValidationClass(tableInfo.getTableIdType(), isCql3Enabled(tableInfo))); Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName); tables = schema != null ? schema.getTables() : null; Properties cFProperties = getColumnFamilyProperties(tableInfo); String defaultValidationClass = null; if (tableInfo.getType() != null && tableInfo.getType().equals(Type.SUPER_COLUMN_FAMILY.name())) { getSuperColumnFamilyMetadata(tableInfo, cfDef, defaultValidationClass); } else if (tableInfo.getType() != null) { getColumnFamilyMetadata(tableInfo, cfDef, cFProperties); } setColumnFamilyProperties(cfDef, cFProperties, null); return cfDef; }
public Table getColumnFamily(String schemaName, String cfName) { Schema schema = getSchema(schemaName); if (schema != null) { if (schema.getTables() != null) { for (Table table : schema.getTables()) { if (table != null && table.getName() != null && table.getName().equalsIgnoreCase(cfName)) { return table; } } if (logger.isWarnEnabled()) { logger.warn("No column family schema found, returning null."); } } } return null; }
/** * @param databaseName * @param tableName * @return */ public boolean isCappedCollection(String databaseName, String tableName) { List<Schema> schemas = getDataStore() != null ? getDataStore().getSchemas() : null; if (schemas != null) { for (Schema schema : schemas) { if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName)) { for (Table table : schema.getTables()) { if (table.getProperties() != null && tableName.equals(table.getName())) { return Boolean.parseBoolean(table.getProperties().getProperty(MongoDBConstants.CAPPED)); } } } } } return false; }
Assert.assertEquals(2, store.getSchemas().size()); Assert.assertEquals("KunderaHbaseXmlTest", store.getSchemas().get(0).getName()); Assert.assertNotNull(store.getSchemas().get(0).getTables()); Assert.assertEquals(1, store.getSchemas().get(0).getTables().size()); Assert.assertEquals("HBASEUSERXYZ", store.getSchemas().get(0).getTables().get(0).getName()); Assert.assertNotNull(store.getSchemas().get(0).getTables().get(0).getProperties()); Assert.assertEquals(5, store.getSchemas().get(0).getTables().get(0).getProperties().size()); Assert.assertEquals(3, store.getSchemas().size()); Assert.assertEquals("KunderaCassandraXmlTest", store.getSchemas().get(0).getName()); Assert.assertNotNull(store.getSchemas().get(0).getTables()); Assert.assertEquals(2, store.getSchemas().get(0).getTables().size()); Assert.assertEquals("CASSANDRAUSERXYZ", store.getSchemas().get(0).getTables().get(0).getName()); Assert.assertNotNull(store.getSchemas().get(0).getTables().get(0).getProperties()); Assert.assertEquals(7, store.getSchemas().get(0).getTables().get(0).getProperties().size()); Assert.assertNotNull(store.getSchemas().get(0).getDataCenters()); Assert.assertEquals(2, store.getSchemas().get(0).getDataCenters().size());
for (Table table : schema.getTables())
for (Table table : schema.getTables())
/** * @param tableInfo * @return CfDef object */ private CfDef getTableMetadata(TableInfo tableInfo) { CfDef cfDef = new CfDef(); cfDef.setKeyspace(databaseName); cfDef.setName(tableInfo.getTableName()); cfDef.setKey_validation_class(CassandraValidationClassMapper.getValidationClass(tableInfo.getTableIdType(), isCql3Enabled(tableInfo))); Schema schema = CassandraPropertyReader.csmd.getSchema(databaseName); tables = schema != null ? schema.getTables() : null; Properties cfProperties = getColumnFamilyProperties(tableInfo); String defaultValidationClass = null; if (tableInfo.getType() != null && tableInfo.getType().equals(Type.SUPER_COLUMN_FAMILY.name())) { getSuperColumnFamilyMetadata(tableInfo, cfDef, defaultValidationClass); } else if (tableInfo.getType() != null) { getColumnFamilyMetadata(tableInfo, cfDef, cfProperties); } setColumnFamilyProperties(cfDef, cfProperties, null); return cfDef; }
/** * @param databaseName * @param tableName * @return */ public boolean isCappedCollection(String databaseName, String tableName) { List<Schema> schemas = getDataStore() != null ? getDataStore().getSchemas() : null; if (schemas != null) { for (Schema schema : schemas) { if (schema != null && schema.getName() != null && schema.getName().equalsIgnoreCase(databaseName)) { for (Table table : schema.getTables()) { if (table.getProperties() != null && tableName.equals(table.getName())) { return Boolean.parseBoolean(table.getProperties().getProperty(MongoDBConstants.CAPPED)); } } } } } return false; }
/** * Read external properties. */ private void readExternalProperties() { schemas = HBasePropertyReader.hsmd.getDataStore() != null ? HBasePropertyReader.hsmd.getDataStore() .getSchemas() : null; List<Table> tables = null; if (schemas != null && !schemas.isEmpty()) { for (Schema s : schemas) { if (s.getName() != null && s.getName().equalsIgnoreCase(databaseName)) { tables = s.getTables(); } } } if (tables != null && !tables.isEmpty()) { for (Table table : tables) { externalProperties.put(HBaseUtils.getHTableName(databaseName, table.getName()), table.getProperties()); } } }