@Override
          public Object run() throws Exception {
            // New FileSystem object to be obtained in user context for doAs flow.
            try (FileSystem doAsFs = FileSystem.newInstance(eventsDir.getPath().toUri(), conf)) {
              doAsFs.delete(eventsDir.getPath(), true);
            }
            return null;
          }
Delete the events dir with it's owner as proxy user.
metastore/src/java/org/apache/hadoop/hive/metastore/HiveProtoEventsCleanerTask.java