Java 类org.apache.hadoop.hbase.util.Counter 实例源码

项目:PyroDB    文件:ExactCounterMetric.java   
public List<Pair<String, Long>> getTop(int n) {
  final List<Pair<String, Long>> countsSnapshot = 
      Lists.newArrayListWithCapacity(this.counts.size());

  // no updates are allowed while I'm holding this lock, so move fast
  this.lock.writeLock().lock();
  try {
    for(Entry<String, Counter> entry : this.counts.entrySet()) {
      countsSnapshot.add(Pair.newPair(entry.getKey(), 
          entry.getValue().get()));
    }
  } finally {
    this.lock.writeLock().unlock();
  }

  Collections.sort(countsSnapshot, new Comparator<Pair<String, Long>>() {
    @Override
    public int compare(Pair<String, Long> a, Pair<String, Long> b) {
      return b.getSecond().compareTo(a.getSecond());
    }      
  });

  return countsSnapshot.subList(0, Math.min(n, countsSnapshot.size()));
}
项目:ditb    文件:MemStoreFlusher.java   
public Counter getUpdatesBlockedMsHighWater() {
  return this.updatesBlockedMsHighWater;
}
项目:pbase    文件:MemStoreFlusher.java   
public Counter getUpdatesBlockedMsHighWater() {
  return this.updatesBlockedMsHighWater;
}
项目:PyroDB    文件:MemStoreFlusher.java   
public Counter getUpdatesBlockedMsHighWater() {
  return this.updatesBlockedMsHighWater;
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateWriteRequests(HRegion region, long numWrites) {
    Counter writeRequestsCount = region.writeRequestsCount;
    if (writeRequestsCount != null)
        writeRequestsCount.add(numWrites);
}
项目:spliceengine    文件:HBasePlatformUtils.java   
public static void updateReadRequests(HRegion region, long numReads) {
    Counter readRequestsCount = region.readRequestsCount;
    if (readRequestsCount != null)
        readRequestsCount.add(numReads);
}