List<Server> servers = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getServers() : null; if (servers != null && !servers.isEmpty()) propsFromCp = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getProperties() : null;
Assert.assertNotNull(store.getName()); if (store.getName().trim().equalsIgnoreCase("HBase")) Assert.assertNotNull(store.getSchemas()); 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.assertNull(store.getSchemas().get(0).getDataCenters()); Assert.assertNull(store.getSchemas().get(0).getSchemaProperties()); Assert.assertNotNull(store.getConnection()); Assert.assertNotNull(store.getConnection().getProperties()); Assert.assertNull(store.getConnection().getServers()); Assert.assertEquals(2, store.getConnection().getProperties().size()); else if (store.getName().trim().equalsIgnoreCase("Mongo")) Assert.assertNull(store.getSchemas()); Assert.assertNotNull(store.getConnection()); Assert.assertNotNull(store.getConnection().getProperties()); Assert.assertEquals(2, store.getConnection().getProperties().size()); Assert.assertNotNull(store.getConnection().getServers());
public Properties getDatastoreProperties() { DataStore ds = getDataStore(dataStoreName); Properties properties = new Properties(); if (ds != null && ds.getProperties() != null) { properties.putAll(ds.getProperties()); } return properties; } }
List<Server> servers = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getServers() : null; if (servers != null && !servers.isEmpty()) propsFromCp = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getProperties() : null;
hadoopConf.set("hbase.master", host + ":" + port); conn = HBasePropertyReader.hsmd.getDataStore() != null ? HBasePropertyReader.hsmd.getDataStore() .getConnection() : null; if (conn != null && conn.getProperties() != null)
.getConnection() : null; if (conn != null && conn.getProperties() != null)
.getConnection() : null; if (conn != null && conn.getProperties() != null)
hadoopConf.set("hbase.master", host + ":" + port); conn = HBasePropertyReader.hsmd.getDataStore() != null ? HBasePropertyReader.hsmd.getDataStore() .getConnection() : null; if (conn != null && conn.getProperties() != null)
Properties properties = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getProperties() : null;
Properties properties = dataStore != null && dataStore.getConnection() != null ? dataStore.getConnection() .getProperties() : null;
Properties tableProperties = null; schemas = HBasePropertyReader.hsmd.getDataStore() != null ? HBasePropertyReader.hsmd.getDataStore() .getSchemas() : null; if (schemas != null && !schemas.isEmpty())
Properties tableProperties = null; schemas = HBasePropertyReader.hsmd.getDataStore() != null ? HBasePropertyReader.hsmd.getDataStore() .getSchemas() : null; if (schemas != null && !schemas.isEmpty())
List<Schema> schemas = getDataStore() != null ? getDataStore().getSchemas() : null; if (schemas != null)
List<Schema> schemas = getDataStore() != null ? getDataStore().getSchemas() : null; if (schemas != null)
private void setColumnFamilyProperties(HColumnDescriptor columnDescriptor, String columnName) .getSchemas() : null; if (schemas != null && !schemas.isEmpty())
private void setColumnFamilyProperties(HColumnDescriptor columnDescriptor, String columnName) .getSchemas() : null; if (schemas != null && !schemas.isEmpty())
public String getCqlVersion() { DataStore dataStore = getDataStore(dataStoreName); if (dataStore != null) { Properties properties = dataStore.getConnection() != null ? dataStore.getConnection().getProperties() : null; if (properties != null) { String cqlVersion = properties.getProperty(CassandraConstants.CQL_VERSION); if (cqlVersion != null) { if (cqlVersion.equalsIgnoreCase(CassandraConstants.CQL_VERSION_3_0) || cqlVersion.equalsIgnoreCase(CassandraConstants.CQL_VERSION_2_0)) { return cqlVersion; } else { logger.warn("Invalid {} cql version provided, valid are {},{}.", cqlVersion, CassandraConstants.CQL_VERSION_2_0, CassandraConstants.CQL_VERSION_3_0); } } } } return CassandraConstants.CQL_VERSION_2_0; }
/** * @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; }
/** * Returns datastore instance for given {@link ClientProperties} for * Neo4j * * @return */ public DataStore getDataStore() { if (getClientProperties() != null && getClientProperties().getDatastores() != null) { for (DataStore dataStore : getClientProperties().getDatastores()) { if (dataStore.getName() != null && dataStore.getName().trim().equalsIgnoreCase(NEO4J_DATASTORE)) { return dataStore; } } } return null; } }
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; }