mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-136 HCOLL-137 HCOLL-153 HCOLL-160
1. Separated ChronicleMapBuilder (for non-Byteable values) and OffHeapUpdatableChronicleMapBuilder (for Byteable values) with common base AbstractChronicleMapBuilder (public just to inherit common javadocs) 2. Added ChronicleHashBuilder.keyDeserializationFactory() and AbstractChronicleMapBuilder.valueDeserializationFactory() (former ChronicleMapBuilder.valueFactory() method) 3. Changed ChronicleMap.get(), getUsing() API and impl to what was initially intended - now they ALWAYS returns null, if key is absent 4. acquireUsing() API, common for the cases with Byteable and non-Byteable values: puts defaultValue or defaultValueProvider.get(key), if the key is absent, then acquireUsing() behaves just like getUsing() 5. For off0heap updatable ChronicleMaps (Byteable values), added prepareValueBytes() configuration which formalizes zeroing out value bytes 6. Javadoc fixes and improvements
This commit is contained in:
@@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
|
||||
public class AcquireGetUsingMain {
|
||||
public static void main(String[] args) throws Exception {
|
||||
File file = new File(System.getProperty("java.io.tmpdir") + "/test1");
|
||||
ChronicleMap<String, Data> theSharedMap = ChronicleMapBuilder.of(String.class, Data.class).file(file).create();
|
||||
ChronicleMap<String, Data> theSharedMap = OffHeapUpdatableChronicleMapBuilder.of(String.class, Data.class).file(file).create();
|
||||
Data data = DataValueClasses.newDirectReference(Data.class);
|
||||
String processType = "testkey";
|
||||
if (theSharedMap.getUsing(processType, data) == null) {
|
||||
|
||||
Reference in New Issue
Block a user