org.apache.hadoop.hbase.regionserver.HStore.getCoprocessorHost()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.apache.hadoop.hbase.regionserver.HStore.getCoprocessorHost()方法的一些代码示例,展示了HStore.getCoprocessorHost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HStore.getCoprocessorHost()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.HStore
类名称:HStore
方法名:getCoprocessorHost

HStore.getCoprocessorHost介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

/**
 * Calls coprocessor, if any, to create scanners - after normal scanner creation.
 * @param request Compaction request.
 * @param scanType Scan type.
 * @param scanner The default scanner created for compaction.
 * @return Scanner scanner to use (usually the default); null if compaction should not proceed.
 */
private InternalScanner postCompactScannerOpen(CompactionRequestImpl request, ScanType scanType,
  InternalScanner scanner, User user) throws IOException {
 if (store.getCoprocessorHost() == null) {
  return scanner;
 }
 return store.getCoprocessorHost().preCompact(store, scanner, scanType, request.getTracker(),
  request, user);
}

代码示例来源:origin: apache/hbase

private List<HStoreFile> moveCompactedFilesIntoPlace(CompactionRequestImpl cr, List<Path> newFiles,
  User user) throws IOException {
 List<HStoreFile> sfs = new ArrayList<>(newFiles.size());
 for (Path newFile : newFiles) {
  assert newFile != null;
  HStoreFile sf = moveFileIntoPlace(newFile);
  if (this.getCoprocessorHost() != null) {
   getCoprocessorHost().postCompact(this, sf, cr.getTracker(), cr, user);
  }
  assert sf != null;
  sfs.add(sf);
 }
 return sfs;
}

代码示例来源:origin: apache/hbase

private ScanInfo preCompactScannerOpen(CompactionRequestImpl request, ScanType scanType,
  User user) throws IOException {
 if (store.getCoprocessorHost() == null) {
  return store.getScanInfo();
 }
 return store.getCoprocessorHost().preCompactScannerOpen(store, scanType, request.getTracker(),
  request, user);
}

代码示例来源:origin: apache/hbase

/**
 * Return a scanner for both the memstore and the HStore files. Assumes we are not in a
 * compaction.
 * @param scan Scan to apply when scanning the stores
 * @param targetCols columns to scan
 * @return a scanner over the current key values
 * @throws IOException on failure
 */
public KeyValueScanner getScanner(Scan scan, final NavigableSet<byte[]> targetCols, long readPt)
  throws IOException {
 lock.readLock().lock();
 try {
  ScanInfo scanInfo;
  if (this.getCoprocessorHost() != null) {
   scanInfo = this.getCoprocessorHost().preStoreScannerOpen(this);
  } else {
   scanInfo = getScanInfo();
  }
  return createScanner(scan, scanInfo, targetCols, readPt);
 } finally {
  lock.readLock().unlock();
 }
}

代码示例来源:origin: apache/hbase

/**
 * Creates the scanner for flushing snapshot. Also calls coprocessors.
 * @param snapshotScanners
 * @param smallestReadPoint
 * @return The scanner; null if coprocessor is canceling the flush.
 */
protected final InternalScanner createScanner(List<KeyValueScanner> snapshotScanners,
  long smallestReadPoint, FlushLifeCycleTracker tracker) throws IOException {
 ScanInfo scanInfo;
 if (store.getCoprocessorHost() != null) {
  scanInfo = store.getCoprocessorHost().preFlushScannerOpen(store, tracker);
 } else {
  scanInfo = store.getScanInfo();
 }
 InternalScanner scanner = new StoreScanner(store, scanInfo, snapshotScanners,
   ScanType.COMPACT_RETAIN_DELETES, smallestReadPoint, HConstants.OLDEST_TIMESTAMP);
 assert scanner != null;
 if (store.getCoprocessorHost() != null) {
  try {
   return store.getCoprocessorHost().preFlush(store, scanner, tracker);
  } catch (IOException ioe) {
   scanner.close();
   throw ioe;
  }
 }
 return scanner;
}

代码示例来源:origin: apache/hbase

public Path bulkLoadHFile(byte[] family, String srcPathStr, Path dstPath) throws IOException {
 Path srcPath = new Path(srcPathStr);
 try {
  fs.commitStoreFile(srcPath, dstPath);
 } finally {
  if (this.getCoprocessorHost() != null) {
   this.getCoprocessorHost().postCommitStoreFile(family, srcPath, dstPath);
  }
 }
 LOG.info("Loaded HFile " + srcPath + " into store '" + getColumnFamilyName() + "' as "
   + dstPath + " - updating store file list.");
 HStoreFile sf = createStoreFileAndReader(dstPath);
 bulkLoadHFile(sf);
 LOG.info("Successfully loaded store file {} into store {} (new location: {})",
   srcPath, this, dstPath);
 return dstPath;
}

代码示例来源:origin: apache/hbase

