@Override public void createTable(String table, TableOptions options, Map<String, ?> template, Audit audit) throws TableExistsException { // delegate to system data center _system.get().createTable(table, options, template, audit); }
@Override public void createTable(String table, TableOptions options, Map<String, ?> template, Audit audit) throws TableExistsException { // delegate to system data center _system.get().createTable(table, options, template, audit); }
@Override public void createTable(String table, TableOptions options, Map<String, ?> template, Audit audit) throws TableExistsException { executeIfAcceptingWrites(() -> _delegate.createTable(table, options, template, audit)); }
@Override public void createTable(String table, TableOptions options, Map<String, ?> template, Audit audit) throws TableExistsException { executeIfAcceptingWrites(() -> _delegate.createTable(table, options, template, audit)); }
@PUT @Path ("_table/{table}") @Consumes (MediaType.APPLICATION_JSON) @Timed (name = "bv.emodb.sor.DataStoreResource1.createTable", absolute = true) @ApiOperation (value = "Creates a table", notes = "Returns a SuccessResponse if table is created", response = SuccessResponse.class ) public SuccessResponse createTable(@PathParam ("table") String table, @QueryParam ("options") TableOptionsParam optionParams, Map<String, Object> template, @QueryParam ("audit") AuditParam auditParam, @Context UriInfo uriInfo, @Authenticated Subject subject) { TableOptions options = getRequired(optionParams, "options"); Audit audit = getRequired(auditParam, "audit"); // Check permission for creating this table CreateTableResource resource = new CreateTableResource(table, options.getPlacement(), template); if (!subject.hasPermission(Permissions.createSorTable(resource))) { throw new UnauthorizedException(); } _dataStore.createTable(table, options, template, audit); return SuccessResponse.instance(); }
@Override public String get() { // Lazily ensure the table exists on the first use. String tableName = tableNameSupplier.get(); if (!_dataStore.getTableExists(tableName)) { _dataStore.createTable(tableName, new TableOptionsBuilder().setPlacement(placement).build(), ImmutableMap.<String, String>of(), new AuditBuilder().setLocalHost().setComment("create table").build() ); } return tableName; } }
@Override public String get() { // Lazily ensure the table exists on the first use. String tableName = tableNameSupplier.get(); if (!_dataStore.getTableExists(tableName)) { _dataStore.createTable(tableName, new TableOptionsBuilder().setPlacement(placement).build(), ImmutableMap.<String, String>of(), new AuditBuilder().setLocalHost().setComment("create table").build() ); } return tableName; } }
_dataStore.get().createTable( settingsTable, new TableOptionsBuilder().setPlacement(_settingsTablePlacement).build(),
/** * Verifies that the given report table exists or, if not, creates it. */ @Override public void verifyOrCreateReport(String reportId) { checkNotNull(reportId, "reportId"); String tableName = getTableName(reportId); if (_dataStore.getTableExists(tableName)) { return; // Nothing to do. } try { // TODO: when run in the EU this should be routed to the US data center. _dataStore.createTable(tableName, new TableOptionsBuilder().setPlacement(_systemTablePlacement).build(), ImmutableMap.<String, String>of(), new AuditBuilder().setComment("create table").build() ); } catch (TableExistsException e) { // This is expected if we're continuing an existing report. } }
private void validateTable() { if (_tableValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_tableName)) { _dataStore.createTable( _tableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create permissions table").build()); } _tableValidated = true; } } }
private void validateTable() { if (_tableValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_tableName)) { _dataStore.createTable( _tableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create permissions table").build()); } _tableValidated = true; } } }
/** * Returns the migration status table name. On the first call it also verifies that the table exists, then skips this * check on future calls. */ private String getTable() { if (!_tableChecked) { if (!_dataStore.getTableExists(_tableName)) { _dataStore.createTable( _tableName, new TableOptionsBuilder().setPlacement(_tablePlacement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("Create migration status table").build()); _tableChecked = true; } } return _tableName; }
/** * Returns the scan request table name. On the first call it also verifies that the table exists, then skips this * check on future calls. */ private String getTable() { if (!_tableChecked) { if (!_dataStore.getTableExists(_tableName)) { _dataStore.createTable( _tableName, new TableOptionsBuilder().setPlacement(_tablePlacement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("Create scan request table").build()); } _tableChecked = true; } return _tableName; }
/** * Returns the scan status table name. On the first call it also verifies that the table exists, then skips this * check on future calls. */ private String getTable() { if (!_tableChecked) { if (!_dataStore.getTableExists(_tableName)) { _dataStore.createTable( _tableName, new TableOptionsBuilder().setPlacement(_tablePlacement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("Create scan status table").build()); _tableChecked = true; } } return _tableName; }
private void validateTables() { if (_tablesValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_identityTableName)) { _dataStore.createTable( _identityTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create identity table").build()); } if (!_dataStore.getTableExists(_idIndexTableName)) { _dataStore.createTable( _idIndexTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create ID table").build()); } _tablesValidated = true; } }
private void validateTables() { if (_tablesValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_identityTableName)) { _dataStore.createTable( _identityTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create identity table").build()); } if (!_dataStore.getTableExists(_idIndexTableName)) { _dataStore.createTable( _idIndexTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create ID table").build()); } _tablesValidated = true; } }
/** * Lazy initial verification to ensure the role and group tables exist. */ private void validateTables() { if (_tablesValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_roleTableName)) { _dataStore.createTable( _roleTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create role table").build()); } if (!_dataStore.getTableExists(_groupTableName)) { _dataStore.createTable( _groupTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create role group table").build()); } _tablesValidated = true; } } }
/** * Lazy initial verification to ensure the role and group tables exist. */ private void validateTables() { if (_tablesValidated) { return; } synchronized(this) { if (!_dataStore.getTableExists(_roleTableName)) { _dataStore.createTable( _roleTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create role table").build()); } if (!_dataStore.getTableExists(_groupTableName)) { _dataStore.createTable( _groupTableName, new TableOptionsBuilder().setPlacement(_placement).build(), ImmutableMap.<String, Object>of(), new AuditBuilder().setLocalHost().setComment("create role group table").build()); } _tablesValidated = true; } } }