public R createRecordWithExpiry(Data key, Object value, ExpiryPolicy expiryPolicy,
long now, boolean disableWriteThrough) {
expiryPolicy = getExpiryPolicy(expiryPolicy);
Duration expiryDuration;
try {
expiryDuration = expiryPolicy.getExpiryForCreation();
} catch (Exception e) {
expiryDuration = Duration.ETERNAL;
}
long expiryTime = expiryDuration.getAdjustedTime(now);
if (!disableWriteThrough) {
writeThroughCache(key, value);
}