if (HStore.this.getCoprocessorHost() != null) {
 HStore.this.getCoprocessorHost().postFlush(HStore.this, sf, tracker);

代码示例来源:origin: apache/hbase

if (this.getCoprocessorHost() != null) {
 this.getCoprocessorHost().postCompact(this, sf, null, null, null);

代码示例来源:origin: apache/hbase

synchronized (filesCompacting) {
 if (this.getCoprocessorHost() != null) {
  final List<HStoreFile> candidatesForCoproc = compaction.preSelect(this.filesCompacting);
  boolean override = getCoprocessorHost().preCompactSelection(this,
    candidatesForCoproc, tracker, user);
  if (override) {
 if (this.getCoprocessorHost() != null) {
  this.getCoprocessorHost().postCompactSelection(
    this, ImmutableList.copyOf(compaction.getRequest().getFiles()), tracker,
    compaction.getRequest(), user);

代码示例来源:origin: apache/hbase

boolean success = false;
try {
 RegionCoprocessorHost cpHost = store.getCoprocessorHost();
 ScanInfo scanInfo;
 if (cpHost != null) {

代码示例来源:origin: apache/hbase

private StoreScanner(HStore store, ScanInfo scanInfo, List<? extends KeyValueScanner> scanners,
  ScanType scanType, long smallestReadPoint, long earliestPutTs, byte[] dropDeletesFromRow,
  byte[] dropDeletesToRow) throws IOException {
 this(store, SCAN_FOR_COMPACTION, scanInfo, 0,
   store.getHRegion().getReadPoint(IsolationLevel.READ_COMMITTED), false, scanType);
 assert scanType != ScanType.USER_SCAN;
 matcher =
   CompactionScanQueryMatcher.create(scanInfo, scanType, smallestReadPoint, earliestPutTs,
    oldestUnexpiredTS, now, dropDeletesFromRow, dropDeletesToRow, store.getCoprocessorHost());
 // Filter the list of scanners using Bloom filters, time range, TTL, etc.
 scanners = selectScannersFrom(store, scanners);
 // Seek all scanners to the initial key
 seekScanners(scanners, matcher.getStartKey(), false, parallelSeekEnabled);
 addCurrentScanners(scanners);
 // Combine all seeked scanners with a heap
 resetKVHeap(scanners, comparator);
}

代码示例来源:origin: apache/hbase

/**----------------------------------------------------------------------
 * The request to dispatch the compaction asynchronous task.
 * The method returns true if compaction was successfully dispatched, or false if there
 * is already an ongoing compaction or no segments to compact.
 */
public boolean start() throws IOException {
 if (!compactingMemStore.hasImmutableSegments()) { // no compaction on empty pipeline
  return false;
 }
 // get a snapshot of the list of the segments from the pipeline,
 // this local copy of the list is marked with specific version
 versionedList = compactingMemStore.getImmutableSegments();
 LOG.trace("Speculative compaction starting on {}/{}",
   compactingMemStore.getStore().getHRegion().getRegionInfo().getEncodedName(),
   compactingMemStore.getStore().getColumnFamilyName());
 HStore store = compactingMemStore.getStore();
 RegionCoprocessorHost cpHost = store.getCoprocessorHost();
 if (cpHost != null) {
  cpHost.preMemStoreCompaction(store);
 }
 try {
  doCompaction();
 } finally {
  if (cpHost != null) {
   cpHost.postMemStoreCompaction(store);
  }
 }
 return true;
}

代码示例来源:origin: apache/hbase

store.getCoprocessorHost());

代码示例来源:origin: harbby/presto-connectors

@Override
 public Void run() throws Exception {
  getCoprocessorHost().postCompact(thisStore, sf, cr);
  return null;
 }
});

代码示例来源:origin: harbby/presto-connectors

@Override
 public Boolean run() throws Exception {
  return getCoprocessorHost().preCompactSelection(thisStore, candidatesForCoproc,
   baseRequest);
 }
});

代码示例来源:origin: harbby/presto-connectors

assert newFile != null;
final StoreFile sf = moveFileIntoPlace(newFile);
if (this.getCoprocessorHost() != null) {
 final Store thisStore = this;
 if (user == null) {
  getCoprocessorHost().postCompact(thisStore, sf, cr);
 } else {
  try {

代码示例来源:origin: harbby/presto-connectors

@Override
public KeyValueScanner getScanner(Scan scan,
  final NavigableSet<byte []> targetCols, long readPt) throws IOException {
 lock.readLock().lock();
 try {
  KeyValueScanner scanner = null;
  if (this.getCoprocessorHost() != null) {
   scanner = this.getCoprocessorHost().preStoreScannerOpen(this, scan, targetCols);
  }
  if (scanner == null) {
   scanner = scan.isReversed() ? new ReversedStoreScanner(this,
     getScanInfo(), scan, targetCols, readPt) : new StoreScanner(this,
     getScanInfo(), scan, targetCols, readPt);
  }
  return scanner;
 } finally {
  lock.readLock().unlock();
 }
}

代码示例来源:origin: harbby/presto-connectors

if (HStore.this.getCoprocessorHost() != null) {
 HStore.this.getCoprocessorHost().postFlush(HStore.this, sf);

代码示例来源:origin: harbby/presto-connectors

if (this.getCoprocessorHost() != null) {
 this.getCoprocessorHost().postCompact(this, sf, null);

代码示例来源:origin: harbby/presto-connectors

@Override
 public Void run() throws Exception {
  getCoprocessorHost().postCompactSelection(
   thisStore,ImmutableList.copyOf(compaction.getRequest().getFiles()),baseRequest);
  return null;
 }
});

相关文章

HStore类方法