SimpleTimer.addPeriodicEvent(
"DHTDB:precious",
PRECIOUS_CHECK_INTERVAL/4,
true, // absolute, we don't want effective time changes (computer suspend/resume) to shift these
new TimerEventPerformer()
{
public void
perform(
TimerEvent event )
{
checkPreciousStuff();
}
});
}
SimpleTimer.addPeriodicEvent(
"DHTDB:op",
original_republish_interval,
true, // absolute, we don't want effective time changes (computer suspend/resume) to shift these
new TimerEventPerformer()
{
public void
perform(
TimerEvent event )
{
logger.log( "Republish of original mappings starts" );
long start = SystemTime.getCurrentTime();
int stats = republishOriginalMappings();
long end = SystemTime.getCurrentTime();
logger.log( "Republish of original mappings completed in " + (end-start) + ": " +
"values = " + stats );
}
});
// random skew here so that cache refresh isn't very synchronised, as the optimisations
// regarding non-republising benefit from this
SimpleTimer.addPeriodicEvent(
"DHTDB:cp",
cache_republish_interval + 10000 - (int)(Math.random()*20000),
true, // absolute, we don't want effective time changes (computer suspend/resume) to shift these
new TimerEventPerformer()
{
public void
perform(
TimerEvent event )
{
logger.log( "Republish of cached mappings starts" );
long start = SystemTime.getCurrentTime();
int[] stats = republishCachedMappings();
long end = SystemTime.getCurrentTime();
logger.log( "Republish of cached mappings completed in " + (end-start) + ": " +
"values = " + stats[0] + ", keys = " + stats[1] + ", ops = " + stats[2]);
if ( force_original_republish ){
force_original_republish = false;
logger.log( "Force republish of original mappings due to router change starts" );
start = SystemTime.getCurrentTime();
int stats2 = republishOriginalMappings();
end = SystemTime.getCurrentTime();
logger.log( "Force republish of original mappings due to router change completed in " + (end-start) + ": " +
"values = " + stats2 );
}
}
});
SimpleTimer.addPeriodicEvent(
"DHTDB:bloom",
IP_BLOOM_FILTER_REBUILD_PERIOD,
new TimerEventPerformer()
{
public void
perform(
TimerEvent event )
{
try{
this_mon.enter();
rebuildIPBloomFilter( false );
}finally{
this_mon.exit();
}
}
});
if ( survey_enabled ){
SimpleTimer.addPeriodicEvent(
"DHTDB:survey",
SURVEY_PERIOD,
true,
new TimerEventPerformer()
{
public void
perform(
TimerEvent event )
{