Package com.hazelcast.replicatedmap.impl.messages

Examples of com.hazelcast.replicatedmap.impl.messages.ReplicationMessage


    private final class ReplicationListener
            implements ReplicatedMessageListener {

        public void onMessage(IdentifiedDataSerializable message) {
            if (message instanceof ReplicationMessage) {
                ReplicationMessage replicationMessage = (ReplicationMessage) message;
                ReplicatedRecordStore replicatedRecordStorage = replicatedStorages.get(replicationMessage.getName());
                ReplicationPublisher replicationPublisher = replicatedRecordStorage.getReplicationPublisher();
                if (replicatedRecordStorage instanceof AbstractReplicatedRecordStore) {
                    replicationPublisher.queueUpdateMessage(replicationMessage);
                }
            } else if (message instanceof MultiReplicationMessage) {
View Full Code Here


                oldValue = (V) current.getValue();
                if (oldValue != null) {
                    current.setValue(null, localMemberHash, TOMBSTONE_REMOVAL_PERIOD_MS);
                    scheduleTtlEntry(TOMBSTONE_REMOVAL_PERIOD_MS, marshalledKey, null);
                    vectorClockTimestamp = current.incrementVectorClock(localMember);
                    ReplicationMessage message = buildReplicationMessage(key, null, vectorClockTimestamp,
                            TOMBSTONE_REMOVAL_PERIOD_MS);
                    replicationPublisher.publishReplicatedMessage(message);
                }
            }
        }
View Full Code Here

            } else {
                cancelTtlEntry(marshalledKey);
            }

            VectorClockTimestamp vectorClockTimestamp = record.incrementVectorClock(localMember);
            ReplicationMessage message = buildReplicationMessage(key, value, vectorClockTimestamp, ttlMillis);
            replicationPublisher.publishReplicatedMessage(message);
        }
        Object unmarshalledOldValue = unmarshallValue(oldValue);
        fireEntryListenerEvent(key, unmarshalledOldValue, value);
        if (replicatedMapConfig.isStatisticsEnabled()) {
View Full Code Here

        mapStats.incrementOtherOperations();
        return replicatedMapService.removeEventListener(getName(), id);
    }

    private ReplicationMessage buildReplicationMessage(Object key, Object value, VectorClockTimestamp timestamp, long ttlMillis) {
        return new ReplicationMessage(getName(), key, value, timestamp, localMember, localMemberHash, ttlMillis);
    }
View Full Code Here

                Object key = update.getKey();
                V value = localEntry.getValue();
                long ttlMillis = update.getTtlMillis();
                int latestUpdateHash = localEntry.getLatestUpdateHash();
                ReplicationMessage message = new ReplicationMessage(name, key, value, newTimestamp, localMember,
                        latestUpdateHash, ttlMillis);

                distributeReplicationMessage(message, true);
            }
        } else {
View Full Code Here

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

                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) {
                recordStorage.finalChunkReceived();
            }
View Full Code Here

TOP

Related Classes of com.hazelcast.replicatedmap.impl.messages.ReplicationMessage

Copyright © 2018 www.massapicom. 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.