类org.apache.hadoop.hbase.regionserver.Region.Operation源码实例Demo

下面列出了怎么用org.apache.hadoop.hbase.regionserver.Region.Operation的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ranger   文件: RangerAuthorizationCoprocessor.java
@Override
public void postStartRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,	Operation operation) throws IOException {
	if(LOG.isDebugEnabled()) {
		LOG.debug("==> RangerAuthorizationCoprocessor.postStartRegionOperation()");
	}

	try {
		activatePluginClassLoader();
		implRegionObserver.postStartRegionOperation(ctx, operation);
	} finally {
		deactivatePluginClassLoader();
	}

	if(LOG.isDebugEnabled()) {
		LOG.debug("<== RangerAuthorizationCoprocessor.postStartRegionOperation()");
	}
}
 
源代码2 项目: ranger   文件: RangerAuthorizationCoprocessor.java
@Override
public void postCloseRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx, Operation operation) throws IOException {
	if(LOG.isDebugEnabled()) {
		LOG.debug("==> RangerAuthorizationCoprocessor.postCloseRegionOperation()");
	}

	try {
		activatePluginClassLoader();
		implRegionObserver.postCloseRegionOperation(ctx, operation);
	} finally {
		deactivatePluginClassLoader();
	}

	if(LOG.isDebugEnabled()) {
		LOG.debug("<== RangerAuthorizationCoprocessor.postCloseRegionOperation()");
	}
}
 
源代码3 项目: hbase   文件: RegionCoprocessorHost.java
public void postStartRegionOperation(final Operation op) throws IOException {
  execOperation(coprocEnvironments.isEmpty()? null:
      new RegionObserverOperationWithoutResult() {
    @Override
    public void call(RegionObserver observer) throws IOException {
      observer.postStartRegionOperation(this, op);
    }
  });
}
 
源代码4 项目: hbase   文件: RegionCoprocessorHost.java
public void postCloseRegionOperation(final Operation op) throws IOException {
  execOperation(coprocEnvironments.isEmpty()? null:
      new RegionObserverOperationWithoutResult() {
    @Override
    public void call(RegionObserver observer) throws IOException {
      observer.postCloseRegionOperation(this, op);
    }
  });
}
 
源代码5 项目: hbase   文件: SimpleRegionObserver.java
@Override
public void postCloseRegionOperation(final ObserverContext<RegionCoprocessorEnvironment> ctx,
    Operation op) throws IOException {
  if (ctPostStartRegionOperation.get() > 0) {
    ctPostCloseRegionOperation.incrementAndGet();
  }
}
 
源代码6 项目: hbase   文件: FlushSnapshotSubprocedure.java
@Override
public Void call() throws Exception {
  // Taking the region read lock prevents the individual region from being closed while a
  // snapshot is in progress.  This is helpful but not sufficient for preventing races with
  // snapshots that involve multiple regions and regionservers.  It is still possible to have
  // an interleaving such that globally regions are missing, so we still need the verification
  // step.
  LOG.debug("Starting snapshot operation on " + region);
  region.startRegionOperation(Operation.SNAPSHOT);
  try {
    if (skipFlush) {
    /*
     * This is to take an online-snapshot without force a coordinated flush to prevent pause
     * The snapshot type is defined inside the snapshot description. FlushSnapshotSubprocedure
     * should be renamed to distributedSnapshotSubprocedure, and the flush() behavior can be
     * turned on/off based on the flush type.
     * To minimized the code change, class name is not changed.
     */
      LOG.debug("take snapshot without flush memstore first");
    } else {
      LOG.debug("Flush Snapshotting region " + region.toString() + " started...");
      boolean succeeded = false;
      long readPt = region.getReadPoint(IsolationLevel.READ_COMMITTED);
      for (int i = 0; i < MAX_RETRIES; i++) {
        FlushResult res = region.flush(true);
        if (res.getResult() == FlushResult.Result.CANNOT_FLUSH) {
          // CANNOT_FLUSH may mean that a flush is already on-going
          // we need to wait for that flush to complete
          region.waitForFlushes();
          if (region.getMaxFlushedSeqId() >= readPt) {
            // writes at the start of the snapshot have been persisted
            succeeded = true;
            break;
          }
        } else {
          succeeded = true;
          break;
        }
      }
      if (!succeeded) {
        throw new IOException("Unable to complete flush after " + MAX_RETRIES + " attempts");
      }
    }
    region.addRegionToSnapshot(snapshotDesc, monitor);
    if (skipFlush) {
      LOG.debug("... SkipFlush Snapshotting region " + region.toString() + " completed.");
    } else {
      LOG.debug("... Flush Snapshotting region " + region.toString() + " completed.");
    }
  } finally {
    LOG.debug("Closing snapshot operation on " + region);
    region.closeRegionOperation(Operation.SNAPSHOT);
  }
  return null;
}
 
源代码7 项目: hbase   文件: SimpleRegionObserver.java
@Override
public void postStartRegionOperation(final ObserverContext<RegionCoprocessorEnvironment> ctx,
    Operation op) throws IOException {
  ctPostStartRegionOperation.incrementAndGet();
}
 
源代码8 项目: phoenix   文件: DelegateRegionObserver.java
@Override
public void postStartRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
        Operation operation) throws IOException {
    delegate.postStartRegionOperation(ctx, operation);
}
 
源代码9 项目: phoenix   文件: DelegateRegionObserver.java
@Override
public void postCloseRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
        Operation operation) throws IOException {
    delegate.postCloseRegionOperation(ctx, operation);
}
 
源代码10 项目: hbase   文件: RegionObserver.java
/**
 * This will be called for region operations where read lock is acquired in
 * {@link Region#startRegionOperation()}.
 * @param ctx
 * @param operation The operation is about to be taken on the region
 */
default void postStartRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
    Operation operation) throws IOException {}
 
源代码11 项目: hbase   文件: RegionObserver.java
/**
 * Called after releasing read lock in {@link Region#closeRegionOperation()}.
 * @param ctx
 * @param operation
 */
default void postCloseRegionOperation(ObserverContext<RegionCoprocessorEnvironment> ctx,
    Operation operation) throws IOException {}
 
 类所在包
 同包方法