Package com.hazelcast.spi.impl

Examples of com.hazelcast.spi.impl.NodeEngineImpl


        Object value = attributes.remove(key);
        if (value == null) {
            return;
        }
        if (instance != null) {
            NodeEngineImpl nodeEngine = instance.node.nodeEngine;
            OperationService os = nodeEngine.getOperationService();
            MemberAttributeChangedOperation operation =
                    new MemberAttributeChangedOperation(REMOVE, key, null);
            String uuid = nodeEngine.getLocalMember().getUuid();
            operation.setCallerUuid(uuid).setNodeEngine(nodeEngine);
            try {
                for (MemberImpl member : nodeEngine.getClusterService().getMemberList()) {
                    if (!member.localMember()) {
                        os.send(operation, member.getAddress());
                    } else {
                        os.executeOperation(operation);
                    }
View Full Code Here


        Object oldValue = attributes.put(key, value);
        if (value.equals(oldValue)) {
            return;
        }
        if (instance != null) {
            NodeEngineImpl nodeEngine = instance.node.nodeEngine;
            OperationService os = nodeEngine.getOperationService();
            MemberAttributeChangedOperation operation =
                    new MemberAttributeChangedOperation(PUT, key, value);
            String uuid = nodeEngine.getLocalMember().getUuid();
            operation.setCallerUuid(uuid).setNodeEngine(nodeEngine);
            try {
                for (MemberImpl member : nodeEngine.getClusterService().getMemberList()) {
                    if (!member.localMember()) {
                        os.send(operation, member.getAddress());
                    } else {
                        os.executeOperation(operation);
                    }
View Full Code Here

            } catch (Throwable ignored) {
            }
            throw ExceptionUtil.rethrow(e);
        }
        securityContext = config.getSecurityConfig().isEnabled() ? initializer.getSecurityContext() : null;
        nodeEngine = new NodeEngineImpl(this);
        clientEngine = new ClientEngineImpl(this);
        connectionManager = nodeContext.createConnectionManager(this, serverSocketChannel);
        partitionService = new InternalPartitionServiceImpl(this);
        clusterService = new ClusterServiceImpl(this);
        textCommandService = new TextCommandServiceImpl(this);
View Full Code Here

        MigrationInfo migrationInfo = partitionService.getActiveMigration(partitionId);
        if (migrationInfo == null) {
            return;
        }

        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();

        PartitionMigrationEvent event = new PartitionMigrationEvent(endpoint, partitionId);
        for (MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
            finishMigration(event, service);
        }

        partitionService.removeActiveMigration(partitionId);
        if (success) {
            nodeEngine.onPartitionMigrate(migrationInfo);
        }
    }
View Full Code Here

        InternalPartitionImpl partition = service.getPartition(getPartitionId());
        partition.setMigrating(false);
    }

    private void sendToAllMigrationAwareServices(PartitionMigrationEvent event) {
        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
        for (MigrationAwareService service : nodeEngine.getServices(MigrationAwareService.class)) {
            try {
                service.beforeMigration(event);
                service.commitMigration(event);
            } catch (Throwable e) {
                logMigrationError(e);
View Full Code Here

        this.listName = listName;
    }

    @Override
    public boolean open(NodeEngine nodeEngine) {
        NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
        ss = nei.getSerializationService();

        Address thisAddress = nei.getThisAddress();
        InternalPartitionService ps = nei.getPartitionService();
        Data data = ss.toData(listName, StringAndPartitionAwarePartitioningStrategy.INSTANCE);
        int partitionId = ps.getPartitionId(data);
        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        if (thisAddress.equals(partitionOwner)) {
            ListService listService = nei.getService(ListService.SERVICE_NAME);
            ListContainer listContainer = listService.getOrCreateContainer(listName, false);
            List<CollectionItem> items = new ArrayList<CollectionItem>(listContainer.getCollection());
            iterator = items.iterator();
        }
        return true;
View Full Code Here

        this.mapName = mapName;
    }

    @Override
    public boolean open(NodeEngine nodeEngine) {
        NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
        InternalPartitionService ps = nei.getPartitionService();
        MapService mapService = nei.getService(MapService.SERVICE_NAME);
        ss = nei.getSerializationService();
        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        RecordStore recordStore = mapService.getRecordStore(partitionId, mapName);
View Full Code Here

        this.replyBack = replyBack;
    }

    @Override
    public void run() {
        NodeEngineImpl ns = (NodeEngineImpl) getNodeEngine();
        TcpIpConnectionManager connectionManager = (TcpIpConnectionManager) ns.getNode().getConnectionManager();
        TcpIpConnection connection = (TcpIpConnection) getConnection();
        connectionManager.bind(connection, localAddress, targetAddress, replyBack);
    }
View Full Code Here

        this.setName = setName;
    }

    @Override
    public boolean open(NodeEngine nodeEngine) {
        NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
        ss = nei.getSerializationService();

        Address thisAddress = nei.getThisAddress();
        InternalPartitionService ps = nei.getPartitionService();
        Data data = ss.toData(setName, StringAndPartitionAwarePartitioningStrategy.INSTANCE);
        int partitionId = ps.getPartitionId(data);
        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        if (thisAddress.equals(partitionOwner)) {
            SetService setService = nei.getService(SetService.SERVICE_NAME);
            SetContainer setContainer = setService.getOrCreateContainer(setName, false);
            List<CollectionItem> items = new ArrayList<CollectionItem>(setContainer.getCollection());
            iterator = items.iterator();
        }
        return true;
View Full Code Here

        this.multiMapName = multiMapName;
    }

    @Override
    public boolean open(NodeEngine nodeEngine) {
        NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
        InternalPartitionService ps = nei.getPartitionService();
        MultiMapService multiMapService = nei.getService(MultiMapService.SERVICE_NAME);
        ss = nei.getSerializationService();
        Address partitionOwner = ps.getPartitionOwner(partitionId);
        if (partitionOwner == null) {
            return false;
        }
        multiMapContainer = multiMapService.getOrCreateCollectionContainer(partitionId, multiMapName);
View Full Code Here

TOP

Related Classes of com.hazelcast.spi.impl.NodeEngineImpl

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.