use of com.hazelcast.map.impl.record.DataRecordFactory in project hazelcast by hazelcast.
the class LazyEntryViewFromRecordTest method createDefaultEntryView.
/**
* Returns an entry-view instance populated with default values of fields.
*/
private EntryView createDefaultEntryView() {
PartitioningStrategy mockPartitioningStrategy = mock(PartitioningStrategy.class);
MapConfig mapConfig = new MapConfig();
serializationService = new DefaultSerializationServiceBuilder().build();
DataRecordFactory dataRecordFactory = new DataRecordFactory(mapConfig, serializationService, mockPartitioningStrategy);
recordInstance = dataRecordFactory.newRecord(value);
((AbstractRecord) recordInstance).setKey(serializationService.toData(key));
return new LazyEntryViewFromRecord(recordInstance, serializationService);
}
use of com.hazelcast.map.impl.record.DataRecordFactory in project hazelcast by hazelcast.
the class LazyEvictableEntryViewTest method createLazyEvictableEntryView.
/**
* Returns an entry-view instance populated with default values of fields.
*/
private LazyEvictableEntryView createLazyEvictableEntryView() {
MapConfig mapConfig = new MapConfig();
mapConfig.setPerEntryStatsEnabled(true);
SerializationService serializationService = new DefaultSerializationServiceBuilder().build();
MapContainer mapContainer = mock(MapContainer.class);
when(mapContainer.getMapConfig()).thenReturn(mapConfig);
DataRecordFactory recordFactory = new DataRecordFactory(mapContainer, serializationService);
Data key = serializationService.toData(this.key);
recordInstance = recordFactory.newRecord(key, value);
return new LazyEvictableEntryView(key, recordInstance, ExpiryMetadata.NULL, serializationService);
}
Aggregations