/** * Listener which fires when a partition is dropped. * * <p>For auditing purposes the read/write differential is the existence and * non-existence of the dropped partition respectively.</p> * * @param event The drop partition event */ @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { try { Set<ReadEntity> readEntities = new HashSet<>(); readEntities.add( new ReadEntity( new Partition(new Table(event.getTable()), event.getPartition()) ) ); Set<WriteEntity> writeEntities = new HashSet<>(); run(readEntities, writeEntities, HiveOperation.THRIFT_DROP_PARTITION); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Listener which fires when a partition is dropped. * * <p>For auditing purposes the read/write differential is the existence and * non-existence of the dropped partition respectively.</p> * * @param event The drop partition event */ @Override public void onDropPartition(DropPartitionEvent event) throws MetaException { try { Set<ReadEntity> readEntities = new HashSet<>(); readEntities.add( new ReadEntity( new Partition(new Table(event.getTable()), event.getPartition()) ) ); Set<WriteEntity> writeEntities = new HashSet<>(); run(readEntities, writeEntities, HiveOperation.THRIFT_DROP_PARTITION); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void onDropPartition(DropPartitionEvent partitionEvent) throws MetaException { // don't sync path if the operation has failed if (!partitionEvent.getStatus()) { LOGGER.debug("Skip syncing path with Sentry server for onDropPartition event," + " since the operation failed. \n"); return; } String authzObj = partitionEvent.getTable().getDbName() + "." + partitionEvent.getTable().getTableName(); String path = partitionEvent.getPartition().getSd().getLocation(); for (SentryMetastoreListenerPlugin plugin : sentryPlugins) { plugin.removePath(authzObj, path); } super.onDropPartition(partitionEvent); }