Package com.hazelcast.replicatedmap.record

Examples of com.hazelcast.replicatedmap.record.AbstractReplicatedRecordStore


        Member localMember = getNodeEngine().getLocalMember();
        ReplicatedMapService replicatedMapService = getService();
        for (MemberMapPair replicatedMap : replicatedMaps) {
            String mapName = replicatedMap.getName();
            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


        return eventService.deregisterListener(SERVICE_NAME, mapName, registrationId);
    }

    ScheduledFuture<?> registerCleaner(ReplicatedRecordStore replicatedRecordStorage) {
        if (replicatedRecordStorage instanceof AbstractReplicatedRecordStore) {
            AbstractReplicatedRecordStore recordStore = (AbstractReplicatedRecordStore) replicatedRecordStorage;
            return executionService.scheduleWithFixedDelay(new Cleaner(recordStore), INITIAL_DELAY, PERIOD, TimeUnit.SECONDS);
        }
        String className = replicatedRecordStorage.getClass().getName();
        throw new IllegalArgumentException("Unknown ReplicatedRecordStore implementation: " + className);
    }
View Full Code Here

            @Override
            public ReplicatedRecordStore createNew(String name) {
                ReplicatedMapConfig replicatedMapConfig = getReplicatedMapConfig(name);
                InMemoryFormat inMemoryFormat = replicatedMapConfig.getInMemoryFormat();
                AbstractReplicatedRecordStore replicatedRecordStorage = null;
                switch (inMemoryFormat) {
                    case OBJECT:
                        replicatedRecordStorage = new ObjectReplicatedRecordStorage(name, nodeEngine, cleanerRegistrator,
                                ReplicatedMapService.this);
                        break;
View Full Code Here

    @Override
    public void run()
            throws Exception {
        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.record.AbstractReplicatedRecordStore

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.