use of org.apache.geode.internal.cache.persistence.DiskStoreID in project geode by apache.
the class DiskInitFile method writeClearRecord.
/**
* Write a clear with an RVV record.
*/
private void writeClearRecord(DiskRegionView dr, RegionVersionVector rvv) {
try {
HeapDataOutputStream hdos = new HeapDataOutputStream(32, Version.CURRENT);
hdos.write(IFREC_CLEAR_REGION_WITH_RVV_ID);
writeDiskRegionID(hdos, dr.getId());
// We only need the memberToVersionMap for clear purposes
Map<DiskStoreID, RegionVersionHolder> memberToVersion = rvv.getMemberToVersion();
hdos.writeInt(memberToVersion.size());
for (Map.Entry<DiskStoreID, RegionVersionHolder> entry : memberToVersion.entrySet()) {
InternalDataSerializer.invokeToData(entry.getKey(), hdos);
synchronized (entry.getValue()) {
InternalDataSerializer.invokeToData(entry.getValue(), hdos);
}
}
hdos.write(END_OF_RECORD_ID);
// don't do stats for these small records
writeIFRecord(hdos, false);
} catch (IOException ex) {
DiskAccessException dae = new DiskAccessException(LocalizedStrings.DiskInitFile_FAILED_INIT_FILE_WRITE_BECAUSE_0.toLocalizedString(ex), this.parent);
if (!this.compactInProgress) {
this.parent.handleDiskAccessException(dae);
}
throw dae;
}
}
use of org.apache.geode.internal.cache.persistence.DiskStoreID in project geode by apache.
the class Oplog method readDiskStoreRecord.
/**
* @throws DiskAccessException if this file does not belong to our parent
*/
private void readDiskStoreRecord(DataInput dis, File f) throws IOException {
long leastSigBits = dis.readLong();
long mostSigBits = dis.readLong();
DiskStoreID readDSID = new DiskStoreID(mostSigBits, leastSigBits);
if (logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY)) {
logger.trace(LogMarker.PERSIST_RECOVERY, "diskStoreId={}", readDSID);
}
readEndOfRecord(dis);
DiskStoreID dsid = getParent().getDiskStoreID();
if (!readDSID.equals(dsid)) {
throw new DiskAccessException("The oplog file \"" + f + "\" does not belong to the init file \"" + getParent().getInitFile() + "\".", getParent());
}
}
use of org.apache.geode.internal.cache.persistence.DiskStoreID in project geode by apache.
the class Oplog method createDummyTag.
private synchronized VersionTag createDummyTag(DiskRecoveryStore drs) {
DiskStoreID member = getParent().getDiskStoreID();
int memberid = getParent().getDiskInitFile().getOrCreateCanonicalId(member);
long regionVersion = drs.getVersionForMember(member);
VersionTag vt = VersionTag.create(member);
vt.setEntryVersion(1);
vt.setRegionVersion(regionVersion + 1);
vt.setMemberID(member);
vt.setVersionTimeStamp(getParent().getCache().cacheTimeMillis());
vt.setDistributedSystemId(-1);
return vt;
}
use of org.apache.geode.internal.cache.persistence.DiskStoreID in project geode by apache.
the class DiskVersionTag method readMember.
@Override
public DiskStoreID readMember(DataInput in) throws IOException {
long mostSignificantBits = in.readLong();
long leastSignificantBits = in.readLong();
DiskStoreID member = new DiskStoreID(mostSignificantBits, leastSignificantBits);
return member;
}
use of org.apache.geode.internal.cache.persistence.DiskStoreID in project geode by apache.
the class DiskRegionVersionVector method readMember.
@Override
protected DiskStoreID readMember(DataInput in) throws IOException {
long mostSignificantBits = in.readLong();
long leastSignificantBits = in.readLong();
DiskStoreID member = new DiskStoreID(mostSignificantBits, leastSignificantBits);
return member;
}
Aggregations