Package com.hazelcast.nio

Examples of com.hazelcast.nio.Address


    @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);
View Full Code Here


            if (in.readBoolean()) {
                int length = in.readInt();
                JobPartitionState[] partitionStates = new JobPartitionState[length];
                for (int i = 0; i < length; i++) {
                    if (in.readBoolean()) {
                        Address owner = in.readObject();
                        JobPartitionState.State state = JobPartitionState.State.byOrdinal(in.readInt());
                        partitionStates[i] = new JobPartitionStateImpl(owner, state);
                    }
                }
                return partitionStates;
View Full Code Here

    @Override
    public void readData(ObjectDataInput in)
            throws IOException {
        super.readData(in);
        address = new Address();
        address.readData(in);
    }
View Full Code Here

            }
        };

        ctors[ADDRESS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
                return new Address();
            }
        };

        ctors[MEMBER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
            public IdentifiedDataSerializable createNew(Integer arg) {
View Full Code Here

    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);
        iterator = recordStore.entrySetData().iterator();
View Full Code Here

        }
    }

    public Address getKeyMember(Object key) {
        int partitionId = partitionService.getPartitionId(key);
        Address owner;
        while ((owner = partitionService.getPartitionOwner(partitionId)) == null) {
            try {
                Thread.sleep(DEFAULT_RETRY_SLEEP_MILLIS);
            } catch (Exception ignore) {
                // Partitions might not assigned yet so we need to retry
View Full Code Here

    @ManagedAnnotation("activePartitionCount")
    @ManagedDescription("Number of active partitions")
    public int getActivePartitionCount() {
        InetSocketAddress address = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress();
        return managedObject.getMemberPartitions(new Address(address)).size();
    }
View Full Code Here

        if (processedRecords > 0) {
            try {
                MapReduceService mapReduceService = supervisor.getMapReduceService();
                String name = supervisor.getConfiguration().getName();
                String jobId = supervisor.getConfiguration().getJobId();
                Address jobOwner = supervisor.getJobOwner();
                mapReduceService.processRequest(jobOwner, new ProcessStatsUpdateOperation(name, jobId, processedRecords), name);
            } catch (Exception ignore) {
                // Don't care if wasn't executed properly
                logger.finest("ProcessedRecords update couldn't be executed", ignore);
            }
View Full Code Here

        latch.countDown();
    }

    @Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        Address jobOwner = mapReduceService.getLocalAddress();
        if (!mapReduceService.registerJobSupervisorCancellation(name, jobId, jobOwner)) {
            return false;
        }
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor == null || !supervisor.isOwnerNode()) {
View Full Code Here

    @Override
    public void run()
            throws Exception {
        MapReduceService mapReduceService = getService();
        Address jobOwner = getCallerAddress();
        if (jobOwner == null) {
            jobOwner = getNodeEngine().getThisAddress();
        }

        // Inject managed context
View Full Code Here

TOP

Related Classes of com.hazelcast.nio.Address

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.