@ SuppressWarnings ( "unchecked" ) private static synchronized Map < String , Boolean > getCache ( GraphRewrite event ) { Map < String , Boolean > result = ( Map < String , Boolean > ) event . getRewriteContext ( ) . get ( ClassificationServiceCache . class ) ; if ( result == null ) { result = Collections . synchronizedMap ( new LRUMap ( 30000 ) ) ; event . getRewriteContext ( ) . put ( ClassificationServiceCache . class , result ) ; } return result ; }
Keep a cache of items files associated with classification in order to improve performance .