类org.apache.hadoop.hbase.regionserver.compactions.CompactionRequest源码实例Demo

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

源代码1 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码2 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码3 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码4 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompact(
    org.apache.hadoop.hbase.coprocessor.ObserverContext<RegionCoprocessorEnvironment> c,
    Store store, InternalScanner scanner, ScanType scanType,
    org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker tracker,
    CompactionRequest request) throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();
  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }
  // Also make sure to use the same snapshot for the compaction
  InternalScanner s =
      createStoreScanner(c.getEnvironment(), "compaction", snapshot, scanner, scanType);
  if (s != null) {
    return s;
  }
  return scanner;
}
 
源代码5 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码6 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码7 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
源代码8 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs, InternalScanner s,
    CompactionRequest request)
    throws IOException {
  // Get the latest tx snapshot state for the compaction
  TransactionVisibilityState snapshot = cache.getLatestState();

  // Record tx state before the compaction
  if (compactionState != null) {
    compactionState.record(request, snapshot);
  }

  // silently close the passed scanner as we're returning a brand-new one
  try (InternalScanner temp = s) { }
  // Also make sure to use the same snapshot for the compaction
  return createStoreScanner(c.getEnvironment(), "compaction", snapshot, store, scanners, scanType, earliestPutTs);
}
 
@Override
public InternalScanner preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
        Store store, List<? extends KeyValueScanner> scanners, ScanType scanType,
        long earliestPutTs, InternalScanner s, CompactionRequest request) throws IOException {
    InternalScanner internalScanner = super.preCompactScannerOpen(c, store, scanners, scanType, earliestPutTs, s, request);
    Collection<StoreFile> files = request.getFiles();
    storeFilesCount = 0;
    compactedFilesCount = 0;
    for(StoreFile file:files) {
        if(!file.isReference()) {
            return internalScanner;
        }
    }
    storeFilesCount = files.size();
    return internalScanner;
}
 
源代码10 项目: ranger   文件: RangerAuthorizationCoprocessor.java
@Override
public void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<? extends StoreFile> selected, CompactionLifeCycleTracker tracker, CompactionRequest request) {
	if(LOG.isDebugEnabled()) {
		LOG.debug("==> RangerAuthorizationCoprocessor.postCompactSelection()");
	}

	try {
		activatePluginClassLoader();
		implRegionObserver.postCompactSelection(c, store, selected, tracker, request);
	} finally {
		deactivatePluginClassLoader();
	}

	if(LOG.isDebugEnabled()) {
		LOG.debug("<== RangerAuthorizationCoprocessor.postCompactSelection()");
	}
}
 
源代码11 项目: ranger   文件: RangerAuthorizationCoprocessor.java
@Override
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store,	InternalScanner scanner,
								  ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException {

	final InternalScanner ret;

	if(LOG.isDebugEnabled()) {
		LOG.debug("==> RangerAuthorizationCoprocessor.preCompact()");
	}

	try {
		activatePluginClassLoader();
		ret = implRegionObserver.preCompact(c, store, scanner, scanType, tracker, request);
	} finally {
		deactivatePluginClassLoader();
	}

	if(LOG.isDebugEnabled()) {
		LOG.debug("<== RangerAuthorizationCoprocessor.preCompact()");
	}

	return ret;
}
 
源代码12 项目: ranger   文件: RangerAuthorizationCoprocessor.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, StoreFile resultFile,
						CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException {
	if(LOG.isDebugEnabled()) {
		LOG.debug("==> RangerAuthorizationCoprocessor.postCompact()");
	}

	try {
		activatePluginClassLoader();
		implRegionObserver.postCompact(c, store, resultFile, tracker, request);
	} finally {
		deactivatePluginClassLoader();
	}

	if(LOG.isDebugEnabled()) {
		LOG.debug("<== RangerAuthorizationCoprocessor.postCompact()");
	}
}
 
源代码13 项目: geowave   文件: ServerSideOperationsObserver.java
@Override
public InternalScanner preCompact(
    final ObserverContext<RegionCoprocessorEnvironment> e,
    final Store store,
    final InternalScanner scanner,
    final ScanType scanType,
    final CompactionRequest request) throws IOException {
  if (opStore == null) {
    return super.preCompact(e, store, scanner, scanType, request);
  }
  return super.preCompact(
      e,
      store,
      wrapScannerWithOps(
          e.getEnvironment().getRegionInfo().getTable(),
          scanner,
          null,
          ServerOpScope.MAJOR_COMPACTION,
          INTERNAL_SCANNER_FACTORY),
      scanType,
      request);
}
 
