1 9 10 package com.sleepycat.je.log; 11 12 import com.sleepycat.je.DatabaseException; 13 import com.sleepycat.je.config.EnvironmentParams; 14 import com.sleepycat.je.dbi.EnvironmentImpl; 15 16 20 class CheckpointMonitor { 21 private int bytesWritten; 22 private long periodInBytes; 23 private EnvironmentImpl envImpl; 24 25 CheckpointMonitor(EnvironmentImpl envImpl) 26 throws DatabaseException { 27 28 bytesWritten = 0; 29 periodInBytes = envImpl.getConfigManager().getLong 30 (EnvironmentParams.CHECKPOINTER_BYTES_INTERVAL); 31 32 37 periodInBytes /= 10; 38 this.envImpl = envImpl; 39 } 40 41 47 boolean recordLogWrite(int entrySize, LoggableObject item) { 48 bytesWritten += entrySize; 49 return (bytesWritten >= periodInBytes); 50 } 51 52 56 void activate() { 57 envImpl.getCheckpointer().wakeup(); 58 bytesWritten = 0; 59 } 60 } 61 | Popular Tags |