Package com.hazelcast.replicatedmap.impl.record

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


        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) {
                MultiReplicationMessage multiReplicationMessage = (MultiReplicationMessage) message;
                ReplicatedRecordStore replicatedRecordStorage = replicatedStorages.get(multiReplicationMessage.getName());
                ReplicationPublisher replicationPublisher = replicatedRecordStorage.getReplicationPublisher();
                if (replicatedRecordStorage instanceof AbstractReplicatedRecordStore) {
                    replicationPublisher.queueUpdateMessages(multiReplicationMessage);
                }
            }
        }
View Full Code Here


            if (localMember.equals(replicatedMap.getMember())) {
                AbstractReplicatedRecordStore recordStorage = (AbstractReplicatedRecordStore) replicatedMapService
                        .getReplicatedRecordStore(mapName, false);

                if (recordStorage != null && recordStorage.isLoaded()) {
                    ReplicationPublisher replicationPublisher = recordStorage.getReplicationPublisher();
                    replicationPublisher.queuePreProvision(getCallerAddress(), chunkSize);
                } else {
                    OperationService operationService = getNodeEngine().getOperationService();
                    Operation operation = new ReplicatedMapInitChunkOperation(mapName, localMember);
                    operationService.send(operation, getCallerAddress());
                }
View Full Code Here

        ReplicatedMapService replicatedMapService = getService();

        AbstractReplicatedRecordStore recordStorage;
        recordStorage = (AbstractReplicatedRecordStore) replicatedMapService.getReplicatedRecordStore(name, true);

        ReplicationPublisher replicationPublisher = recordStorage.getReplicationPublisher();

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

TOP

Related Classes of com.hazelcast.replicatedmap.impl.record.ReplicationPublisher

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.