public void putHeader( long logVersion, long previousLogLastCommittedTx ) { logHeaderCache.put( logVersion, previousLogLastCommittedTx ); }
private void addToCache( Collection<EntityId> ids, 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 ) { cache.put( valueAsString, ids ); } }
public TransactionMetadata cacheTransactionMetadata( long txId, LogPosition position, int masterId, int authorId, long checksum, long timeWritten ) { if ( position.getByteOffset() == -1 ) { throw new RuntimeException( "StartEntry.position is " + position ); } TransactionMetadata result = new TransactionMetadata( masterId, authorId, position, checksum, timeWritten ); txStartPositionCache.put( txId, result ); return result; }
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 shouldThrowWhenPuttingEntryWithNullKey() { assertThrows( IllegalArgumentException.class, () -> new LruCache<>( "TestCache", 70 ).put( null, new Object() ) ); }
@Test void shouldThrowWhenPuttingEntryWithNullValue() { assertThrows( IllegalArgumentException.class, () -> new LruCache<>( "TestCache", 70 ).put( new Object(), null ) ); }
mMemoryCache.put(key, bitmap);
public void putHeader( long logVersion, long previousLogLastCommittedTx ) { logHeaderCache.put( logVersion, previousLogLastCommittedTx ); }
public RaftLogEntryMetadata cacheMetadata( long logIndex, long entryTerm, LogPosition position ) { RaftLogEntryMetadata result = new RaftLogEntryMetadata( entryTerm, position ); raftLogEntryCache.put( logIndex, result ); return result; }
public RaftLogEntryMetadata cacheMetadata( long logIndex, long entryTerm, LogPosition position ) { RaftLogEntryMetadata result = new RaftLogEntryMetadata( entryTerm, position ); raftLogEntryCache.put( logIndex, result ); return result; }
public TransactionMetadata cacheTransactionMetadata( long txId, LogPosition position, int masterId, int authorId, long checksum, long timeWritten ) { if ( position.getByteOffset() == -1 ) { throw new RuntimeException( "StartEntry.position is " + position ); } TransactionMetadata result = new TransactionMetadata( masterId, authorId, position, checksum, timeWritten ); txStartPositionCache.put( txId, result ); return result; }
@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; }
mMemoryCache.put(key, bitmap);