@Test public void detachNonExistingDb() throws Exception { mException.expect(IOException.class); mCatalog.detachDatabase(NoopJournalContext.INSTANCE, "testDb"); }
public boolean detachDatabase(JournalContext journalContext, String dbName) throws IOException { try (LockResource l = getDbLock(dbName)) { if (!mDBs.containsKey(dbName)) { throw new IOException(String .format("Unable to detach database. Database name %s does not exist", dbName)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder() .setDbName(dbName).build()).build()); return true; } }
AlluxioCatalog implements Journaled { public boolean detachDatabase(JournalContext journalContext, String dbName) throws IOException { try (LockResource l = getDbLock(dbName)) { if (!mDBs.containsKey(dbName)) { throw new IOException(String .format("Unable to detach database. Database name %s does not exist", dbName)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder() .setDbName(dbName).build()).build()); return true; } } }
AlluxioCatalog implements Journaled { public boolean detachDatabase(JournalContext journalContext, String dbName) throws IOException { try (LockResource l = getDbLock(dbName)) { if (!mDBs.containsKey(dbName)) { throw new IOException(String .format("Unable to detach database. Database name %s does not exist", dbName)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder() .setDbName(dbName).build()).build()); return true; } } AlluxioCatalog(); }
AlluxioCatalog implements Journaled { public boolean detachDatabase(JournalContext journalContext, String dbName) throws IOException { try (LockResource l = getDbLock(dbName)) { if (!mDBs.containsKey(dbName)) { throw new IOException(String .format("Unable to detach database. Database name %s does not exist", dbName)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder() .setDbName(dbName).build()).build()); return true; } } AlluxioCatalog(); LayoutRegistry getLayoutRegistry(); SyncStatus attachDatabase(JournalContext journalContext, String udbType,
      String udbConnectionUri, String udbDbName, String dbName, Map<String, String> map,
      boolean ignoreSyncErrors); SyncStatus syncDatabase(JournalContext journalContext, String dbName); boolean detachDatabase(JournalContext journalContext, String dbName); Table getTable(String dbName, String tableName); List<String> getAllDatabases(); alluxio.grpc.table.Database getDatabase(String dbName); List<String> getAllTables(String dbName); List<ColumnStatisticsInfo> getTableColumnStatistics(String dbName, String tableName,
      List<String> colNames); Map<String, ColumnStatisticsList> getPartitionColumnStatistics(String dbName,
      String tableName, List<String> partNames, List<String> colNames); List<alluxio.grpc.table.Partition> readTable(String dbName, String tableName,
      Constraint constraint); void completeTransformTable(JournalContext journalContext, String dbName, String tableName,
      String definition, Map<String, Layout> transformedLayouts); List<TransformPlan> getTransformPlan(String dbName, String tableName,
      TransformDefinition definition); @Override boolean processJournalEntry(Journal.JournalEntry entry); @Override void resetState(); @Override Iterator<Journal.JournalEntry> getJournalEntryIterator(); @Override CheckpointName getCheckpointName(); }
AlluxioCatalog implements Journaled { public boolean detachDatabase(JournalContext journalContext, String dbName) throws IOException { try (LockResource l = getDbLock(dbName)) { if (!mDBs.containsKey(dbName)) { throw new IOException(String .format("Unable to detach database. Database name %s does not exist", dbName)); } applyAndJournal(journalContext, Journal.JournalEntry.newBuilder().setDetachDb( alluxio.proto.journal.Table.DetachDbEntry.newBuilder() .setDbName(dbName).build()).build()); return true; } } AlluxioCatalog(); LayoutRegistry getLayoutRegistry(); SyncStatus attachDatabase(JournalContext journalContext, String udbType,
      String udbConnectionUri, String udbDbName, String dbName, Map<String, String> map,
      boolean ignoreSyncErrors); SyncStatus syncDatabase(JournalContext journalContext, String dbName); boolean detachDatabase(JournalContext journalContext, String dbName); Table getTable(String dbName, String tableName); List<String> getAllDatabases(); alluxio.grpc.table.Database getDatabase(String dbName); List<String> getAllTables(String dbName); List<ColumnStatisticsInfo> getTableColumnStatistics(String dbName, String tableName,
      List<String> colNames); Map<String, ColumnStatisticsList> getPartitionColumnStatistics(String dbName,
      String tableName, List<String> partNames, List<String> colNames); List<alluxio.grpc.table.Partition> readTable(String dbName, String tableName,
      Constraint constraint); void completeTransformTable(JournalContext journalContext, String dbName, String tableName,
      String definition, Map<String, Layout> transformedLayouts); List<TransformPlan> getTransformPlan(String dbName, String tableName,
      TransformDefinition definition); @Override boolean processJournalEntry(Journal.JournalEntry entry); @Override void resetState(); @Override Iterator<Journal.JournalEntry> getJournalEntryIterator(); @Override CheckpointName getCheckpointName();  }