Search in sources :

Example 21 with DiskRecoveryStore

use of org.apache.geode.internal.cache.persistence.DiskRecoveryStore in project geode by apache.

the class VMStatsDiskLRURegionEntryHeapObjectKey method diskInitialize.

// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
private void diskInitialize(RegionEntryContext context, Object value) {
    DiskRecoveryStore drs = (DiskRecoveryStore) context;
    DiskStoreImpl ds = drs.getDiskStore();
    long maxOplogSize = ds.getMaxOplogSize();
    // get appropriate instance of DiskId implementation based on maxOplogSize
    this.id = DiskId.createDiskId(maxOplogSize, true, /* is persistence */
    ds.needsLinkedList());
    Helper.initialize(this, drs, value);
}
Also used : DiskRecoveryStore(org.apache.geode.internal.cache.persistence.DiskRecoveryStore)

Example 22 with DiskRecoveryStore

use of org.apache.geode.internal.cache.persistence.DiskRecoveryStore in project geode by apache.

the class VMStatsDiskLRURegionEntryHeapStringKey2 method diskInitialize.

// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
private void diskInitialize(RegionEntryContext context, Object value) {
    DiskRecoveryStore drs = (DiskRecoveryStore) context;
    DiskStoreImpl ds = drs.getDiskStore();
    long maxOplogSize = ds.getMaxOplogSize();
    // get appropriate instance of DiskId implementation based on maxOplogSize
    this.id = DiskId.createDiskId(maxOplogSize, true, /* is persistence */
    ds.needsLinkedList());
    Helper.initialize(this, drs, value);
}
Also used : DiskRecoveryStore(org.apache.geode.internal.cache.persistence.DiskRecoveryStore)

Example 23 with DiskRecoveryStore

use of org.apache.geode.internal.cache.persistence.DiskRecoveryStore in project geode by apache.

the class VMStatsDiskLRURegionEntryOffHeapLongKey method diskInitialize.

// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
private void diskInitialize(RegionEntryContext context, Object value) {
    DiskRecoveryStore drs = (DiskRecoveryStore) context;
    DiskStoreImpl ds = drs.getDiskStore();
    long maxOplogSize = ds.getMaxOplogSize();
    // get appropriate instance of DiskId implementation based on maxOplogSize
    this.id = DiskId.createDiskId(maxOplogSize, true, /* is persistence */
    ds.needsLinkedList());
    Helper.initialize(this, drs, value);
}
Also used : DiskRecoveryStore(org.apache.geode.internal.cache.persistence.DiskRecoveryStore)

Example 24 with DiskRecoveryStore

use of org.apache.geode.internal.cache.persistence.DiskRecoveryStore in project geode by apache.

the class VMStatsDiskRegionEntryOffHeapStringKey1 method diskInitialize.

// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
private void diskInitialize(RegionEntryContext context, Object value) {
    DiskRecoveryStore drs = (DiskRecoveryStore) context;
    DiskStoreImpl ds = drs.getDiskStore();
    long maxOplogSize = ds.getMaxOplogSize();
    // get appropriate instance of DiskId implementation based on maxOplogSize
    this.id = DiskId.createDiskId(maxOplogSize, true, /* is persistence */
    ds.needsLinkedList());
    Helper.initialize(this, drs, value);
}
Also used : DiskRecoveryStore(org.apache.geode.internal.cache.persistence.DiskRecoveryStore)

Example 25 with DiskRecoveryStore

use of org.apache.geode.internal.cache.persistence.DiskRecoveryStore in project geode by apache.

the class Oplog method readRVVRecord.

