@Override public void writeBatch(Map<Object, RecoveredEntry> entries) throws IOException { for (Map.Entry<Object, RecoveredEntry> re: entries.entrySet()) { Object key = re.getKey(); // TODO:KIRK:OK Rusty's code was value =de.getValueWithContext(drv); Object value = re.getValue().getValue(); //if (!Token.isInvalidOrRemoved(value)) { theWriter.snapshotEntry(key, value, re.getValue().getVersionTag(), re.getValue().getLastModifiedTime()); //} } } }));
long oldKeyId = did.getKeyId(); long oldOplogId = did.getOplogId(); long newOplogId = re.getOplogId(); if (newOplogId != oldOplogId) { did.setOplogId(newOplogId); re.setOplogId(oldOplogId); // so caller knows oldoplog id did.setOffsetInOplog(re.getOffsetInOplog()); did.setUserBits(re.getUserBits()); oldValueLength = did.getValueLength(); did.setValueLength(re.getValueLength()); if (re.getRecoveredKeyId() < 0) { if (!entry.isValueNull()) { try { did.getValueLength()); } else { entry.setValueWithContext(region, entry.prepareValueForCache(region, re.getValue(), false, false)); dr.incNumEntriesInVM(1L); incrementBucketStats(region, 1/*InVM*/, 0/*OnDisk*/, 0);
long oldKeyId = did.getKeyId(); long oldOplogId = did.getOplogId(); long newOplogId = re.getOplogId(); if (newOplogId != oldOplogId) { did.setOplogId(newOplogId); re.setOplogId(oldOplogId); // so caller knows oldoplog id did.setOffsetInOplog(re.getOffsetInOplog()); did.setUserBits(re.getUserBits()); oldValueLength = did.getValueLength(); did.setValueLength(re.getValueLength()); if (re.getRecoveredKeyId() < 0) { if (!entry.isValueNull()) { try { did.getValueLength()); } else { entry.setValueWithContext(region, entry.prepareValueForCache(region, re.getValue(), false)); dr.incNumEntriesInVM(1L); incrementBucketStats(region, 1/*InVM*/, 0/*OnDisk*/, 0);
@Retained RegionEntry newRe = getEntryFactory().createEntry((RegionEntryContext) _getOwnerObject(), key, value); synchronized (newRe) { if (value.getVersionTag()!=null && newRe.getVersionStamp()!=null) { newRe.getVersionStamp().setVersions(value.getVersionTag()); long lastModifiedTime = value.getLastModifiedTime(); if (lastModifiedTime != 0) { newRe.setLastModified(lastModifiedTime);
@Retained RegionEntry newRe = getEntryFactory().createEntry((RegionEntryContext) _getOwnerObject(), key, value); synchronized (newRe) { if (value.getVersionTag()!=null && newRe.getVersionStamp()!=null) { newRe.getVersionStamp().setVersions(value.getVersionTag());
return null; if (value.getVersionTag()!=null && re.getVersionStamp()!=null) { re.getVersionStamp().setVersions(value.getVersionTag()); long lastModifiedTime = value.getLastModifiedTime(); if (lastModifiedTime != 0) { re.setLastModified(lastModifiedTime);
re = new DiskEntry.RecoveredEntry(oplogKeyId, oplogId, offsetInOplog, userBits, valueLength, value); re = new DiskEntry.RecoveredEntry(oplogKeyId, oplogId, offsetInOplog, userBits, valueLength);
long newOplogId = newValue.getOplogId(); if (newOplogId != oldOplogId) { did.setOplogId(newOplogId); newValue.setOplogId(oldOplogId); // so caller knows oldoplog id did.setOffsetInOplog(newValue.getOffsetInOplog()); did.setUserBits(newValue.getUserBits()); did.setValueLength(newValue.getValueLength()); if (newValue.getRecoveredKeyId() >= 0) { entry.setValueWithContext(context, entry.prepareValueForCache(drv, newValue.getValue(), false)); } else {
did.setOplogId(re.getOplogId()); did.setOffsetInOplog(re.getOffsetInOplog()); did.setKeyId(re.getRecoveredKeyId()); did.setUserBits(re.getUserBits()); did.setValueLength(re.getValueLength()); if (re.getRecoveredKeyId() < 0) { drv.incNumOverflowOnDisk(1L); drv.incNumOverflowBytesOnDisk(did.getValueLength()); re.getValue(), false)); drv.incNumEntriesInVM(1L); incrementBucketStats(r, 1/*InVM*/, 0/*OnDisk*/, 0);
return null; if (value.getVersionTag()!=null && re.getVersionStamp()!=null) { re.getVersionStamp().setVersions(value.getVersionTag());
did.setOplogId(re.getOplogId()); did.setOffsetInOplog(re.getOffsetInOplog()); did.setKeyId(re.getRecoveredKeyId()); did.setUserBits(re.getUserBits()); did.setValueLength(re.getValueLength()); if (re.getRecoveredKeyId() < 0) { drv.incNumOverflowOnDisk(1L); incrementBucketStats(r, 0/*InVM*/, 1/*OnDisk*/, did.getValueLength()); RegionEntryContext context = (RegionEntryContext)r; entry.setValueWithContext(context, entry.prepareValueForCache(context, re.getValue(), false, false)); drv.incNumEntriesInVM(1L); incrementBucketStats(r, 1/*InVM*/, 0/*OnDisk*/, 0);
long newOplogId = newValue.getOplogId(); if (newOplogId != oldOplogId) { did.setOplogId(newOplogId); newValue.setOplogId(oldOplogId); // so caller knows oldoplog id did.setOffsetInOplog(newValue.getOffsetInOplog()); did.setUserBits(newValue.getUserBits()); did.setValueLength(newValue.getValueLength()); if (newValue.getRecoveredKeyId() >= 0) { entry.setValueWithContext(context, entry.prepareValueForCache(drv, newValue.getValue(), false, false)); } else {
/** * TODO soplog - This method is public just to test soplog recovery */ public DiskEntry.RecoveredEntry createRecoveredEntry(byte[] valueBytes, int valueLength, byte userBits, long oplogId, long offsetInOplog, long oplogKeyId, boolean recoverValue, Version version, ByteArrayDataInput in) { DiskEntry.RecoveredEntry re = null; if (recoverValue || EntryBits.isAnyInvalid(userBits) || EntryBits.isTombstone(userBits)) { Object value; if (EntryBits.isLocalInvalid(userBits)) { value = Token.LOCAL_INVALID; valueLength = 0; } else if (EntryBits.isInvalid(userBits)) { value = Token.INVALID; valueLength = 0; } else if (EntryBits.isSerialized(userBits)) { value = DiskEntry.Helper.readSerializedValue(valueBytes, version, in, false); } else if (EntryBits.isTombstone(userBits)) { value = Token.TOMBSTONE; } else { value = valueBytes; } re = new DiskEntry.RecoveredEntry(oplogKeyId, oplogId, offsetInOplog, userBits, valueLength, value); } else { re = new DiskEntry.RecoveredEntry(oplogKeyId, oplogId, offsetInOplog, userBits, valueLength); } return re; }
/** * The oplogId in re points to the oldOplogId. "this" oplog is the current * oplog. */ private void updateRecoveredEntry(DiskRegionView drv, DiskEntry de, DiskEntry.RecoveredEntry re) { if (getOplogId() != re.getOplogId()) { Oplog oldOplog = getOplogSet().getChild(re.getOplogId()); oldOplog.rmLive(drv, de); initRecoveredEntry(drv, de); } else { getDRI(drv).update(de); } }
/** * The oplogId in re points to the oldOplogId. * "this" oplog is the current oplog. */ private void updateRecoveredEntry(DiskRegionView drv, DiskEntry de, DiskEntry.RecoveredEntry re) { if (getOplogId() != re.getOplogId()) { Oplog oldOplog = getOplogSet().getChild(re.getOplogId()); oldOplog.rmLive(drv, de); initRecoveredEntry(drv, de); } else { getDRI(drv).update(de); } }
public static void logRecovery(Object owner, Object key, RecoveredEntry value) { if(isEnabled()) { GRAPH_LOGGER.logTransition(GraphType.KEY, getGraphNameFromOwner(owner, key), "recovery", processValue(value.getValue()), getSource(), getDest()); } }
public static void logRecovery(Object owner, Object key, RecoveredEntry value) { if(isEnabled()) { GRAPH_LOGGER.logTransition(GraphType.KEY, getGraphNameFromOwner(owner, key), "recovery", processValue(value.getValue()), getSource(), getDest()); } }
@Override public void writeBatch(Map<Object, RecoveredEntry> entries) throws IOException { for (Map.Entry<Object, RecoveredEntry> re : entries.entrySet()) { Object key = re.getKey(); // TODO:KIRK:OK Rusty's code was value = de.getValueWithContext(drv); Object value = re.getValue().getValue(); writer.snapshotEntry(new SnapshotRecord(key, value)); } }
@Override public DiskEntry initializeRecoveredEntry(Object key, RecoveredEntry re) { if(re.getValue() == null) { Assert.fail("Value should not have been null for key " + key); } currentOplogEntries.put(key, re); return super.initializeRecoveredEntry(key, re); }
@Override public void writeBatch(Map<Object, RecoveredEntry> entries) throws IOException { for (Map.Entry<Object, RecoveredEntry> re: entries.entrySet()) { Object key = re.getKey(); // TODO:KIRK:OK Rusty's code was value =de.getValueWithContext(drv); Object value = re.getValue().getValue(); //if (!Token.isInvalidOrRemoved(value)) { theWriter.snapshotEntry(key, value, re.getValue().getVersionTag(), re.getValue().getLastModifiedTime()); //} } } }));