public boolean apply(@Nullable final Entry<String, MutableStorageRecord> entry) { Long exp = entry.getValue().getExpiration(); return exp != null && exp <= expiration; } }
/** {@inheritDoc} */ @Column(name="version", nullable = false) @Override public long getVersion() { return super.getVersion(); }
/** {@inheritDoc} */ @Lob @Column(name="value", nullable = false) @Nonnull @Override public String getValue() { return super.getValue(); }
return null; } else { Long exp = record.getExpiration(); if (exp != null && System.currentTimeMillis() >= exp) { log.debug("Update failed, key '{}' expired in context '{}'", key, context); if (version != null && version != record.getVersion()) { record.setValue(value); record.incrementVersion(); record.setExpiration(expiration); return record.getVersion();
for (Map.Entry<String,MutableStorageRecord> entry : context.getValue().entrySet()) { final MutableStorageRecord record = entry.getValue(); final Long recexp = record.getExpiration(); if (recexp == null || recexp > now) { empty = false; gen.writeStartObject(entry.getKey()) .write("v", record.getValue()); if (recexp != null) { gen.write("x", record.getExpiration()); exp = Math.max(exp, recexp);
Long now = System.currentTimeMillis(); for (MutableStorageRecord record : dataMap.values()) { final Long exp = record.getExpiration(); if (exp == null || now < exp) { record.setExpiration(expiration);
dataMap.put(key, new MutableStorageRecord(value, expiration)); log.trace("Inserted record '{}' in context '{}' with expiration '{}'", new Object[] { key, context, expiration });
/** * Resets the version of this storage record to 1. */ public void resetVersion() { super.setVersion(1); }
for (final Map.Entry<String,MutableStorageRecord> entry : context.getValue().entrySet()) { final MutableStorageRecord record = entry.getValue(); final Long recexp = record.getExpiration(); if (recexp == null || recexp > now) { empty = false; gen.writeStartObject(entry.getKey()) .write("v", record.getValue()); if (recexp != null) { gen.write("x", record.getExpiration()); exp = Math.max(exp, recexp);
dataMap.put(record.getKey(), new MutableStorageRecord(fields.getString("v"), exp));
/** {@inheritDoc} */ @Column(name="expires", nullable = true) @Nullable @Override public Long getExpiration() { return super.getExpiration(); }
log.debug("Deleting record '{}' in context '{}'....key not found", key, context); return false; } else if (version != null && record.getVersion() != version) { throw new VersionMismatchException(); } else {