@Override public void onAlterPartition(AlterPartitionEvent ape) throws MetaException { if (ape.getStatus()) { Partition before = ape.getOldPartition(); Partition after = ape.getNewPartition(); String topicName = getTopicName(ape.getTable()); send(messageFactory.buildAlterPartitionMessage(ape.getTable(),before, after, ape.getWriteId()), topicName); } }
@Test public void testAlterPartition() throws HCatException { Table t = new Table(); t.setDbName("testdb"); t.setTableName("testtable"); List<FieldSchema> pkeys = HCatSchemaUtils.getFieldSchemas( HCatSchemaUtils.getHCatSchema("a:int,b:string").getFields()); t.setPartitionKeys(pkeys); Partition p = createPtn(t, Arrays.asList("102", "lmn")); NotificationEvent event = new NotificationEvent(getEventId(), getTime(), HCatConstants.HCAT_ALTER_PARTITION_EVENT, msgFactory.buildAlterPartitionMessage(t, p, p, p.getWriteId()).toString()); event.setDbName(t.getDbName()); event.setTableName(t.getTableName()); HCatNotificationEvent hev = new HCatNotificationEvent(event); ReplicationTask rtask = ReplicationTask.create(client,hev); assertEquals(hev.toString(), rtask.getEvent().toString()); verifyAlterPartitionReplicationTask(rtask, t, p); }
@Override public void onAlterPartition(AlterPartitionEvent ape) throws MetaException { if (ape.getStatus()) { Partition before = ape.getOldPartition(); Partition after = ape.getNewPartition(); String topicName = getTopicName(ape.getTable()); send(messageFactory.buildAlterPartitionMessage(ape.getTable(),before, after), topicName); } }
@Override public void onAlterPartition(AlterPartitionEvent ape) throws MetaException { if (ape.getStatus()) { Partition before = ape.getOldPartition(); Partition after = ape.getNewPartition(); String topicName = getTopicName(ape.getTable()); send(messageFactory.buildAlterPartitionMessage(ape.getTable(),before, after), topicName); } }
@Override public void onAlterPartition(AlterPartitionEvent ape) throws MetaException { if (ape.getStatus()) { Partition before = ape.getOldPartition(); Partition after = ape.getNewPartition(); String topicName = getTopicName(ape.getTable()); send(messageFactory.buildAlterPartitionMessage(ape.getTable(),before, after), topicName); } }
/** * @param partitionEvent partition event * @throws MetaException */ public void onAlterPartition (AlterPartitionEvent partitionEvent) throws MetaException { Partition before = partitionEvent.getOldPartition(); Partition after = partitionEvent.getNewPartition(); NotificationEvent event = new NotificationEvent(0, now(), HCatConstants.HCAT_ALTER_PARTITION_EVENT, msgFactory.buildAlterPartitionMessage(partitionEvent.getTable(),before, after).toString()); event.setDbName(before.getDbName()); event.setTableName(before.getTableName()); enqueue(event); }
/** * @param partitionEvent partition event * @throws MetaException */ public void onAlterPartition (AlterPartitionEvent partitionEvent) throws MetaException { Partition before = partitionEvent.getOldPartition(); Partition after = partitionEvent.getNewPartition(); NotificationEvent event = new NotificationEvent(0, now(), HCatConstants.HCAT_ALTER_PARTITION_EVENT, msgFactory.buildAlterPartitionMessage(partitionEvent.getTable(),before, after).toString()); event.setDbName(before.getDbName()); event.setTableName(before.getTableName()); enqueue(event); }