private void readRVVRecord(DataInput dis, File f, boolean gcRVV, boolean latestOplog) throws IOException {
    final boolean isPersistRecoveryDebugEnabled = logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY);
    long numRegions = InternalDataSerializer.readUnsignedVL(dis);
    if (isPersistRecoveryDebugEnabled) {
        logger.trace(LogMarker.PERSIST_RECOVERY, "readRVV entry numRegions={}", numRegions);
    }
    for (int region = 0; region < numRegions; region++) {
        long drId = InternalDataSerializer.readUnsignedVL(dis);
        // Get the drs. This may be null if this region is not currently
        // recovering
        DiskRecoveryStore drs = getOplogSet().getCurrentlyRecovering(drId);
        if (isPersistRecoveryDebugEnabled) {
            logger.trace(LogMarker.PERSIST_RECOVERY, "readRVV drId={} region={}", drId, drs);
        }
        if (gcRVV) {
            // Read the GCC RV
            long rvvSize = InternalDataSerializer.readUnsignedVL(dis);
            for (int memberNum = 0; memberNum < rvvSize; memberNum++) {
                // for each member, read the member id and version
                long memberId = InternalDataSerializer.readUnsignedVL(dis);
                long gcVersion = InternalDataSerializer.readUnsignedVL(dis);
                // if we have a recovery store, add the recovered regions
                if (drs != null) {
                    Object member = getParent().getDiskInitFile().getCanonicalObject((int) memberId);
                    drs.recordRecoveredGCVersion((VersionSource) member, gcVersion);
                    if (isPersistRecoveryDebugEnabled) {
                        logger.trace(LogMarker.PERSIST_RECOVERY, "adding gcRVV entry drId={}, member={}, version={}", drId, memberId, gcVersion);
                    }
                } else {
                    if (isPersistRecoveryDebugEnabled) {
                        logger.trace(LogMarker.PERSIST_RECOVERY, "skipping gcRVV entry drId={}, member={}, version={}", drId, memberId, gcVersion);
                    }
                }
            }
        } else {
            boolean rvvTrusted = DataSerializer.readBoolean(dis);
            if (drs != null) {
                if (latestOplog) {
                    // only set rvvtrust based on the newest oplog recovered
                    drs.setRVVTrusted(rvvTrusted);
                    if (isPersistRecoveryDebugEnabled) {
                        logger.trace(LogMarker.PERSIST_RECOVERY, "marking RVV trusted drId={},tvvTrusted={}", drId, rvvTrusted);
                    }
                }
            }
            // Read a regular RVV
            long rvvSize = InternalDataSerializer.readUnsignedVL(dis);
            for (int memberNum = 0; memberNum < rvvSize; memberNum++) {
                // for each member, read the member id and version
                long memberId = InternalDataSerializer.readUnsignedVL(dis);
                RegionVersionHolder versionHolder = new RegionVersionHolder(dis);
                if (drs != null) {
                    Object member = getParent().getDiskInitFile().getCanonicalObject((int) memberId);
                    drs.recordRecoveredVersonHolder((VersionSource) member, versionHolder, latestOplog);
                    if (isPersistRecoveryDebugEnabled) {
                        logger.trace(LogMarker.PERSIST_RECOVERY, "adding RVV entry drId={},member={},versionHolder={},latestOplog={},oplogId={}", drId, memberId, versionHolder, latestOplog, getOplogId());
                    }
                } else {
                    if (isPersistRecoveryDebugEnabled) {
                        logger.trace(LogMarker.PERSIST_RECOVERY, "skipping RVV entry drId={}, member={}, versionHolder={}", drId, memberId, versionHolder);
                    }
                }
            }
        }
    }
    readEndOfRecord(dis);
}
Also used : DiskRecoveryStore(org.apache.geode.internal.cache.persistence.DiskRecoveryStore) StoredObject(org.apache.geode.internal.offheap.StoredObject) RegionVersionHolder(org.apache.geode.internal.cache.versions.RegionVersionHolder)

Aggregations

DiskRecoveryStore (org.apache.geode.internal.cache.persistence.DiskRecoveryStore)106 VersionTag (org.apache.geode.internal.cache.versions.VersionTag)5 StoredObject (org.apache.geode.internal.offheap.StoredObject)5 HashMap (java.util.HashMap)3 DiskRegionView (org.apache.geode.internal.cache.persistence.DiskRegionView)3 File (java.io.File)2 ByteArrayDataInput (org.apache.geode.internal.ByteArrayDataInput)2 OplogEntryIdSet (org.apache.geode.internal.cache.DiskStoreImpl.OplogEntryIdSet)2 Int2ObjectOpenHashMap (it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap)1 Long2ObjectOpenHashMap (it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap)1 LongOpenHashSet (it.unimi.dsi.fastutil.longs.LongOpenHashSet)1 BufferedInputStream (java.io.BufferedInputStream)1 DataInputStream (java.io.DataInputStream)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InterruptedIOException (java.io.InterruptedIOException)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1