@Override public TunerResult tune(TunerContext context) { TunerResult result = new TunerResult(true); result.setBlockCacheSize(blockCacheSize); result.setMemstoreSize(memstoreSize); return result; }
@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; }
@Override public TunerResult tune(TunerContext context) { TunerResult result = new TunerResult(true); result.setBlockCacheSize(blockCacheSize); result.setMemStoreSize(memstoreSize); return result; }
@Override public TunerResult tune(TunerContext context) { return NO_OP_TUNER_RESULT; }
/** * 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);