Java 类org.apache.hadoop.hbase.regionserver.HeapMemoryManager.TunerResult 实例源码

项目:ditb    文件:TestHeapMemoryManager.java   
@Override
public TunerResult tune(TunerContext context) {
  TunerResult result = new TunerResult(true);
  result.setBlockCacheSize(blockCacheSize);
  result.setMemstoreSize(memstoreSize);
  return result;
}
项目:pbase    文件:DefaultHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  long blockedFlushCount = context.getBlockedFlushCount();
  long unblockedFlushCount = context.getUnblockedFlushCount();
  long evictCount = context.getEvictCount();
  boolean memstoreSufficient = blockedFlushCount == 0 && unblockedFlushCount == 0;
  boolean blockCacheSufficient = evictCount == 0;
  if (memstoreSufficient && blockCacheSufficient) {
    return NO_OP_TUNER_RESULT;
  }
  float newMemstoreSize;
  float newBlockCacheSize;
  if (memstoreSufficient) {
    // Increase the block cache size and corresponding decrease in memstore size
    newBlockCacheSize = context.getCurBlockCacheSize() + step;
    newMemstoreSize = context.getCurMemStoreSize() - step;
  } else if (blockCacheSufficient) {
    // Increase the memstore size and corresponding decrease in block cache size
    newBlockCacheSize = context.getCurBlockCacheSize() - step;
    newMemstoreSize = context.getCurMemStoreSize() + step;
  } else {
    return NO_OP_TUNER_RESULT;
    // As of now not making any tuning in write/read heavy scenario.
  }
  if (newMemstoreSize > globalMemStorePercentMaxRange) {
    newMemstoreSize = globalMemStorePercentMaxRange;
  } else if (newMemstoreSize < globalMemStorePercentMinRange) {
    newMemstoreSize = globalMemStorePercentMinRange;
  }
  if (newBlockCacheSize > blockCachePercentMaxRange) {
    newBlockCacheSize = blockCachePercentMaxRange;
  } else if (newBlockCacheSize < blockCachePercentMinRange) {
    newBlockCacheSize = blockCachePercentMinRange;
  }
  TUNER_RESULT.setBlockCacheSize(newBlockCacheSize);
  TUNER_RESULT.setMemstoreSize(newMemstoreSize);
  return TUNER_RESULT;
}
项目:pbase    文件:TestHeapMemoryManager.java   
@Override
public TunerResult tune(TunerContext context) {
  TunerResult result = new TunerResult(true);
  result.setBlockCacheSize(blockCacheSize);
  result.setMemstoreSize(memstoreSize);
  return result;
}
项目:hbase    文件:TestHeapMemoryManager.java   
@Override
public TunerResult tune(TunerContext context) {
  TunerResult result = new TunerResult(true);
  result.setBlockCacheSize(blockCacheSize);
  result.setMemStoreSize(memstoreSize);
  return result;
}
项目:PyroDB    文件:DefaultHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  long blockedFlushCount = context.getBlockedFlushCount();
  long unblockedFlushCount = context.getUnblockedFlushCount();
  long evictCount = context.getEvictCount();
  boolean memstoreSufficient = blockedFlushCount == 0 && unblockedFlushCount == 0;
  boolean blockCacheSufficient = evictCount == 0;
  if (memstoreSufficient && blockCacheSufficient) {
    return NO_OP_TUNER_RESULT;
  }
  float newMemstoreSize;
  float newBlockCacheSize;
  if (memstoreSufficient) {
    // Increase the block cache size and corresponding decrease in memstore size
    newBlockCacheSize = context.getCurBlockCacheSize() + step;
    newMemstoreSize = context.getCurMemStoreSize() - step;
  } else if (blockCacheSufficient) {
    // Increase the memstore size and corresponding decrease in block cache size
    newBlockCacheSize = context.getCurBlockCacheSize() - step;
    newMemstoreSize = context.getCurMemStoreSize() + step;
  } else {
    return NO_OP_TUNER_RESULT;
    // As of now not making any tuning in write/read heavy scenario.
  }
  if (newMemstoreSize > globalMemStorePercentMaxRange) {
    newMemstoreSize = globalMemStorePercentMaxRange;
  } else if (newMemstoreSize < globalMemStorePercentMinRange) {
    newMemstoreSize = globalMemStorePercentMinRange;
  }
  if (newBlockCacheSize > blockCachePercentMaxRange) {
    newBlockCacheSize = blockCachePercentMaxRange;
  } else if (newBlockCacheSize < blockCachePercentMinRange) {
    newBlockCacheSize = blockCachePercentMinRange;
  }
  TUNER_RESULT.setBlockCacheSize(newBlockCacheSize);
  TUNER_RESULT.setMemstoreSize(newMemstoreSize);
  return TUNER_RESULT;
}
项目:PyroDB    文件:TestHeapMemoryManager.java   
@Override
public TunerResult tune(TunerContext context) {
  TunerResult result = new TunerResult(true);
  result.setBlockCacheSize(blockCacheSize);
  result.setMemstoreSize(memstoreSize);
  return result;
}
项目:ditb    文件:NoOpHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  return NO_OP_TUNER_RESULT;
}
项目:pbase    文件:NoOpHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  return NO_OP_TUNER_RESULT;
}
项目:hbase    文件:NoOpHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  return NO_OP_TUNER_RESULT;
}
项目:PyroDB    文件:NoOpHeapMemoryTuner.java   
@Override
public TunerResult tune(TunerContext context) {
  return NO_OP_TUNER_RESULT;
}
项目:ditb    文件:HeapMemoryTuner.java   
/**
 * Perform the heap memory tuning operation.
 *
 * @param context
 * @return <code>TunerResult</code> including the heap percentage for memstore and block cache
 */
TunerResult tune(TunerContext context);
项目:pbase    文件:HeapMemoryTuner.java   
/**
 * Perform the heap memory tuning operation.
 *
 * @param context
 * @return <code>TunerResult</code> including the heap percentage for memstore and block cache
 */
TunerResult tune(TunerContext context);
项目:hbase    文件:HeapMemoryTuner.java   
/**
 * Perform the heap memory tuning operation.
 *
 * @param context
 * @return <code>TunerResult</code> including the heap percentage for memstore and block cache
 */
TunerResult tune(TunerContext context);
项目:PyroDB    文件:HeapMemoryTuner.java   
/**
 * Perform the heap memory tuning operation.
 * 
 * @param context
 * @return <code>TunerResult</code> including the heap percentage for memstore and block cache
 */
TunerResult tune(TunerContext context);