public Long getLogHeader( long logVersion ) { return logHeaderCache.get( logVersion ); } }
public TransactionMetadata getTransactionMetadata( long txId ) { return txStartPositionCache.get( txId ); }
private void removeFromCache( long entityId, String key, Object value ) { if ( this.cache == null ) { return; } String valueAsString = value.toString(); LruCache<String, Collection<EntityId>> cache = this.cache.get( key ); if ( cache != null ) { Collection<EntityId> ids = cache.get( valueAsString ); if ( ids != null ) { ids.remove( new EntityId.IdData( entityId ) ); } } }
private ExplicitIndexHits getFromCache( String key, Object value ) { if ( this.cache == null ) { return null; } String valueAsString = value.toString(); LruCache<String, Collection<EntityId>> cache = this.cache.get( key ); if ( cache != null ) { Collection<EntityId> ids = cache.get( valueAsString ); if ( ids != null ) { return new ConstantScoreIterator( ids, Float.NaN ); } } return null; }
private void addToCache( long entityId, String key, Object value ) { if ( this.cache == null ) { return; } String valueAsString = value.toString(); LruCache<String, Collection<EntityId>> cache = this.cache.get( key ); if ( cache != null ) { Collection<EntityId> ids = cache.get( valueAsString ); if ( ids == null ) { ids = new HashSet<>(); cache.put( valueAsString, ids ); } ids.add( new EntityId.IdData( entityId ) ); } }
@Override public boolean check( TraversalBranch branch ) { long id = type.getId( branch ); boolean add = recentlyVisited.get( id ) == null; if ( add ) { recentlyVisited.put( id, PLACE_HOLDER ); } return add; }
@Test void shouldThrowWhenGettingWithANullKey() { assertThrows( IllegalArgumentException.class, () -> new LruCache<>( "TestCache", 70 ).get( null ) ); }
cache.put( key2, s2 ); cache.put( key3, s3 ); cache.get( key2 );
cache.put( key2, s2 ); cache.put( key3, s3 ); cache.get( key2 );
return mMemoryCache.get(key);
public Long getLogHeader( long logVersion ) { return logHeaderCache.get( logVersion ); } }
/** * Returns the metadata for the entry at position {@param logIndex}, null if the metadata is not present in the cache */ public RaftLogEntryMetadata getMetadata( long logIndex ) { return raftLogEntryCache.get( logIndex ); }
/** * Returns the metadata for the entry at position {@param logIndex}, null if the metadata is not present in the cache */ public RaftLogEntryMetadata getMetadata( long logIndex ) { return raftLogEntryCache.get( logIndex ); }
public TransactionMetadata getTransactionMetadata( long txId ) { return txStartPositionCache.get( txId ); }
@Override public boolean check( TraversalBranch branch ) { long id = type.getId( branch ); boolean add = recentlyVisited.get( id ) == null; if ( add ) { recentlyVisited.put( id, PLACE_HOLDER ); } return add; }
return mMemoryCache.get(key);