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

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

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

HStore.getRegionInfo介绍

暂无

代码示例

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

  1. @Override
  2. public TableName getTableName() {
  3. return this.getRegionInfo().getTable();
  4. }

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

  1. @Override
  2. public boolean isPrimaryReplicaStore() {
  3. return getRegionInfo().getReplicaId() == RegionInfo.DEFAULT_REPLICA_ID;
  4. }

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

  1. /**
  2. * Adds a value to the memstore
  3. */
  4. public void add(final Cell cell, MemStoreSizing memstoreSizing) {
  5. lock.readLock().lock();
  6. try {
  7. if (this.currentParallelPutCount.getAndIncrement() > this.parallelPutCountPrintThreshold) {
  8. LOG.trace(this.getTableName() + "tableName={}, encodedName={}, columnFamilyName={} is " +
  9. "too busy!", this.getRegionInfo().getEncodedName(), this .getColumnFamilyName());
  10. }
  11. this.memstore.add(cell, memstoreSizing);
  12. } finally {
  13. lock.readLock().unlock();
  14. currentParallelPutCount.decrementAndGet();
  15. }
  16. }

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

  1. /**
  2. * Adds the specified value to the memstore
  3. */
  4. public void add(final Iterable<Cell> cells, MemStoreSizing memstoreSizing) {
  5. lock.readLock().lock();
  6. try {
  7. if (this.currentParallelPutCount.getAndIncrement() > this.parallelPutCountPrintThreshold) {
  8. LOG.trace(this.getTableName() + "tableName={}, encodedName={}, columnFamilyName={} is " +
  9. "too busy!", this.getRegionInfo().getEncodedName(), this .getColumnFamilyName());
  10. }
  11. memstore.add(cells, memstoreSizing);
  12. } finally {
  13. lock.readLock().unlock();
  14. currentParallelPutCount.decrementAndGet();
  15. }
  16. }

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

  1. /**
  2. * Determines if Store should be split.
  3. */
  4. public Optional<byte[]> getSplitPoint() {
  5. this.lock.readLock().lock();
  6. try {
  7. // Should already be enforced by the split policy!
  8. assert !this.getRegionInfo().isMetaRegion();
  9. // Not split-able if we find a reference store file present in the store.
  10. if (hasReferences()) {
  11. LOG.trace("Not splittable; has references: {}", this);
  12. return Optional.empty();
  13. }
  14. return this.storeEngine.getStoreFileManager().getSplitPoint();
  15. } catch(IOException e) {
  16. LOG.warn("Failed getting store size for {}", this, e);
  17. } finally {
  18. this.lock.readLock().unlock();
  19. }
  20. return Optional.empty();
  21. }

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

  1. /**
  2. * Generate a name for throttling, to prevent name conflict when multiple IO operation running
  3. * parallel on the same store.
  4. * @param store the Store instance on which IO operation is happening
  5. * @param opName Name of the IO operation, e.g. "flush", "compaction", etc.
  6. * @return The name for throttling
  7. */
  8. public static String getNameForThrottling(HStore store, String opName) {
  9. int counter;
  10. for (;;) {
  11. counter = NAME_COUNTER.get();
  12. int next = counter == Integer.MAX_VALUE ? 0 : counter + 1;
  13. if (NAME_COUNTER.compareAndSet(counter, next)) {
  14. break;
  15. }
  16. }
  17. return store.getRegionInfo().getEncodedName() + NAME_DELIMITER +
  18. store.getColumnFamilyDescriptor().getNameAsString() + NAME_DELIMITER + opName +
  19. NAME_DELIMITER + counter;
  20. }
  21. }

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

  1. "Completed" + (cr.isMajor() ? " major" : "") + " compaction of "
  2. + cr.getFiles().size() + (cr.isAllFiles() ? " (all)" : "") + " file(s) in "
  3. + this + " of " + this.getRegionInfo().getShortNameToLog() + " into ");
  4. if (sfs.isEmpty()) {
  5. message.append("none, ");

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

  1. @VisibleForTesting
  2. void replaceStoreFiles(Collection<HStoreFile> compactedFiles, Collection<HStoreFile> result)
  3. throws IOException {
  4. this.lock.writeLock().lock();
  5. try {
  6. this.storeEngine.getStoreFileManager().addCompactionResults(compactedFiles, result);
  7. synchronized (filesCompacting) {
  8. filesCompacting.removeAll(compactedFiles);
  9. }
  10. // These may be null when the RS is shutting down. The space quota Chores will fix the Region
  11. // sizes later so it's not super-critical if we miss these.
  12. RegionServerServices rsServices = region.getRegionServerServices();
  13. if (rsServices != null && rsServices.getRegionServerSpaceQuotaManager() != null) {
  14. updateSpaceQuotaAfterFileReplacement(
  15. rsServices.getRegionServerSpaceQuotaManager().getRegionSizeStore(), getRegionInfo(),
  16. compactedFiles, result);
  17. }
  18. } finally {
  19. this.lock.writeLock().unlock();
  20. }
  21. }

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

  1. LOG.info("Refreshing store files for region " + this.getRegionInfo().getRegionNameAsString()
  2. + " files to add: " + toBeAddedFiles + " files to remove: " + toBeRemovedFiles);

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

  1. completeCompaction(delSfs);
  2. LOG.info("Completed removal of " + delSfs.size() + " unnecessary (expired) file(s) in "
  3. + this + " of " + this.getRegionInfo().getRegionNameAsString()
  4. + "; total size for store is "
  5. + TraditionalBinaryPrefix.long2String(storeSize.get(), "", 1));

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

  1. String regionInfo;
  2. if (this.storeConfigInfo != null && this.storeConfigInfo instanceof HStore) {
  3. regionInfo = ((HStore)this.storeConfigInfo).getRegionInfo().getRegionNameAsString();
  4. } else {
  5. regionInfo = this.toString();

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

  1. private StripeCompactor createCompactor() throws Exception {
  2. HColumnDescriptor col = new HColumnDescriptor(Bytes.toBytes("foo"));
  3. StoreFileWritersCapture writers = new StoreFileWritersCapture();
  4. HStore store = mock(HStore.class);
  5. HRegionInfo info = mock(HRegionInfo.class);
  6. when(info.getRegionNameAsString()).thenReturn("testRegion");
  7. when(store.getColumnFamilyDescriptor()).thenReturn(col);
  8. when(store.getRegionInfo()).thenReturn(info);
  9. when(
  10. store.createWriterInTmp(anyLong(), any(), anyBoolean(),
  11. anyBoolean(), anyBoolean(), anyBoolean())).thenAnswer(writers);
  12. Configuration conf = HBaseConfiguration.create();
  13. conf.setBoolean("hbase.regionserver.compaction.private.readers", usePrivateReaders);
  14. final Scanner scanner = new Scanner();
  15. return new StripeCompactor(conf, store) {
  16. @Override
  17. protected InternalScanner createScanner(HStore store, ScanInfo scanInfo,
  18. List<StoreFileScanner> scanners, long smallestReadPoint, long earliestPutTs,
  19. byte[] dropDeletesFromRow, byte[] dropDeletesToRow) throws IOException {
  20. return scanner;
  21. }
  22. @Override
  23. protected InternalScanner createScanner(HStore store, ScanInfo scanInfo,
  24. List<StoreFileScanner> scanners, ScanType scanType, long smallestReadPoint,
  25. long earliestPutTs) throws IOException {
  26. return scanner;
  27. }
  28. };
  29. }

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

  1. .addAndGet(storeFile.getReader().getTotalUncompressedBytes());
  2. if (LOG.isInfoEnabled()) {
  3. LOG.info("Region: " + HStore.this.getRegionInfo().getEncodedName() +
  4. " added " + storeFile + ", entries=" + storeFile.getReader().getEntries() +
  5. ", sequenceid=" + +storeFile.getReader().getSequenceID() + ", filesize="

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

  1. throughputController != null && !store.getRegionInfo().getTable().isSystemTable();
  2. if (control) {
  3. throughputController.start(flushName);

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

  1. try {
  2. LOG.info("Validating hfile at " + srcPath + " for inclusion in "
  3. + "store " + this + " region " + this.getRegionInfo().getRegionNameAsString());
  4. FileSystem srcFs = srcPath.getFileSystem(conf);
  5. srcFs.access(srcPath, FsAction.READ_WRITE);
  6. " last=" + Bytes.toStringBinary(lastKey));
  7. LOG.debug("Region bounds: first=" +
  8. Bytes.toStringBinary(getRegionInfo().getStartKey()) +
  9. " last=" + Bytes.toStringBinary(getRegionInfo().getEndKey()));
  10. if (!this.getRegionInfo().containsRange(firstKey.get(), lastKey)) {
  11. throw new WrongRegionException(
  12. "Bulk load file " + srcPath.toString() + " does not fit inside region "
  13. + this.getRegionInfo().getRegionNameAsString());

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

  1. when(store.areWritesEnabled()).thenReturn(true);
  2. when(store.getFileSystem()).thenReturn(mock(FileSystem.class));
  3. when(store.getRegionInfo()).thenReturn(new HRegionInfo(TABLE_NAME));
  4. when(store.createWriterInTmp(anyLong(), any(), anyBoolean(),
  5. anyBoolean(), anyBoolean(), anyBoolean())).thenAnswer(writers);

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

  1. when(store.areWritesEnabled()).thenReturn(true);
  2. when(store.getFileSystem()).thenReturn(mock(FileSystem.class));
  3. when(store.getRegionInfo()).thenReturn(new HRegionInfo(TABLE_NAME));
  4. when(store.createWriterInTmp(anyLong(), any(), anyBoolean(),
  5. anyBoolean(), anyBoolean(), anyBoolean())).thenAnswer(writers);

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

  1. request.setDescription(getRegionInfo().getRegionNameAsString(), getColumnFamilyName());
  2. request.setTracker(tracker);
  3. LOG.debug(getRegionInfo().getEncodedName() + " - " + getColumnFamilyName()
  4. + ": Initiating " + (request.isMajor() ? "major" : "minor") + " compaction"
  5. + (request.isAllFiles() ? " (all files)" : ""));

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

  1. long time = snapshot.getTimeRangeTracker().getMax();
  2. mobFileWriter = mobStore.createWriterInTmp(new Date(time), snapshot.getCellsCount(),
  3. store.getColumnFamilyDescriptor().getCompressionType(), store.getRegionInfo().getStartKey(), false);
  4. boolean hasMore;
  5. String flushName = ThroughputControlUtil.getNameForThrottling(store, "flush");
  6. boolean control = throughputController != null && !store.getRegionInfo().getTable().isSystemTable();
  7. if (control) {
  8. throughputController.start(flushName);

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

  1. if (!finished) {
  2. throw new InterruptedIOException("Aborting compaction of store " + store + " in region "
  3. + store.getRegionInfo().getRegionNameAsString() + " because it was interrupted.");

相关文章

HStore类方法