源代码14 项目: spliceengine   文件: MemstoreAwareObserver.java
@Override
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
                                  InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker,
                                  CompactionRequest request) throws IOException {
    try {
        BlockingProbe.blockPreCompact();
        if (!(request instanceof SpliceCompactionRequest)) {
            SpliceLogUtils.error(LOG,"Compaction request must be a SpliceCompactionRequest");
            throw new DoNotRetryIOException();
        }
        SpliceCompactionRequest scr = (SpliceCompactionRequest) request;
        // memstoreAware is injected into the request, where the blocking logic lives, and where compaction
        // count will be incremented and decremented.
        scr.setMemstoreAware(memstoreAware);
        HRegion region = (HRegion) c.getEnvironment().getRegion();
        scr.setRegion(region);
        return scanner == null ? DummyScanner.INSTANCE : scanner;
    } catch (Throwable t) {
        throw CoprocessorUtils.getIOException(t);
    }
}
 
源代码15 项目: phoenix-omid   文件: BaseRegionObserver.java
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c,
                                  Store store,
                                  InternalScanner scanner,
                                  ScanType scanType,
                                  CompactionLifeCycleTracker tracker,
                                  CompactionRequest request) throws IOException {
    return preCompact(c,store,scanner,scanType,request);
}
 
源代码16 项目: phoenix-omid   文件: BaseRegionObserver.java
public InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> env,
                                  Store store,
                                  InternalScanner scanner,
                                  ScanType scanType,
                                  CompactionRequest request) throws IOException {
    return scanner;
}
 
源代码17 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
源代码18 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile,
                        CompactionRequest request) throws IOException {
  // Persist the compaction state after a successful compaction
  if (compactionState != null) {
    compactionState.persist();
  }
}
 
源代码19 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
源代码20 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile,
                        CompactionRequest request) throws IOException {
  // Persist the compaction state after a succesful compaction
  if (compactionState != null) {
    compactionState.persist();
  }
}
 
源代码21 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
源代码22 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile,
                        CompactionRequest request) throws IOException {
  // Persist the compaction state after a successful compaction
  if (compactionState != null) {
    compactionState.persist();
  }
}
 
源代码23 项目: spliceengine   文件: MemstoreAwareObserver.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, StoreFile resultFile,
                        CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException {
    try {
        BlockingProbe.blockPostCompact();
    } catch (Throwable t) {
        throw CoprocessorUtils.getIOException(t);
    }
}
 
源代码24 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
源代码25 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store,
    ScanType scanType, ScanOptions options, CompactionLifeCycleTracker tracker,
    CompactionRequest request) throws IOException {
  if (cache.getLatestState() != null) {
    options.readAllVersions();
  }
}
 
源代码26 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void postCompact(
    org.apache.hadoop.hbase.coprocessor.ObserverContext<RegionCoprocessorEnvironment> c,
    Store store, StoreFile resultFile,
    org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker tracker,
    CompactionRequest request) throws IOException {
  // Persist the compaction state after a successful compaction
  if (compactionState != null) {
    compactionState.persist();
  }
}
 
源代码27 项目: phoenix-tephra   文件: InvalidListPruneTest.java
@Override
public void postCompact(
        org.apache.hadoop.hbase.coprocessor.ObserverContext<RegionCoprocessorEnvironment> c,
        Store store, StoreFile resultFile,
        org.apache.hadoop.hbase.regionserver.compactions.CompactionLifeCycleTracker tracker,
        CompactionRequest request) throws IOException {
    super.postCompact(c, store, resultFile, tracker, request);
    lastMajorCompactionTime.set(System.currentTimeMillis());
}
 
源代码28 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
源代码29 项目: phoenix-tephra   文件: TransactionProcessor.java
@Override
public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile,
                        CompactionRequest request) throws IOException {
  // Persist the compaction state after a successful compaction
  if (compactionState != null) {
    compactionState.persist();
  }
}
 
源代码30 项目: phoenix-tephra   文件: CompactionState.java
/**
 * Records the transaction state used for a compaction. This method is called when the compaction starts.
 *
 * @param request {@link CompactionRequest} for the compaction
 * @param snapshot transaction state that will be used for the compaction
 */
public void record(CompactionRequest request, @Nullable TransactionVisibilityState snapshot) {
  if (request.isMajor() && snapshot != null) {
    Transaction tx = TxUtils.createDummyTransaction(snapshot);
    pruneUpperBound = TxUtils.getPruneUpperBound(tx);
    if (LOG.isDebugEnabled()) {
      LOG.debug(
        String.format("Computed prune upper bound %s for compaction request %s using transaction state from time %s",
                      pruneUpperBound, request, snapshot.getTimestamp()));
    }
  } else {
    pruneUpperBound = -1;
  }
}
 
 类所在包
 类方法
 同包方法