@ Override public void setEntryCounting ( boolean enable ) { if ( enable ) { if ( ! entryCountingEnable ) { // It was disable before but now it will be enable. // Therefore, we increase the entry count as size of records. cacheContext . increaseEntryCount ( size ( ) ) ; } } else { if ( entryCountingEnable ) { // It was enable before but now it will be disable. // Therefore, we decrease the entry count as size of records. cacheContext . decreaseEntryCount ( size ( ) ) ; } } this . entryCountingEnable = enable ; }
Called by only same partition thread . So there is no synchronization and visibility problem .