protected synchronized void add ( ValueSet idSet , int bufferType , int cause , int source , boolean fromDepIdTemplateInvalidation , boolean fireEvent , boolean checkFull ) { final String methodName = "add(ValueSet)" ; if ( idSet == null || idSet . isEmpty ( ) ) { return ; } int size = idSet . size ( ) ; if ( bufferType == EXPLICIT_BUFFER ) { byte info = 0 ; if ( cause != 0 && source != 0 ) { info = ( byte ) cause ; if ( source == CachePerf . REMOTE ) { info = ( byte ) ( info | STATUS_REMOTE ) ; } if ( fromDepIdTemplateInvalidation ) { info = ( byte ) ( info | STATUS_FROM_DEPID_TEMPLATE ) ; } if ( fireEvent ) { info = ( byte ) ( info | STATUS_FIRE_EVENT ) ; } } Iterator it = idSet . iterator ( ) ; while ( it . hasNext ( ) ) { Object entryId = it . next ( ) ; this . explicitBuffer . put ( entryId , new Byte ( info ) ) ; } if ( ! this . scanBuffer . isEmpty ( ) ) { filter ( this . scanBuffer , idSet ) ; } } else if ( bufferType == SCAN_BUFFER ) { if ( ! explicitBuffer . isEmpty ( ) ) { filter ( idSet , this . explicitBuffer ) ; } this . scanBuffer . addAll ( idSet ) ; } else if ( bufferType == GC_BUFFER ) { this . garbageCollectorBuffer . addAll ( idSet ) ; } // if (size > 50) { traceDebug ( methodName , "cacheName=" + this . cod . cacheName + " idSet=" + size + " idSetFilter=" + idSet . size ( ) + " bufferType=" + bufferType + " explicitBuffer=" + this . explicitBuffer . size ( ) + " scanBuffer=" + this . scanBuffer . size ( ) + " GCBuffer=" + this . garbageCollectorBuffer . size ( ) ) ; // } if ( ( checkFull && isFull ( ) ) || bufferType == GC_BUFFER ) { // 3821 NK end invokeBackgroundInvalidation ( ! SCAN ) ; } }
Call this method to store a collection of cache ids in the one of invalidation buffers . The entries are going to remove from the disk using LPBT .