Java 类org.apache.hadoop.hbase.coprocessor.RegionObserver.MutationType 实例源码

项目:HIndex    文件:RegionCoprocessorHost.java   
public Cell postMutationBeforeWAL(final MutationType opType, final Mutation mutation,
    final Cell oldCell, Cell newCell) throws IOException {
  ObserverContext<RegionCoprocessorEnvironment> ctx = null;
  for (RegionEnvironment env : coprocessors) {
    if (env.getInstance() instanceof RegionObserver) {
      ctx = ObserverContext.createAndPrepare(env, ctx);
      Thread currentThread = Thread.currentThread();
      ClassLoader cl = currentThread.getContextClassLoader();
      try {
        currentThread.setContextClassLoader(env.getClassLoader());
        newCell = ((RegionObserver) env.getInstance()).postMutationBeforeWAL(ctx, opType,
          mutation, oldCell, newCell);
      } catch (Throwable e) {
        handleCoprocessorThrowable(env, e);
      } finally {
        currentThread.setContextClassLoader(cl);
      }
      if (ctx.shouldComplete()) {
        break;
      }
    }
  }
  return newCell;
}
项目:PyroDB    文件:RegionCoprocessorHost.java   
public Cell postMutationBeforeWAL(final MutationType opType, final Mutation mutation,
    final Cell oldCell, Cell newCell) throws IOException {
  ObserverContext<RegionCoprocessorEnvironment> ctx = null;
  for (RegionEnvironment env : coprocessors) {
    if (env.getInstance() instanceof RegionObserver) {
      ctx = ObserverContext.createAndPrepare(env, ctx);
      Thread currentThread = Thread.currentThread();
      ClassLoader cl = currentThread.getContextClassLoader();
      try {
        currentThread.setContextClassLoader(env.getClassLoader());
        newCell = ((RegionObserver) env.getInstance()).postMutationBeforeWAL(ctx, opType,
          mutation, oldCell, newCell);
      } catch (Throwable e) {
        handleCoprocessorThrowable(env, e);
      } finally {
        currentThread.setContextClassLoader(cl);
      }
      if (ctx.shouldComplete()) {
        break;
      }
    }
  }
  return newCell;
}
项目:ditb    文件:RegionCoprocessorHost.java   
public Cell postMutationBeforeWAL(final MutationType opType, final Mutation mutation,
    final Cell oldCell, Cell newCell) throws IOException {
  return execOperationWithResult(newCell,
      coprocessors.isEmpty() ? null : new RegionOperationWithResult<Cell>() {
    @Override
    public void call(RegionObserver oserver, ObserverContext<RegionCoprocessorEnvironment> ctx)
        throws IOException {
      setResult(oserver.postMutationBeforeWAL(ctx, opType, mutation, oldCell, getResult()));
    }
  });
}
项目:pbase    文件:RegionCoprocessorHost.java   
public Cell postMutationBeforeWAL(final MutationType opType, final Mutation mutation,
    final Cell oldCell, Cell newCell) throws IOException {
  return execOperationWithResult(newCell,
      coprocessors.isEmpty() ? null : new RegionOperationWithResult<Cell>() {
    @Override
    public void call(RegionObserver oserver, ObserverContext<RegionCoprocessorEnvironment> ctx)
        throws IOException {
      setResult(oserver.postMutationBeforeWAL(ctx, opType, mutation, oldCell, getResult()));
    }
  });
}
项目:hbase    文件:RegionCoprocessorHost.java   
public Cell postMutationBeforeWAL(final MutationType opType, final Mutation mutation,
    final Cell oldCell, Cell newCell) throws IOException {
  if (this.coprocEnvironments.isEmpty()) {
    return newCell;
  }
  return execOperationWithResult(
      new ObserverOperationWithResult<RegionObserver, Cell>(regionObserverGetter, newCell) {
        @Override
        public Cell call(RegionObserver observer) throws IOException {
          return observer.postMutationBeforeWAL(this, opType, mutation, oldCell, getResult());
        }
      });
}