tableToStorageMap.put(tableEnt.getName(), storage);
// List<String> primaryKeys = entity.getPrimaryKey();
}
if (entity instanceof PaasTimeseriesEntity) {
// first create/check if schema db exists
PaasTimeseriesEntity tableEnt = (PaasTimeseriesEntity) entity;
try {
String schemaName = tableEnt.getSchemaName();
session.execute(String.format(
PaasUtils.CREATE_KEYSPACE_SIMPLE_FORMAT, schemaName, 1));
} catch (AlreadyExistsException e) {
// It's ok, ignore
}
// if schema/db already exists now create the table
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String query = BuildQuery(tableEnt);
Print(query);
session.execute(query);
List<String> tables = dbToTimeseriesMap.get(tableEnt.getSchemaName());
if (tables==null) tables = new ArrayList<String>();
tables.add(tableEnt.getName().substring(tableEnt.getName().indexOf(".")+1));
// List<String> primaryKeys = entity.getPrimaryKey();
}
JsonObject obj = new JsonObject("{\"status\":\"ok\"}");
return obj.toString();
}