if (discoveryType==null || discoveryType.equals("")) discoveryType = configuration.getString(String.format(DISCOVERY_TYPE_FORMAT, "configuration"));
Preconditions.checkNotNull(clusterName, "Missing cluster name for schema " + schemaName + " " + String.format(CLUSTER_NAME_FORMAT,schemaName));
Preconditions.checkNotNull(keyspaceName, "Missing cluster name for schema " + schemaName + " " + String.format(KEYSPACE_NAME__FORMAT,schemaName));
Preconditions.checkNotNull(discoveryType, "Missing cluster name for schema " + schemaName + " " + String.format(DISCOVERY_TYPE_FORMAT,schemaName));
HostSupplierProvider hostSupplierProvider = hostSupplierProviders.get(discoveryType);
Preconditions.checkNotNull(hostSupplierProvider,
String.format("Unknown host supplier provider '%s' for schema '%s'", discoveryType, schemaName));
AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
.forCluster(clusterName)
.forKeyspace(keyspaceName)
.withAstyanaxConfiguration(configurationProvider.get(schemaName))
.withConnectionPoolConfiguration(cpProvider.get(schemaName))
.withConnectionPoolMonitor(monitorProvider.get(schemaName))
.withHostSupplier(hostSupplierProvider.getSupplier(clusterName))
.buildKeyspace(ThriftFamilyFactory.getInstance());
context.start();
try {
context.getClient().createKeyspace(defaultKsOptions);
} catch (ConnectionException e) {