Search in sources :

Example 1 with ExpiredKey

use of com.hazelcast.internal.eviction.ExpiredKey in project hazelcast by hazelcast.

the class CacheExpireBatchBackupOperation method writeInternal.

@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    super.writeInternal(out);
    out.writeInt(expiredKeys.size());
    for (ExpiredKey expiredKey : expiredKeys) {
        IOUtil.writeData(out, expiredKey.getKey());
        out.writeLong(expiredKey.getMetadata());
    }
    out.writeInt(primaryEntryCount);
}
Also used : ExpiredKey(com.hazelcast.internal.eviction.ExpiredKey)

Example 2 with ExpiredKey

use of com.hazelcast.internal.eviction.ExpiredKey in project hazelcast by hazelcast.

the class EvictBatchBackupOperation method runInternal.

@Override
protected void runInternal() {
    if (recordStore == null) {
        return;
    }
    for (ExpiredKey expiredKey : expiredKeys) {
        Data key = expiredKey.getKey();
        Record existingRecord = recordStore.getRecord(key);
        if (hasSameValueHashCode(existingRecord, expiredKey)) {
            recordStore.evict(key, true);
        }
    }
    equalizeEntryCountWithPrimary();
}
Also used : Data(com.hazelcast.internal.serialization.Data) Record(com.hazelcast.map.impl.record.Record) ExpiredKey(com.hazelcast.internal.eviction.ExpiredKey)

Example 3 with ExpiredKey

use of com.hazelcast.internal.eviction.ExpiredKey in project hazelcast by hazelcast.

the class EvictBatchBackupOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);
    name = in.readString();
    int size = in.readInt();
    expiredKeys = new LinkedList<>();
    for (int i = 0; i < size; i++) {
        expiredKeys.add(new ExpiredKey(IOUtil.readData(in), in.readLong()));
    }
    primaryEntryCount = in.readInt();
}
Also used : ExpiredKey(com.hazelcast.internal.eviction.ExpiredKey)

Example 4 with ExpiredKey

use of com.hazelcast.internal.eviction.ExpiredKey in project hazelcast by hazelcast.

the class CacheExpireBatchBackupOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);
    int size = in.readInt();
    expiredKeys = new LinkedList<ExpiredKey>();
    for (int i = 0; i < size; i++) {
        expiredKeys.add(new ExpiredKey(IOUtil.readData(in), in.readLong()));
    }
    primaryEntryCount = in.readInt();
}
Also used : ExpiredKey(com.hazelcast.internal.eviction.ExpiredKey)

Example 5 with ExpiredKey

use of com.hazelcast.internal.eviction.ExpiredKey in project hazelcast by hazelcast.

the class EvictBatchBackupOperation method writeInternal.

@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    super.writeInternal(out);
    out.writeString(name);
    out.writeInt(expiredKeys.size());
    for (ExpiredKey expiredKey : expiredKeys) {
        IOUtil.writeData(out, expiredKey.getKey());
        out.writeLong(expiredKey.getMetadata());
    }
    out.writeInt(primaryEntryCount);
}
Also used : ExpiredKey(com.hazelcast.internal.eviction.ExpiredKey)

Aggregations

ExpiredKey (com.hazelcast.internal.eviction.ExpiredKey)5 Data (com.hazelcast.internal.serialization.Data)1 Record (com.hazelcast.map.impl.record.Record)1