Search in sources :

Example 1 with EncryptedDataEntry

use of org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordDataV1Serializer.EncryptedDataEntry in project ignite by apache.

the class StandaloneWalRecordsIterator method postProcessDataEntry.

/**
 * Converts entry or lazy data entry into unwrapped entry
 *
 * @param processor cache object processor for de-serializing objects.
 * @param fakeCacheObjCtx cache object context for de-serializing binary and unwrapping objects.
 * @param dataEntry entry to process
 * @return post precessed entry
 * @throws IgniteCheckedException if failed
 */
@NotNull
private DataEntry postProcessDataEntry(final IgniteCacheObjectProcessor processor, final CacheObjectContext fakeCacheObjCtx, final DataEntry dataEntry) throws IgniteCheckedException {
    if (dataEntry instanceof EncryptedDataEntry)
        return dataEntry;
    final KeyCacheObject key;
    final CacheObject val;
    boolean keepBinary = this.keepBinary || !fakeCacheObjCtx.kernalContext().marshallerContext().initialized();
    if (dataEntry instanceof MarshalledDataEntry) {
        final MarshalledDataEntry lazyDataEntry = (MarshalledDataEntry) dataEntry;
        key = processor.toKeyCacheObject(fakeCacheObjCtx, lazyDataEntry.getKeyType(), lazyDataEntry.getKeyBytes());
        final byte type = lazyDataEntry.getValType();
        val = type == 0 ? null : processor.toCacheObject(fakeCacheObjCtx, type, lazyDataEntry.getValBytes());
    } else {
        key = dataEntry.key();
        val = dataEntry.value();
    }
    return unwrapDataEntry(fakeCacheObjCtx, dataEntry, key, val, keepBinary);
}
Also used : EncryptedDataEntry(org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordDataV1Serializer.EncryptedDataEntry) MarshalledDataEntry(org.apache.ignite.internal.pagemem.wal.record.MarshalledDataEntry) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) KeyCacheObject(org.apache.ignite.internal.processors.cache.KeyCacheObject) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

MarshalledDataEntry (org.apache.ignite.internal.pagemem.wal.record.MarshalledDataEntry)1 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)1 KeyCacheObject (org.apache.ignite.internal.processors.cache.KeyCacheObject)1 EncryptedDataEntry (org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordDataV1Serializer.EncryptedDataEntry)1 NotNull (org.jetbrains.annotations.NotNull)1