Package com.hazelcast.core

Examples of com.hazelcast.core.EntryEventType


            Data dataValue = null;
            if (result != null) {
                dataValue = mapService.toData(result);
                response.add(new AbstractMap.SimpleImmutableEntry<Data, Data>(key, dataValue));
            }
            EntryEventType eventType;
            if (valueAfterProcess == null) {
                recordStore.remove(key);
                mapStats.incrementRemoves(getLatencyFrom(start));
                eventType = EntryEventType.REMOVED;
            } else {
View Full Code Here


            if (result != null) {
                dataValue = mapService.toData(result);
                response.add(new AbstractMap.SimpleImmutableEntry<Data, Data>(dataKey, dataValue));
            }

            EntryEventType eventType;
            if (valueAfterProcess == null) {
                recordStore.remove(dataKey);
                mapStats.incrementRemoves(getLatencyFrom(start));
                eventType = EntryEventType.REMOVED;
            } else {
View Full Code Here

                    recordStore.putFromLoad(dataKey, dataValue, -1);
                } else {
                    dataOldValue = mapService.toData(recordStore.put(dataKey, dataValue, -1));
                }
                mapService.interceptAfterPut(name, dataValue);
                EntryEventType eventType = dataOldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
                mapService.publishEvent(getCallerAddress(), name, eventType, dataKey, dataOldValue, dataValue);
                keysToInvalidate.add(dataKey);
                if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
                    Record record = recordStore.getRecord(dataKey);
                    final SimpleEntryView entryView = mapService.createSimpleEntryView(dataKey,mapService.toData(dataValue),record);
View Full Code Here

    }

    public void afterRun() {
        if (evicted) {
            mapService.interceptAfterRemove(name, dataValue);
            EntryEventType eventType = EntryEventType.EVICTED;
            mapService.publishEvent(getCallerAddress(), name, eventType, dataKey, dataValue, null);
            invalidateNearCaches();
        }
    }
View Full Code Here

        private void handleEvent(EntryEvent<Object, Object> event) {
            if (endpoint.live()) {
                Object key = event.getKey();
                Object value = event.getValue();
                Object oldValue = event.getOldValue();
                EntryEventType eventType = event.getEventType();
                String uuid = event.getMember().getUuid();
                Portable portableEntryEvent = new ReplicatedMapPortableEntryEvent(key, value, oldValue, eventType, uuid);
                endpoint.sendEvent(portableEntryEvent, getCallId());
            }
        }
View Full Code Here

    boolean scheduleTtlEntry(long delayMillis, K key, V object) {
        return ttlEvictionScheduler.schedule(delayMillis, key, object);
    }

    void fireEntryListenerEvent(Object key, Object oldValue, Object value) {
        EntryEventType eventType =
                value == null ? EntryEventType.REMOVED : oldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
        EntryEvent event = new EntryEvent(getName(), localMember, eventType.getType(), key, oldValue, value);

        Collection<EventRegistration> registrations = eventService.getRegistrations(ReplicatedMapService.SERVICE_NAME, getName());
        if (registrations.size() > 0) {
            eventService.publishEvent(ReplicatedMapService.SERVICE_NAME, registrations, event, getName().hashCode());
        }
View Full Code Here

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

            if (result != null) {
                dataValue = mapServiceContext.toData(result);
                response.add(new AbstractMap.SimpleImmutableEntry<Data, Data>(key, dataValue));
            }

            EntryEventType eventType;
            if (valueAfterProcess == null) {
                recordStore.remove(key);
                mapStats.incrementRemoves(getLatencyFrom(start));
                eventType = EntryEventType.REMOVED;
            } else {
View Full Code Here

                    recordStore.putFromLoad(dataKey, dataValue, -1);
                } else {
                    dataOldValue = mapServiceContext.toData(recordStore.put(dataKey, dataValue, -1));
                }
                mapServiceContext.interceptAfterPut(name, dataValue);
                EntryEventType eventType = dataOldValue == null ? EntryEventType.ADDED : EntryEventType.UPDATED;
                final MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
                mapEventPublisher.publishEvent(getCallerAddress(), name, eventType, dataKey, dataOldValue, dataValue);
                keysToInvalidate.add(dataKey);
                if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
                    Record record = recordStore.getRecord(dataKey);
View Full Code Here

    }

    public void afterRun() {
        if (evicted) {
            mapService.getMapServiceContext().interceptAfterRemove(name, dataValue);
            EntryEventType eventType = EntryEventType.EVICTED;
            mapService.getMapServiceContext().getMapEventPublisher()
                    .publishEvent(getCallerAddress(), name, eventType, dataKey, dataValue, null);
            invalidateNearCaches();
        }
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.EntryEventType

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.