Package com.hazelcast.multimap

Examples of com.hazelcast.multimap.MultiMapService


    public RemoveEntryListenerRequest(String name, String registrationId) {
        super(name, registrationId);
    }

    public Object call() throws Exception {
        final MultiMapService service = getService();
        return service.removeListener(name, registrationId);
    }
View Full Code Here


                logger.finest( "Registering default services...");
                registerService(MapService.SERVICE_NAME, new MapService(nodeEngine));
                registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
                registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
                registerService(TopicService.SERVICE_NAME, new TopicService());
                registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
                registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
                registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
                registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
                registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
                registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
View Full Code Here

    @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();
        keyIterator = multiMapContainer.keySet().iterator();
        return true;
    }
View Full Code Here

    }

    public Object call() throws Exception {
        final ClientEndpoint endpoint = getEndpoint();
        final ClientEngine clientEngine = getClientEngine();
        final MultiMapService service = getService();
        EntryListener listener = new EntryAdapter() {
            @Override
            public void onEntryEvent(EntryEvent event) {
                send(event);
            }

            private void send(EntryEvent event) {
                if (endpoint.live()) {
                    Data key = clientEngine.toData(event.getKey());
                    Data value = clientEngine.toData(event.getValue());
                    Data oldValue = clientEngine.toData(event.getOldValue());
                    PortableEntryEvent portableEntryEvent = new PortableEntryEvent(key, value, oldValue, event.getEventType(), event.getMember().getUuid());
                    endpoint.sendEvent(portableEntryEvent, getCallId());
                }
            }
        };
        String registrationId = service.addListener(name, listener, key, includeValue, false);
        endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME, name, registrationId);
        return registrationId;
    }
View Full Code Here

        logger.finest("Registering default services...");
        registerService(MapService.SERVICE_NAME, MapService.create(nodeEngine));
        registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
        registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
        registerService(TopicService.SERVICE_NAME, new TopicService());
        registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
        registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
        registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
        registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
        registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
        registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
View Full Code Here

    protected Object reduce(Map<Integer, Object> map) {
        int totalAffectedEntries = 0;
        for (Object affectedEntries : map.values()) {
            totalAffectedEntries += (Integer) affectedEntries;
        }
        final MultiMapService service = getService();
        service.publishMultiMapEvent(name, EntryEventType.CLEAR_ALL, totalAffectedEntries);
        return null;
    }
View Full Code Here

    public RemoveEntryListenerRequest(String name, String registrationId) {
        super(name, registrationId);
    }

    public Object call() throws Exception {
        final MultiMapService service = getService();
        return service.removeListener(name, registrationId);
    }
View Full Code Here

        }
    }

    public void afterRun() throws Exception {
        long elapsed = Math.max(0, Clock.currentTimeMillis() - begin);
        final MultiMapService service = getService();
        service.getLocalMultiMapStatsImpl(name).incrementRemoves(elapsed);
        if (Boolean.TRUE.equals(response)) {
            getOrCreateContainer().update();
            publishEvent(EntryEventType.REMOVED, dataKey, value);
        }
    }
View Full Code Here

        coll.add(record);
    }

    public void afterRun() throws Exception {
        long elapsed = Math.max(0, Clock.currentTimeMillis() - begin);
        final MultiMapService service = getService();
        service.getLocalMultiMapStatsImpl(name).incrementPuts(elapsed);
        if (Boolean.TRUE.equals(response)) {
            publishEvent(EntryEventType.ADDED, dataKey, value);
        }
    }
View Full Code Here

        this.includeValue = includeValue;
    }

    public Object call() throws Exception {
        final ClientEndpoint endpoint = getEndpoint();
        final MultiMapService service = getService();
        EntryListener listener = new EntryAdapter() {
            @Override
            public void onEntryEvent(EntryEvent event) {
                if (endpoint.live()) {
                    Data key = serializationService.toData(event.getKey());
                    Data value = serializationService.toData(event.getValue());
                    Data oldValue = serializationService.toData(event.getOldValue());
                    final EntryEventType type = event.getEventType();
                    final String uuid = event.getMember().getUuid();
                    PortableEntryEvent portableEntryEvent = new PortableEntryEvent(key, value, oldValue, type, uuid);
                    endpoint.sendEvent(portableEntryEvent, getCallId());
                }
            }

            @Override
            public void onMapEvent(MapEvent event) {
                if (endpoint.live()) {
                    final EntryEventType type = event.getEventType();
                    final String uuid = event.getMember().getUuid();
                    PortableEntryEvent portableEntryEvent =
                            new PortableEntryEvent(type, uuid, event.getNumberOfEntriesAffected());
                    endpoint.sendEvent(portableEntryEvent, getCallId());
                }
            }
        };
        String registrationId = service.addListener(name, listener, key, includeValue, false);
        endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME, name, registrationId);
        return registrationId;
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.multimap.MultiMapService

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.