@Override
  public void onAlterPartition(AlterPartitionEvent partitionEvent) throws MetaException {
    Partition before = partitionEvent.getOldPartition();
    Partition after = partitionEvent.getNewPartition();
    AlterPartitionMessage msg = MessageBuilder.getInstance()
        .buildAlterPartitionMessage(partitionEvent.getTable(), before, after,
            partitionEvent.getIsTruncateOp(),
            partitionEvent.getWriteId());
    NotificationEvent event =
        new NotificationEvent(0, now(), EventType.ALTER_PARTITION.toString(),
            msgEncoder.getSerializer().serialize(msg));
    event.setCatName(before.isSetCatName() ? before.getCatName() : getDefaultCatalog(conf));
    event.setDbName(before.getDbName());
    event.setTableName(before.getTableName());
    process(event, partitionEvent);
  }
@param partitionEvent partition event
@throws MetaException
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java