Examples of InternalPartitionService


Examples of com.hazelcast.partition.InternalPartitionService

    }

    @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);
        isBinary = multiMapContainer.getConfig().isBinary();
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

        }
        return data.isEmpty() ? null : new AtomicLongReplicationOperation(data);
    }

    private int getPartitionId(String name) {
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        String partitionKey = getPartitionKey(name);
        return partitionService.getPartitionId(partitionKey);
    }
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

    }

    private ReplicaSyncResponse createResponse(byte[] data) throws IOException {
        int partitionId = getPartitionId();
        NodeEngine nodeEngine = getNodeEngine();
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        long[] replicaVersions = partitionService.getPartitionReplicaVersions(partitionId);

        boolean compress = nodeEngine.getGroupProperties().PARTITION_MIGRATION_ZIP_ENABLED.getBoolean();
        if (data != null && data.length > 0 && compress) {
            data = IOUtil.compress(data);
        }
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

            }
        }
    }

    private int getPartitionId(String name) {
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        String partitionKey = StringPartitioningStrategy.getPartitionKey(name);
        return partitionService.getPartitionId(partitionKey);
    }
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

public final class GetPartitionsRequest extends CallableClientRequest implements Portable, RetryableRequest {

    @Override
    public Object call() throws Exception {
        InternalPartitionService service = getService();
        service.firstArrangement();
        ClusterService clusterService = getClientEngine().getClusterService();
        Collection<MemberImpl> memberList = clusterService.getMemberList();
        Address[] addresses = new Address[memberList.size()];
        Map<Address, Integer> addressMap = new HashMap<Address, Integer>(memberList.size());
        int k = 0;
        for (MemberImpl member : memberList) {
            Address address = member.getAddress();
            addresses[k] = address;
            addressMap.put(address, k);
            k++;
        }
        InternalPartition[] partitions = service.getPartitions();
        int[] indexes = new int[partitions.length];
        for (int i = 0; i < indexes.length; i++) {
            Address owner = partitions[i].getOwner();
            int index = -1;
            if (owner != null) {
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

    public void run() throws Exception {
        if (!valid) {
            return;
        }
        NodeEngine nodeEngine = getNodeEngine();
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        partitionService.updatePartitionReplicaVersions(getPartitionId(), replicaVersions, getReplicaIndex());

        if (backupOpData != null) {
            backupOp = nodeEngine.getSerializationService().toObject(backupOpData);
            backupOp.setNodeEngine(nodeEngine);
            backupOp.setResponseHandler(ResponseHandlerFactory.createEmptyResponseHandler());
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

                service.clearPartitionReplica(partitionId);
            } catch (Throwable e) {
                logMigrationError(e);
            }
        }
        InternalPartitionService partitionService = getService();
        partitionService.clearPartitionReplicaVersions(partitionId);
    }
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

    @Override
    public void memberAttributeChanged(MemberAttributeServiceEvent event) {
    }

    private void onOwnerDisconnected(final String caller) {
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        OperationService operationService = nodeEngine.getOperationService();
        Address thisAddress = nodeEngine.getThisAddress();

        for (String name : permitMap.keySet()) {
            int partitionId = partitionService.getPartitionId(getPartitionKey(name));
            InternalPartition partition = partitionService.getPartition(partitionId);

            if (thisAddress.equals(partition.getOwner())) {
                Operation op = new SemaphoreDeadMemberOperation(name, caller)
                        .setPartitionId(partitionId)
                        .setResponseHandler(createEmptyResponseHandler())
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

        return o;
    }

    public Runnable prepareMergeRunnable() {
        Map<MapContainer, Collection<Record>> recordMap = new HashMap<MapContainer, Collection<Record>>(mapContainers.size());
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        int partitionCount = partitionService.getPartitionCount();
        Address thisAddress = nodeEngine.getClusterService().getThisAddress();

        for (MapContainer mapContainer : mapContainers.values()) {
            for (int i = 0; i < partitionCount; i++) {
                RecordStore recordStore = getPartitionContainer(i).getRecordStore(mapContainer.getName());
                // add your owned entries to the map so they will be merged
                if (thisAddress.equals(partitionService.getPartitionOwner(i))) {
                    Collection<Record> records = recordMap.get(mapContainer);
                    if (records == null) {
                        records = new ArrayList<Record>();
                        recordMap.put(mapContainer, records);
                    }
View Full Code Here

Examples of com.hazelcast.partition.InternalPartitionService

        }
        return partitions;
    }

    private List<Integer> getMemberPartitions() {
        InternalPartitionService partitionService = nodeEngine.getPartitionService();
        List<Integer> partitions = partitionService.getMemberPartitions(nodeEngine.getThisAddress());
        return Collections.unmodifiableList(partitions);
    }
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.