@Test public void testPreCompactSelection() throws Exception { PrivilegedExceptionAction action = new PrivilegedExceptionAction() { public Object run() throws Exception { ACCESS_CONTROLLER.preCompactSelection(ObserverContext.createAndPrepare(RCP_ENV, null), null, null); return null; } }; verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_OWNER); verifyDenied(action, USER_CREATE, USER_RW, USER_RO, USER_NONE); }
@Override public void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final List<StoreFile> candidates) throws IOException { requirePermission(getTableName(e.getEnvironment()), null, null, Action.ADMIN); }
AccessController extends BaseRegionObserver implements MasterObserver, AccessControllerProtocol { @Override public void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final List<StoreFile> candidates) throws IOException { requirePermission(getTableName(e.getEnvironment()), null, null, Action.ADMIN); } }
AccessController extends BaseRegionObserver implements MasterObserver, AccessControllerProtocol { @Override public void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final List<StoreFile> candidates) throws IOException { requirePermission(getTableName(e.getEnvironment()), null, null, Action.ADMIN); }  }
AccessController extends BaseRegionObserver implements MasterObserver, AccessControllerProtocol { @Override public void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final List<StoreFile> candidates) throws IOException { requirePermission(getTableName(e.getEnvironment()), null, null, Action.ADMIN); }  void start(CoprocessorEnvironment env); void stop(CoprocessorEnvironment env); @Override void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
      HTableDescriptor desc, HRegionInfo[] regions); @Override void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
      HTableDescriptor desc, HRegionInfo[] regions); @Override void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HTableDescriptor htd); @Override void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HTableDescriptor htd); @Override void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HColumnDescriptor column); @Override void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HColumnDescriptor column); @Override void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HColumnDescriptor descriptor); @Override void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HColumnDescriptor descriptor); @Override void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      byte[] col); @Override void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, byte[] col); @Override void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preMove(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo region,
      ServerName srcServer, ServerName destServer); @Override void postMove(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo region, ServerName srcServer, ServerName destServer); @Override void preAssign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo); @Override void postAssign(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo regionInfo); @Override void preUnassign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo,
      boolean force); @Override void postUnassign(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo regionInfo, boolean force); @Override void preBalance(ObserverContext<MasterCoprocessorEnvironment> c); @Override void postBalance(ObserverContext<MasterCoprocessorEnvironment> c); @Override boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
      boolean newValue); @Override void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
      boolean oldValue, boolean newValue); @Override void preShutdown(ObserverContext<MasterCoprocessorEnvironment> c); @Override void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c); @Override void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx); @Override void postOpen(ObserverContext<RegionCoprocessorEnvironment> c); @Override void preFlush(ObserverContext<RegionCoprocessorEnvironment> e); @Override void preSplit(ObserverContext<RegionCoprocessorEnvironment> e); @Override InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
      final Store store, final InternalScanner scanner); @Override void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e,
      final Store store, final List<StoreFile> candidates); @Override void preGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final Result result); @Override void preGet(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Get get, final List<KeyValue> result); @Override boolean preExists(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Get get, final boolean exists); @Override void prePut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Put put, final WALEdit edit, final boolean writeToWAL); @Override void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Put put, final WALEdit edit, final boolean writeToWAL); @Override void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Delete delete, final WALEdit edit, final boolean writeToWAL); @Override void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Delete delete, final WALEdit edit, final boolean writeToWAL); @Override boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final CompareFilter.CompareOp compareOp,
      final WritableByteArrayComparable comparator, final Put put,
      final boolean result); @Override boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final CompareFilter.CompareOp compareOp,
      final WritableByteArrayComparable comparator, final Delete delete,
      final boolean result); @Override long preIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final long amount, final boolean writeToWAL); @Override Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append); @Override Result preIncrement(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Increment increment); @Override RegionScanner preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Scan scan, final RegionScanner s); @Override RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Scan scan, final RegionScanner s); @Override boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s, final List<Result> result,
      final int limit, final boolean hasNext); @Override void preScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s); @Override void postScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s); @Override void grant(UserPermission perm); @Override @Deprecated void grant(byte[] user, TablePermission permission); @Override void revoke(UserPermission perm); @Override @Deprecated void revoke(byte[] user, TablePermission permission); @Override List<UserPermission> getUserPermissions(final byte[] tableName); @Override void checkPermissions(Permission[] permissions); @Override long getProtocolVersion(String protocol, long clientVersion); @Override ProtocolSignature getProtocolSignature(String protocol,
      long clientVersion, int clientMethodsHash); }
