예제 #1
0
 @Override
 public String getNodeStatistics() {
   StringBuilder str = new StringBuilder("Nodes:");
   for (Node node : clusterClient.getNodes()) {
     str.append("[nodeId=" + node.getId() + ", partitions=[" + node.getPartitionIds() + "]],");
   }
   return str.toString();
 }
예제 #2
0
  public boolean isAvailable() {
    if (_serverNode != null && _serverNode.isAvailable() == _available) return _available;

    try {
      Thread.sleep(1000);
      _serverNode = _clusterClient.getNodeWithId(_id);
      if (_serverNode != null && _serverNode.isAvailable() == _available) return _available;
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
    _available = (_serverNode != null ? _serverNode.isAvailable() : false);

    return _available;
  }