/** Get and clear the current count of reprobes. Reprobes happen on key * collisions, and a high reprobe rate may indicate a poor hash function or * weaknesses in the table resizing function. * @return the count of reprobes since the last call to {@link #reprobes} * or since the table was created. */ public long reprobes() { long r = _reprobes.get(); _reprobes = new Counter(); return r; }
public void update(String type, long count) { this.lock.readLock().lock(); try { this.counts.get(type).add(count); } finally { this.lock.readLock().unlock(); } }
private final boolean tableFull( int reprobe_cnt, int len ) { return // Do the cheap check first: we allow some number of reprobes always reprobe_cnt >= REPROBE_LIMIT && // More expensive check: see if the table is > 1/4 full. _slots.estimate_get() >= reprobe_limit(len); }
CHM( final NonBlockingHashMapLong nbhml, Counter size, final int logsize ) { _nbhml = nbhml; _size = size; _slots= new Counter(); _keys = new long [1<<logsize]; _vals = new Object[1<<logsize]; }
/** @return readRequestsCount for this region */ public long getReadRequestsCount() { return this.readRequestsCount.get(); }
public void update(String type) { this.lock.readLock().lock(); try { this.counts.get(type).increment(); } finally { this.lock.readLock().unlock(); } }
/** * @param egi * Spec. for daughter entityGroup to open. * @return Created daughter EntityGroup. * @throws java.io.IOException */ EntityGroup createDaughterEntityGroup(final EntityGroupInfo egi, final FServerServices rsServices) throws IOException { // Package private so unit tests have access. EntityGroup entityGroup = EntityGroup.newEntityGroup(this.parent.getConf(), egi, this.parent.getTableDesc(), rsServices); entityGroup.readRequestsCount.set(this.parent.getReadRequestsCount() / 2); entityGroup.writeRequestsCount.set(this.parent.getWriteRequestsCount() / 2); return entityGroup; }
@Override public synchronized boolean next(List<KeyValue> outResults, int limit, String metric) throws IOException { if (this.filterClosed) { throw new UnknownScannerException("Scanner was closed (timed out?) " + "after we renewed it. Could be caused by a very slow scanner " + "or a lengthy garbage collection"); } startRegionOperation(); readRequestsCount.increment(); opMetrics.setReadRequestCountMetrics(readRequestsCount.get()); try { // This could be a new thread from the last time we called next(). MultiVersionConsistencyControl.setThreadReadPoint(this.readPt); return nextRaw(outResults, limit, metric); } finally { closeRegionOperation(); } }
CHM( final NonBlockingHashMapLong nbhml, Counter size, final int logsize ) { _nbhml = nbhml; _size = size; _slots= new Counter(); _keys = new long [1<<logsize]; _vals = new Object[1<<logsize]; }
/** @return writeRequestsCount for this region */ public long getWriteRequestsCount() { return this.writeRequestsCount.get(); }
long totalReadRequestCount = a.readRequestsCount.get() + b.readRequestsCount.get(); dstRegion.readRequestsCount.set(totalReadRequestCount); dstRegion.opMetrics.setReadRequestCountMetrics(totalReadRequestCount); long totalWriteRequestCount = a.writeRequestsCount.get() + b.writeRequestsCount.get(); dstRegion.writeRequestsCount.set(totalWriteRequestCount); dstRegion.opMetrics.setWriteRequestCountMetrics(totalWriteRequestCount);
/** * Return an iterator that scans over the EntityGroup, returning the indicated * columns and rows specified by the * * <p> * This Iterator must be closed by the caller. * * @param action * @return * @throws java.io.IOException * @throws com.alibaba.wasp.storage.StorageTableNotFoundException */ public EntityGroupScanner getScanner(ScanAction action) throws IOException, StorageTableNotFoundException { startEntityGroupOperation(); readRequestsCount.increment(); try { return instantiateEntityGroupScanner(action); } finally { closeEntityGroupOperation(); } }
/** * @param hri Spec. for daughter region to open. * @param flusher Flusher this region should use. * @return Created daughter HRegion. * @throws IOException * @see #cleanupDaughterRegion(FileSystem, Path, HRegionInfo) */ HRegion createDaughterRegion(final HRegionInfo hri, final RegionServerServices rsServices) throws IOException { // Package private so unit tests have access. FileSystem fs = this.parent.getFilesystem(); Path regionDir = getSplitDirForDaughter(this.parent.getFilesystem(), this.splitdir, hri); HRegion r = HRegion.newHRegion(this.parent.getTableDir(), this.parent.getLog(), fs, this.parent.getConf(), hri, this.parent.getTableDesc(), rsServices); long halfParentReadRequestCount = this.parent.getReadRequestsCount() / 2; r.readRequestsCount.set(halfParentReadRequestCount); r.setOpMetricsReadRequestCount(halfParentReadRequestCount); long halfParentWriteRequest = this.parent.getWriteRequestsCount() / 2; r.writeRequestsCount.set(halfParentWriteRequest); r.setOpMetricsWriteRequestCount(halfParentWriteRequest); HRegion.moveInitialFilesIntoPlace(fs, regionDir, r.getRegionDir()); return r; }
/** Get and clear the current count of reprobes. Reprobes happen on key * collisions, and a high reprobe rate may indicate a poor hash function or * weaknesses in the table resizing function. * @return the count of reprobes since the last call to {@link #reprobes} * or since the table was created. */ public long reprobes() { long r = _reprobes.get(); _reprobes = new Counter(); return r; }
protected RegionScanner getScanner(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException { startRegionOperation(); this.readRequestsCount.increment(); this.opMetrics.setReadRequestCountMetrics(this.readRequestsCount.get()); try { // Verify families are all valid prepareScanner(scan); if(scan.hasFamilies()) { for(byte [] family : scan.getFamilyMap().keySet()) { checkFamily(family); } } return instantiateRegionScanner(scan, additionalScanners); } finally { closeRegionOperation(); } }