use of org.apache.hive.hcatalog.api.repl.commands.DropDatabaseCommand in project hive by apache.
the class DropDatabaseReplicationTask method getDstWhCommands.
public Iterable<? extends Command> getDstWhCommands() {
verifyActionable();
final String dstDbName = ReplicationUtils.mapIfMapAvailable(dropDatabaseMessage.getDB(), dbNameMapping);
return Collections.singletonList(new DropDatabaseCommand(dstDbName, event.getEventId()));
}
use of org.apache.hive.hcatalog.api.repl.commands.DropDatabaseCommand in project hive by apache.
the class TestEximReplicationTasks method verifyDropDbReplicationTask.
private static void verifyDropDbReplicationTask(ReplicationTask rtask) throws IOException {
assertEquals(DropDatabaseReplicationTask.class, rtask.getClass());
assertEquals(false, rtask.needsStagingDirs());
assertEquals(true, rtask.isActionable());
rtask.withDbNameMapping(debugMapping).withTableNameMapping(debugMapping);
for (Command c : rtask.getSrcWhCommands()) {
assertEquals(NoopCommand.class, c.getClass());
}
List<? extends Command> dstCommands = Lists.newArrayList(rtask.getDstWhCommands());
assertEquals(1, dstCommands.size());
assertEquals(DropDatabaseCommand.class, dstCommands.get(0).getClass());
DropDatabaseCommand dropDatabaseCommand = new DropDatabaseCommand(debugMapping.apply(rtask.getEvent().getDbName()), rtask.getEvent().getEventId());
assertEquals(ReplicationUtils.serializeCommand(dropDatabaseCommand), ReplicationUtils.serializeCommand(dstCommands.get(0)));
}
Aggregations