@Override public boolean getTableExists(String table) { return _delegate.getTableExists(table); }
@Override public boolean getTableExists(String table) { return _delegate.getTableExists(table); }
@Override public boolean getTableExists(String table) { return _local.get().getTableExists(table); }
@Override public boolean getTableExists(String table) { return _local.get().getTableExists(table); }
/** * If a table exists but is empty then it will not be stashed. This method will surface this exception * only if the table exists. Otherwise it converts it to an UnknownTableException. */ private RuntimeException propagateTableNotStashed(TableNotStashedException e) throws TableNotStashedException, UnknownTableException { if (_dataStore.getTableExists(e.getTable())) { throw e; } throw new UnknownTableException(e.getTable()); } }
/** * If a table exists but is empty then it will not be stashed. This method will surface this exception * only if the table exists. Otherwise it converts it to an UnknownTableException. */ private RuntimeException propagateTableNotStashed(TableNotStashedException e) throws TableNotStashedException, UnknownTableException { if (_dataStore.getTableExists(e.getTable())) { throw e; } throw new UnknownTableException(e.getTable()); } }
@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; } }
if (!_dataStore.get().getTableExists(settingsTable)) { _dataStore.get().createTable( settingsTable,
/** * 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 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; }
/** * 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; }
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; } } }