@Override protected void updateRecordValue(NearCacheObjectRecord<V> record, V value) { record.setValue(toValue(value)); } }
protected NearCacheRecordStore<K, V> createNearCacheRecordStore(String name, NearCacheConfig nearCacheConfig) { InMemoryFormat inMemoryFormat = nearCacheConfig.getInMemoryFormat(); if (inMemoryFormat == null) { inMemoryFormat = DEFAULT_MEMORY_FORMAT; } switch (inMemoryFormat) { case BINARY: return new NearCacheDataRecordStore<K, V>(name, nearCacheConfig, serializationService, classLoader); case OBJECT: return new NearCacheObjectRecordStore<K, V>(name, nearCacheConfig, serializationService, classLoader); default: throw new IllegalArgumentException("Invalid in memory format: " + inMemoryFormat); } }
protected NearCacheRecordStore<K, V> createNearCacheRecordStore(String name, NearCacheConfig nearCacheConfig) { InMemoryFormat inMemoryFormat = nearCacheConfig.getInMemoryFormat(); if (inMemoryFormat == null) { inMemoryFormat = DEFAULT_MEMORY_FORMAT; } switch (inMemoryFormat) { case BINARY: return new NearCacheDataRecordStore<K, V>(name, nearCacheConfig, serializationService, classLoader); case OBJECT: return new NearCacheObjectRecordStore<K, V>(name, nearCacheConfig, serializationService, classLoader); default: throw new IllegalArgumentException("Invalid in memory format: " + inMemoryFormat); } }
@Override protected void updateRecordValue(NearCacheObjectRecord<V> record, V value) { record.setValue(toValue(value)); }
@Override protected NearCacheObjectRecord<V> createRecord(V value) { value = toValue(value); long creationTime = currentTimeMillis(); if (timeToLiveMillis > 0) { return new NearCacheObjectRecord<V>(value, creationTime, creationTime + timeToLiveMillis); } else { return new NearCacheObjectRecord<V>(value, creationTime, TIME_NOT_SET); } }
@Override protected NearCacheObjectRecord<V> valueToRecord(V value) { value = toValue(value); long creationTime = currentTimeMillis(); if (timeToLiveMillis > 0) { return new NearCacheObjectRecord<V>(value, creationTime, creationTime + timeToLiveMillis); } else { return new NearCacheObjectRecord<V>(value, creationTime, TIME_NOT_SET); } }