AccessController extends BaseRegionObserver implements MasterObserver, AccessControllerProtocol { @Override public void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final List<StoreFile> candidates) throws IOException { requirePermission(getTableName(e.getEnvironment()), null, null, Action.ADMIN); }  void start(CoprocessorEnvironment env); void stop(CoprocessorEnvironment env); @Override void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
      HTableDescriptor desc, HRegionInfo[] regions); @Override void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
      HTableDescriptor desc, HRegionInfo[] regions); @Override void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HTableDescriptor htd); @Override void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HTableDescriptor htd); @Override void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HColumnDescriptor column); @Override void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HColumnDescriptor column); @Override void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      HColumnDescriptor descriptor); @Override void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, HColumnDescriptor descriptor); @Override void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
      byte[] col); @Override void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName, byte[] col); @Override void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName); @Override void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> c,
      byte[] tableName); @Override void preMove(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo region,
      ServerName srcServer, ServerName destServer); @Override void postMove(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo region, ServerName srcServer, ServerName destServer); @Override void preAssign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo); @Override void postAssign(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo regionInfo); @Override void preUnassign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo,
      boolean force); @Override void postUnassign(ObserverContext<MasterCoprocessorEnvironment> c,
      HRegionInfo regionInfo, boolean force); @Override void preBalance(ObserverContext<MasterCoprocessorEnvironment> c); @Override void postBalance(ObserverContext<MasterCoprocessorEnvironment> c); @Override boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
      boolean newValue); @Override void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> c,
      boolean oldValue, boolean newValue); @Override void preShutdown(ObserverContext<MasterCoprocessorEnvironment> c); @Override void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> c); @Override void postStartMaster(ObserverContext<MasterCoprocessorEnvironment> ctx); @Override void postOpen(ObserverContext<RegionCoprocessorEnvironment> c); @Override void preFlush(ObserverContext<RegionCoprocessorEnvironment> e); @Override void preSplit(ObserverContext<RegionCoprocessorEnvironment> e); @Override InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
      final Store store, final InternalScanner scanner); @Override void preCompactSelection(final ObserverContext<RegionCoprocessorEnvironment> e,
      final Store store, final List<StoreFile> candidates); @Override void preGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final Result result); @Override void preGet(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Get get, final List<KeyValue> result); @Override boolean preExists(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Get get, final boolean exists); @Override void prePut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Put put, final WALEdit edit, final boolean writeToWAL); @Override void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Put put, final WALEdit edit, final boolean writeToWAL); @Override void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Delete delete, final WALEdit edit, final boolean writeToWAL); @Override void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Delete delete, final WALEdit edit, final boolean writeToWAL); @Override boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final CompareFilter.CompareOp compareOp,
      final WritableByteArrayComparable comparator, final Put put,
      final boolean result); @Override boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final CompareFilter.CompareOp compareOp,
      final WritableByteArrayComparable comparator, final Delete delete,
      final boolean result); @Override long preIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> c,
      final byte [] row, final byte [] family, final byte [] qualifier,
      final long amount, final boolean writeToWAL); @Override Result preAppend(ObserverContext<RegionCoprocessorEnvironment> c, Append append); @Override Result preIncrement(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Increment increment); @Override RegionScanner preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Scan scan, final RegionScanner s); @Override RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Scan scan, final RegionScanner s); @Override boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s, final List<Result> result,
      final int limit, final boolean hasNext); @Override void preScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s); @Override void postScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
      final InternalScanner s); @Override void grant(UserPermission perm); @Override @Deprecated void grant(byte[] user, TablePermission permission); @Override void revoke(UserPermission perm); @Override @Deprecated void revoke(byte[] user, TablePermission permission); @Override List<UserPermission> getUserPermissions(final byte[] tableName); @Override void checkPermissions(Permission[] permissions); @Override long getProtocolVersion(String protocol, long clientVersion); @Override ProtocolSignature getProtocolSignature(String protocol,
      long clientVersion, int clientMethodsHash); static final Log LOG; }