@Test public void completeTransformTable() throws IOException { String dbName = "testdb"; TestDatabase.genTable(1, 10, false); mCatalog.attachDatabase(NoopJournalContext.INSTANCE, TestUdbFactory.TYPE, "connect_URI", TestDatabase.TEST_UDB_NAME, dbName, Collections.emptyMap(), false); String tableName = TestDatabase.getTableName(0); Table table = mCatalog.getTable(dbName, tableName); table.getPartitions().forEach(partition -> assertFalse(partition.isTransformed(TRANSFORM_DEFINITION.getDefinition()))); ServerConfiguration.set(PropertyKey.MASTER_HOSTNAME, "localhost"); List<TransformPlan> plans = mCatalog.getTransformPlan(dbName, tableName, TRANSFORM_DEFINITION); Map<String, Layout> transformedLayouts = Maps.newHashMapWithExpectedSize(plans.size()); plans.forEach(plan -> transformedLayouts.put(plan.getBaseLayout().getSpec(), plan.getTransformedLayout())); mCatalog.completeTransformTable(NoopJournalContext.INSTANCE, dbName, tableName, TRANSFORM_DEFINITION.getDefinition(), transformedLayouts); table.getPartitions().forEach(partition -> { assertTrue(partition.isTransformed(TRANSFORM_DEFINITION.getDefinition())); assertEquals(transformedLayouts.get(partition.getSpec()), partition.getLayout()); }); }
public void completeTransformTable(JournalContext journalContext, String dbName, String tableName, String definition, Map<String, Layout> transformedLayouts) throws IOException { try (LockResource l = getDbLock(dbName)) { getTableInternal(dbName, tableName); alluxio.proto.journal.Table.CompleteTransformTableEntry entry = alluxio.proto.journal.Table.CompleteTransformTableEntry.newBuilder() .setDbName(dbName) .setTableName(tableName) .setDefinition(definition) .putAllTransformedLayouts(Maps.transformValues(transformedLayouts, Layout::toProto)) .build(); applyAndJournal(journalContext, Journal.JournalEntry.newBuilder() .setCompleteTransformTable(entry).build()); } }
AlluxioCatalog implements Journaled { public void completeTransformTable(JournalContext journalContext, String dbName, String tableName, String definition, Map<String, Layout> transformedLayouts) throws IOException { try (LockResource l = getDbLock(dbName)) { getTableInternal(dbName, tableName); alluxio.proto.journal.Table.CompleteTransformTableEntry entry = alluxio.proto.journal.Table.CompleteTransformTableEntry.newBuilder() .setDbName(dbName) .setTableName(tableName) .setDefinition(definition) .putAllTransformedLayouts(Maps.transformValues(transformedLayouts, Layout::toProto)) .build(); applyAndJournal(journalContext, Journal.JournalEntry.newBuilder() .setCompleteTransformTable(entry).build()); } } }
AlluxioCatalog implements Journaled { public void completeTransformTable(JournalContext journalContext, String dbName, String tableName, String definition, Map<String, Layout> transformedLayouts) throws IOException { try (LockResource l = getDbLock(dbName)) { getTableInternal(dbName, tableName); alluxio.proto.journal.Table.CompleteTransformTableEntry entry = alluxio.proto.journal.Table.CompleteTransformTableEntry.newBuilder() .setDbName(dbName) .setTableName(tableName) .setDefinition(definition) .putAllTransformedLayouts(Maps.transformValues(transformedLayouts, Layout::toProto)) .build(); applyAndJournal(journalContext, Journal.JournalEntry.newBuilder() .setCompleteTransformTable(entry).build()); } } AlluxioCatalog(); }
AlluxioCatalog implements Journaled { public void completeTransformTable(JournalContext journalContext, String dbName, String tableName, String definition, Map<String, Layout> transformedLayouts) throws IOException { try (LockResource l = getDbLock(dbName)) { getTableInternal(dbName, tableName); alluxio.proto.journal.Table.CompleteTransformTableEntry entry = alluxio.proto.journal.Table.CompleteTransformTableEntry.newBuilder() .setDbName(dbName) .setTableName(tableName) .setDefinition(definition) .putAllTransformedLayouts(Maps.transformValues(transformedLayouts, Layout::toProto)) .build(); applyAndJournal(journalContext, Journal.JournalEntry.newBuilder() .setCompleteTransformTable(entry).build()); } } 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 void completeTransformTable(JournalContext journalContext, String dbName, String tableName, String definition, Map<String, Layout> transformedLayouts) throws IOException { try (LockResource l = getDbLock(dbName)) { getTableInternal(dbName, tableName); alluxio.proto.journal.Table.CompleteTransformTableEntry entry = alluxio.proto.journal.Table.CompleteTransformTableEntry.newBuilder() .setDbName(dbName) .setTableName(tableName) .setDefinition(definition) .putAllTransformedLayouts(Maps.transformValues(transformedLayouts, Layout::toProto)) .build(); applyAndJournal(journalContext, Journal.JournalEntry.newBuilder() .setCompleteTransformTable(entry).build()); } } 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();  }