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

x33g5p2x  于2022-01-30 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(194)

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

Store.getHRegion介绍

暂无

代码示例

代码示例来源:origin: co.cask.hbase/hbase

void isInterrupted(final Store store, final StoreFile.Writer writer)
throws IOException {
 if (store.getHRegion().areWritesEnabled()) return;
 // Else cleanup.
 writer.close();
 store.getFileSystem().delete(writer.getPath(), false);
 throw new InterruptedIOException( "Aborting compaction of store " + store +
  " in region " + store.getHRegion() + " because user requested stop.");
}

代码示例来源:origin: XiaoMi/themis

throws IOException {
long cleanTs = Long.MIN_VALUE;
ZooKeeperWatcher zk = store.getHRegion().getRegionServerServices().getZooKeeper();
try {
 cleanTs = ThemisMasterObserver.getThemisExpiredTsFromZk(zk);
ThemisExpiredDataCleanFilter filter = null;
if (deleteThemisDeletedDataWhenCompact && isCompact) {
 filter = new ThemisExpiredDataCleanFilter(cleanTs, store.getHRegion());
} else {
 filter = new ThemisExpiredDataCleanFilter(cleanTs);

代码示例来源:origin: co.cask.hbase/hbase

@Override
 public boolean commit(MonitoredTask status) throws IOException {
  if (storeFilePath == null) {
   return false;
  }
  storeFile = Store.this.commitFile(storeFilePath, cacheFlushId,
               snapshotTimeRangeTracker, flushedSize, status);
  if (Store.this.getHRegion().getCoprocessorHost() != null) {
   Store.this.getHRegion()
     .getCoprocessorHost()
     .postFlush(Store.this, storeFile);
  }
  // Add new file to store files.  Clear snapshot too while we have
  // the Store write lock.
  return Store.this.updateStorefiles(storeFile, snapshot);
 }
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Create a simple compaction request just for testing - this lets you specify everything you
 * would need in the general case of testing compactions from an external perspective (e.g.
 * requesting a compaction through the HRegion).
 * @param store
 * @param conf
 * @param selection
 * @param isMajor
 * @return a request that is useful in requesting compactions for testing
 */
public static CompactionRequest getRequestForTesting(Store store, Configuration conf,
  Collection<StoreFile> selection, boolean isMajor) {
 return new CompactionRequest(store.getHRegion(), store, new CompactSelection(conf,
   new ArrayList<StoreFile>(
   selection)), isMajor, 0, System.nanoTime());
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Return a scanner for both the memstore and the HStore files. Assumes we
 * are not in a compaction.
 * @throws IOException
 */
public KeyValueScanner getScanner(Scan scan,
  final NavigableSet<byte []> targetCols) throws IOException {
 lock.readLock().lock();
 try {
  KeyValueScanner scanner = null;
  if (getHRegion().getCoprocessorHost() != null) {
   scanner = getHRegion().getCoprocessorHost().preStoreScannerOpen(this, scan, targetCols);
  }
  if (scanner == null) {
   scanner = new StoreScanner(this, getScanInfo(), scan, targetCols);
  }
  return scanner;
 } finally {
  lock.readLock().unlock();
 }
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
public InternalScanner preFlushScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
  Store store, KeyValueScanner memstoreScanner, InternalScanner s) throws IOException {
 Store.ScanInfo scanInfo = getScanInfo(store, c.getEnvironment());
 if (scanInfo == null) {
  // take default action
  return null;
 }
 Scan scan = new Scan();
 scan.setMaxVersions(scanInfo.getMaxVersions());
 return new StoreScanner(store, scanInfo, scan, Collections.singletonList(memstoreScanner),
   ScanType.MINOR_COMPACT, store.getHRegion().getSmallestReadPoint(),
   HConstants.OLDEST_TIMESTAMP);
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
public InternalScanner preCompactScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
  Store store, List<? extends KeyValueScanner> scanners, ScanType scanType, long earliestPutTs,
  InternalScanner s) throws IOException {
 Store.ScanInfo scanInfo = getScanInfo(store, c.getEnvironment());
 if (scanInfo == null) {
  // take default action
  return null;
 }
 Scan scan = new Scan();
 scan.setMaxVersions(scanInfo.getMaxVersions());
 return new StoreScanner(store, scanInfo, scan, scanners, scanType, store.getHRegion()
   .getSmallestReadPoint(), earliestPutTs);
}

代码示例来源:origin: XiaoMi/themis

@Override
public InternalScanner preFlushScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
  final Store store, final KeyValueScanner memstoreScanner, final InternalScanner s)
  throws IOException {
 if (expiredDataCleanEnable
   && (ThemisMasterObserver.isThemisEnableFamily(store.getFamily()) || ColumnUtil
     .isCommitFamily(store.getFamily().getName()))) {
  InternalScanner scanner = getScannerToCleanExpiredThemisData(store, store.scanInfo,
   Collections.singletonList(memstoreScanner), ScanType.MINOR_COMPACT, store.getHRegion()
     .getSmallestReadPoint(), HConstants.OLDEST_TIMESTAMP, false);
  if (scanner != null) {
   return scanner;
  }
 }
 return s;
}

代码示例来源:origin: co.cask.hbase/hbase

if (getHRegion().getCoprocessorHost() != null) {
 scanner = getHRegion().getCoprocessorHost().preFlushScannerOpen(this, memstoreScanner);
   this.region.getSmallestReadPoint(), HConstants.OLDEST_TIMESTAMP);
if (getHRegion().getCoprocessorHost() != null) {
 InternalScanner cpScanner =
  getHRegion().getCoprocessorHost().preFlush(this, scanner);

代码示例来源:origin: XiaoMi/themis

@Override
public InternalScanner preCompactScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
  final Store store, List<? extends KeyValueScanner> scanners, final ScanType scanType,
  final long earliestPutTs, final InternalScanner s, CompactionRequest request)
  throws IOException {
 if (expiredDataCleanEnable
   && (ThemisMasterObserver.isThemisEnableFamily(store.getFamily()) || ColumnUtil
     .isCommitFamily(store.getFamily().getName()))) {
  InternalScanner scanner = getScannerToCleanExpiredThemisData(store, store.getScanInfo(),
   scanners, scanType, store.getHRegion().getSmallestReadPoint(), earliestPutTs, true);
  if (scanner != null) {
   return scanner;
  }
 }
 return s;
}

代码示例来源:origin: co.cask.hbase/hbase

long smallestReadPoint = store.getHRegion().getSmallestReadPoint();
MultiVersionConsistencyControl.setThreadReadPoint(smallestReadPoint);
try {
 InternalScanner scanner = null;
 try {
  if (store.getHRegion().getCoprocessorHost() != null) {
   scanner = store.getHRegion()
     .getCoprocessorHost()
     .preCompactScannerOpen(store, scanners,
    smallestReadPoint, earliestPutTs);
  if (store.getHRegion().getCoprocessorHost() != null) {
   InternalScanner cpScanner =
    store.getHRegion().getCoprocessorHost().preCompact(store, scanner, request);

相关文章