protected AbstractMember(Address address, MemberVersion version, String uuid, Map<String, Object> attributes, boolean liteMember) { assert address != null : "Address is required!"; this.address = address; this.version = version; this.uuid = uuid != null ? uuid : "<" + address.toString() + ">"; if (attributes != null) { this.attributes.putAll(attributes); } this.liteMember = liteMember; }
protected AbstractMember(Address address, MemberVersion version, String uuid, Map<String, Object> attributes, boolean liteMember) { assert address != null : "Address is required!"; this.address = address; this.version = version; this.uuid = uuid != null ? uuid : "<" + address.toString() + ">"; if (attributes != null) { this.attributes.putAll(attributes); } this.liteMember = liteMember; }
private String getThisNodesAddress() { Address thisAddress = context.getThisNodesAddress(); return thisAddress.toString(); } }
private String getThisNodesAddress() { Address thisAddress = context.getThisNodesAddress(); return thisAddress.toString(); } }
private String getThisNodesAddress() { Address thisAddress = nodeEngine.getThisAddress(); return thisAddress.toString(); } }
private String getThisNodesAddress() { Address thisAddress = nodeEngine.getThisAddress(); return thisAddress.toString(); } }
@ManagedAnnotation("address") @ManagedDescription("Address of the node") public String getName() { return managedObject.address.toString(); }
@ManagedAnnotation("address") @ManagedDescription("Address of the node") public String getName() { return managedObject.address.toString(); }
protected String getThisNodesAddress() { return mapServiceContext.getNodeEngine().getThisAddress().toString(); }
protected String getThisNodesAddress() { return mapServiceContext.getNodeEngine().getThisAddress().toString(); }
@ManagedAnnotation("masterAddress") @ManagedDescription("The master address of the cluster") public String getMasterAddress() { Address masterAddress = managedObject.getMasterAddress(); return masterAddress == null ? null : masterAddress.toString(); } }
@ManagedAnnotation("masterAddress") @ManagedDescription("The master address of the cluster") public String getMasterAddress() { Address masterAddress = managedObject.getMasterAddress(); return masterAddress == null ? null : masterAddress.toString(); } }
public void publishMultiMapEvent(String mapName, EntryEventType eventType, int numberOfEntriesAffected) { EventService eventService = nodeEngine.getEventService(); Collection<EventRegistration> registrations = eventService.getRegistrations(MultiMapService.SERVICE_NAME, mapName); if (registrations.isEmpty()) { return; } Address caller = nodeEngine.getThisAddress(); String source = caller.toString(); MapEventData mapEventData = new MapEventData(source, mapName, caller, eventType.getType(), numberOfEntriesAffected); eventService.publishEvent(MultiMapService.SERVICE_NAME, registrations, mapEventData, mapName.hashCode()); }
public void publishMultiMapEvent(String mapName, EntryEventType eventType, int numberOfEntriesAffected) { EventService eventService = nodeEngine.getEventService(); Collection<EventRegistration> registrations = eventService.getRegistrations(MultiMapService.SERVICE_NAME, mapName); if (registrations.isEmpty()) { return; } Address caller = nodeEngine.getThisAddress(); String source = caller.toString(); MapEventData mapEventData = new MapEventData(source, mapName, caller, eventType.getType(), numberOfEntriesAffected); eventService.publishEvent(MultiMapService.SERVICE_NAME, registrations, mapEventData, mapName.hashCode()); }
@Override public boolean ownPartition(Address address, int index, Integer partitionId) { if (!hasNode(address)) { String error = "Address does not belong to this group: " + address.toString(); LOGGER.warning(error); return false; } if (containsPartition(partitionId)) { if (LOGGER.isFinestEnabled()) { LOGGER.finest("Partition[" + partitionId + "] is already owned by this group!"); } return false; } groupPartitionTable.add(index, partitionId); return nodePartitionTables.get(address).add(index, partitionId); }
private void addEventToQueryCache(Record record) { EntryEventData eventData = new EntryEventData(thisAddress.toString(), name, thisAddress, record.getKey(), mapServiceContext.toData(record.getValue()), null, null, ADDED.getType()); mapEventPublisher.addEventToQueryCache(eventData); }
private static void addResponse(JsonObject root, Address address, boolean success, String result, String stackTrace) { JsonObject json = new JsonObject(); json.add("success", success); json.add("result", result); json.add("stackTrace", stackTrace != null ? Json.value(stackTrace) : Json.NULL); root.add(address.toString(), json); } }
private static void addResponse(JsonObject root, Address address, boolean success, String result, String stackTrace) { JsonObject json = new JsonObject(); json.add("success", success); json.add("result", result); json.add("stackTrace", stackTrace != null ? Json.value(stackTrace) : Json.NULL); root.add(address.toString(), json); } }
private void addEventToQueryCache(Record record) { EntryEventData eventData = new EntryEventData(thisAddress.toString(), name, thisAddress, record.getKey(), mapServiceContext.toData(record.getValue()), null, null, ADDED.getType()); mapEventPublisher.addEventToQueryCache(eventData); }
public final void publishEntryEvent(String multiMapName, EntryEventType eventType, Data key, Object newValue, Object oldValue) { EventService eventService = nodeEngine.getEventService(); Collection<EventRegistration> registrations = eventService.getRegistrations(MultiMapService.SERVICE_NAME, multiMapName); for (EventRegistration registration : registrations) { MultiMapEventFilter filter = (MultiMapEventFilter) registration.getFilter(); if (filter.getKey() == null || filter.getKey().equals(key)) { Data dataNewValue = filter.isIncludeValue() ? nodeEngine.toData(newValue) : null; Data dataOldValue = filter.isIncludeValue() ? nodeEngine.toData(oldValue) : null; Address caller = nodeEngine.getThisAddress(); String source = caller.toString(); EntryEventData event = new EntryEventData(source, multiMapName, caller, key, dataNewValue, dataOldValue, eventType.getType()); eventService.publishEvent(MultiMapService.SERVICE_NAME, registration, event, multiMapName.hashCode()); } } } }