use of org.apache.hadoop.hbase.coprocessor.ObserverContext in project hbase by apache.
the class SecureBulkLoadManager method prepareBulkLoad.
public String prepareBulkLoad(final Region region, final PrepareBulkLoadRequest request) throws IOException {
List<BulkLoadObserver> bulkLoadObservers = getBulkLoadObservers(region);
if (bulkLoadObservers != null && bulkLoadObservers.size() != 0) {
ObserverContext<RegionCoprocessorEnvironment> ctx = new ObserverContext<>(getActiveUser());
ctx.prepare((RegionCoprocessorEnvironment) region.getCoprocessorHost().findCoprocessorEnvironment(BulkLoadObserver.class).get(0));
for (BulkLoadObserver bulkLoadObserver : bulkLoadObservers) {
bulkLoadObserver.prePrepareBulkLoad(ctx, request);
}
}
String bulkToken = createStagingDir(baseStagingDir, getActiveUser(), region.getTableDesc().getTableName()).toString();
return bulkToken;
}
use of org.apache.hadoop.hbase.coprocessor.ObserverContext in project hbase by apache.
the class SecureBulkLoadManager method cleanupBulkLoad.
public void cleanupBulkLoad(final Region region, final CleanupBulkLoadRequest request) throws IOException {
List<BulkLoadObserver> bulkLoadObservers = getBulkLoadObservers(region);
if (bulkLoadObservers != null && bulkLoadObservers.size() != 0) {
ObserverContext<RegionCoprocessorEnvironment> ctx = new ObserverContext<>(getActiveUser());
ctx.prepare((RegionCoprocessorEnvironment) region.getCoprocessorHost().findCoprocessorEnvironment(BulkLoadObserver.class).get(0));
for (BulkLoadObserver bulkLoadObserver : bulkLoadObservers) {
bulkLoadObserver.preCleanupBulkLoad(ctx, request);
}
}
fs.delete(new Path(request.getBulkToken()), true);
}
Aggregations