public int add ( Object dependency , ValueSet valueSet , Object entry ) { int returnCode = HTODDynacache . NO_EXCEPTION ; dependencyNotUpdatedTable . remove ( dependency ) ; valueSet . add ( entry ) ; if ( valueSet . size ( ) > this . delayOffloadEntriesLimit ) { if ( this . type == DEP_ID_TABLE ) { returnCode = this . htod . writeValueSet ( HTODDynacache . DEP_ID_DATA , dependency , valueSet , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . depIdsOffloadedToDisk ( dependency ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "***** add dependency id=" + dependency + " size=" + valueSet . size ( ) ) ; } else { returnCode = this . htod . writeValueSet ( HTODDynacache . TEMPLATE_ID_DATA , dependency , valueSet , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . templatesOffloadedToDisk ( dependency ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "***** add dependency id=" + dependency + " size=" + valueSet . size ( ) ) ; } dependencyToEntryTable . remove ( dependency ) ; if ( returnCode == HTODDynacache . DISK_SIZE_OVER_LIMIT_EXCEPTION && valueSet . size ( ) > 0 ) { this . htod . delCacheEntry ( valueSet , CachePerf . DISK_OVERFLOW , CachePerf . LOCAL , ! Cache . FROM_DEPID_TEMPLATE_INVALIDATION , HTODInvalidationBuffer . FIRE_EVENT ) ; returnCode = HTODDynacache . NO_EXCEPTION ; } } return returnCode ; }
This adds a entry to the ValueSet for the specified dependency . The dependency is found in the dependencyToEntryTable .