Examples of ReplicatedRecord


Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecord

            }
        }, 60, EntryEventType.UPDATED, operations, 0.75, map1, map2);

        int map2Updated = 0;
        for (Map.Entry<String, String> entry : map2.entrySet()) {
            ReplicatedRecord record = getReplicatedRecord(map2, entry.getKey());
            if (record.getTtlMillis() > 0) {
                map2Updated++;
            }
        }
        int map1Updated = 0;
        for (Map.Entry<String, String> entry : map1.entrySet()) {
            ReplicatedRecord record = getReplicatedRecord(map1, entry.getKey());
            if (record.getTtlMillis() > 0) {
                map1Updated++;
            }
        }

        assertMatchSuccessfulOperationQuota(0.75, operations, map1Updated, map2Updated);
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecord

                return new VectorClockTimestamp();
            }
        };
        constructors[RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
                return new ReplicatedRecord();
            }
        };
        constructors[REPL_UPDATE_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
                return new ReplicationMessage();
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecord

        if (notYetReadyChooseSomeoneElse) {
            replicationPublisher.retryWithDifferentReplicationNode(origin);
        } else {
            for (int i = 0; i < recordCount; i++) {
                ReplicatedRecord record = replicatedRecords[i];

                Object key = record.getKey();
                Object value = record.getValue();
                VectorClockTimestamp timestamp = record.getVectorClockTimestamp();
                int updateHash = record.getLatestUpdateHash();
                long ttlMillis = record.getTtlMillis();

                ReplicationMessage update = new ReplicationMessage(name, key, value, timestamp, origin, updateHash, ttlMillis);
                replicationPublisher.queueUpdateMessage(update);
            }
            if (finalChunk) {
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecord

        origin = new MemberImpl();
        origin.readData(in);
        recordCount = in.readInt();
        replicatedRecords = new ReplicatedRecord[recordCount];
        for (int i = 0; i < recordCount; i++) {
            ReplicatedRecord replicatedRecord = new ReplicatedRecord();
            replicatedRecord.readData(in);
            replicatedRecords[i] = replicatedRecord;
        }
        finalChunk = in.readBoolean();
    }
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecord

    @Override
    public Object call()
            throws Exception {

        ReplicatedRecordStore recordStore = getReplicatedRecordStore();
        ReplicatedRecord record = recordStore.getReplicatedRecord(key);

        Object value = null;
        long ttl = 0;
        long updateTime = 0;
        if (record != null) {
            value = recordStore.unmarshallValue(record.getValue());
            ttl = record.getTtlMillis();
            updateTime = record.getUpdateTime();
        }
        return new ReplicatedMapGetResponse(value, ttl, updateTime);
    }
View Full Code Here

Examples of com.hazelcast.replicatedmap.record.ReplicatedRecord

    @Override
    public Object call()
            throws Exception {

        ReplicatedRecordStore recordStore = getReplicatedRecordStore();
        ReplicatedRecord record = recordStore.getReplicatedRecord(key);

        Object value = null;
        long ttl = 0;
        long updateTime = 0;
        if (record != null) {
            value = recordStore.unmarshallValue(record.getValue());
            ttl = record.getTtlMillis();
            updateTime = record.getUpdateTime();
        }
        return new ReplicatedMapGetResponse(value, ttl, updateTime);
    }
View Full Code Here

Examples of com.hazelcast.replicatedmap.record.ReplicatedRecord

        public void run() {
            final Iterator<ReplicatedRecord> iterator = replicatedRecordStorage.getRecords().iterator();
            final long now = System.currentTimeMillis();
            while (iterator.hasNext()) {
                final ReplicatedRecord v = iterator.next();
                if (v.getValue() == null && (v.getUpdateTime() + ttl) < now) {
                    iterator.remove();
                }
            }
        }
View Full Code Here

Examples of com.hazelcast.replicatedmap.record.ReplicatedRecord

                return new VectorClockTimestamp();
            }
        };
        constructors[RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
                return new ReplicatedRecord();
            }
        };
        constructors[REPL_UPDATE_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
                return new ReplicationMessage();
View Full Code Here

Examples of com.hazelcast.replicatedmap.record.ReplicatedRecord

        if (notYetReadyChooseSomeoneElse) {
            replicationPublisher.retryWithDifferentReplicationNode(origin);
        } else {
            for (int i = 0; i < recordCount; i++) {
                ReplicatedRecord record = replicatedRecords[i];

                Object key = record.getKey();
                Object value = record.getValue();
                VectorClockTimestamp timestamp = record.getVectorClockTimestamp();
                int updateHash = record.getLatestUpdateHash();
                long ttlMillis = record.getTtlMillis();

                ReplicationMessage update = new ReplicationMessage(name, key, value, timestamp, origin, updateHash, ttlMillis);
                replicationPublisher.queueUpdateMessage(update);
            }
            if (finalChunk) {
View Full Code Here

Examples of com.hazelcast.replicatedmap.record.ReplicatedRecord

        origin = new MemberImpl();
        origin.readData(in);
        recordCount = in.readInt();
        replicatedRecords = new ReplicatedRecord[recordCount];
        for (int i = 0; i < recordCount; i++) {
            ReplicatedRecord replicatedRecord = new ReplicatedRecord();
            replicatedRecord.readData(in);
            replicatedRecords[i] = replicatedRecord;
        }
        finalChunk = in.readBoolean();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.