@Override
  public void onAlterPartitions(AlterPartitionsEvent event) throws MetaException {
    Table table = event.getTable();
    Iterator<List<Partition>> iterator = event.getNewPartsIterator(maxBatchSize);
    while (iterator.hasNext()) {
      List<Partition> partitions = iterator.next();
      AlterPartitionsMessage msg = MessageBuilder.getInstance()
          .buildAlterPartitionsMessage(event.getTable(), partitions,
              event.getIsTruncateOp(), partitions.get(0).getWriteId());
      NotificationEvent notification =
          new NotificationEvent(0, now(), EventType.ALTER_PARTITIONS.toString(),
              msgEncoder.getSerializer().serialize(msg));
      notification.setCatName(table.isSetCatName() ? table.getCatName() : getDefaultCatalog(conf));
      notification.setDbName(table.getDbName());
      notification.setTableName(table.getTableName());
      process(notification, event);
    }
  }
@param partitionEvent partition event
@throws MetaException
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java