public Object putIfAbsent(Data key, Object value, long ttl) {
checkIfLoaded();
final long now = getNow();
markRecordStoreExpirable(ttl);
Record record = getRecordOrNull(key, now, false);
Object oldValue;
if (record == null) {
oldValue = mapDataStore.load(key);
if (oldValue != null) {
record = createRecord(key, oldValue, now);
records.put(key, record);
updateSizeEstimator(calculateRecordHeapCost(record));
}
} else {
accessRecord(record, now);
oldValue = record.getValue();
}
if (oldValue == null) {
value = mapServiceContext.interceptPut(name, null, value);
value = mapDataStore.add(key, value, now);
onStore(record);