com.hazelcast.nio.Address.toString()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中com.hazelcast.nio.Address.toString()方法的一些代码示例,展示了Address.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.toString()方法的具体详情如下:
包路径:com.hazelcast.nio.Address
类名称:Address
方法名:toString

Address.toString介绍

暂无

代码示例

代码示例来源:origin: com.hazelcast/hazelcast-all

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;
}

代码示例来源:origin: hazelcast/hazelcast-jet

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;
}

代码示例来源:origin: hazelcast/hazelcast-jet

private String getThisNodesAddress() {
    Address thisAddress = context.getThisNodesAddress();
    return thisAddress.toString();
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private String getThisNodesAddress() {
    Address thisAddress = context.getThisNodesAddress();
    return thisAddress.toString();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

private String getThisNodesAddress() {
    Address thisAddress = nodeEngine.getThisAddress();
    return thisAddress.toString();
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private String getThisNodesAddress() {
    Address thisAddress = nodeEngine.getThisAddress();
    return thisAddress.toString();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

@ManagedAnnotation("address")
@ManagedDescription("Address of the node")
public String getName() {
  return managedObject.address.toString();
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@ManagedAnnotation("address")
@ManagedDescription("Address of the node")
public String getName() {
  return managedObject.address.toString();
}

代码示例来源:origin: hazelcast/hazelcast-jet

protected String getThisNodesAddress() {
  return mapServiceContext.getNodeEngine().getThisAddress().toString();
}

代码示例来源:origin: com.hazelcast/hazelcast-all

protected String getThisNodesAddress() {
  return mapServiceContext.getNodeEngine().getThisAddress().toString();
}

代码示例来源:origin: hazelcast/hazelcast-jet

@ManagedAnnotation("masterAddress")
  @ManagedDescription("The master address of the cluster")
  public String getMasterAddress() {
    Address masterAddress = managedObject.getMasterAddress();
    return masterAddress == null ? null : masterAddress.toString();
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@ManagedAnnotation("masterAddress")
  @ManagedDescription("The master address of the cluster")
  public String getMasterAddress() {
    Address masterAddress = managedObject.getMasterAddress();
    return masterAddress == null ? null : masterAddress.toString();
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

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());
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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());
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

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);
}

代码示例来源:origin: hazelcast/hazelcast-jet

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());
      }
    }
  }
}

相关文章