@Override
 public void afterStart() {
   String path = ZKPaths.makePath(getZooKeeperPath(), address.toString());
   byte[] data = address.toString().getBytes(US_ASCII);
   node = new PersistentNode(client, CreateMode.EPHEMERAL, false, path, data);
   node.start();
 }
Ejemplo n.º 2
0
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }

      Version version = (Version) o;
      return destination.equals(version.destination);
    }
Ejemplo n.º 3
0
  @Override
  public void messageArrived(CellMessage msg) {
    Object obj = msg.getMessageObject();
    _requests++;
    if (obj instanceof PoolFlushGainControlMessage) {

      poolFlushGainControlMessageArrived((PoolFlushGainControlMessage) obj);

    } else if (obj instanceof PoolFlushDoFlushMessage) {

      poolFlushDoFlushMessageArrived((PoolFlushDoFlushMessage) obj);

    } else if (obj instanceof PoolManagerPoolModeMessage) {

      poolModeInfoArrived((PoolManagerPoolModeMessage) obj);

    } else if (obj instanceof PoolStatusChangedMessage) {

      poolStatusChanged((PoolStatusChangedMessage) obj);

    } else if (obj instanceof NoRouteToCellException) {

      NoRouteToCellException nrtc = (NoRouteToCellException) obj;
      CellPath path = nrtc.getDestinationPath();
      CellAddressCore core = path.getDestinationAddress();
      String cellName = core.getCellName();
      _log.warn("NoRouteToCell : " + cellName + " (" + path + ")");

      poolFlushGainControlMessageDidntArrive(cellName);

    } else {
      _log.warn(
          "Unknown message arrived (" + msg.getSourcePath() + ") : " + msg.getMessageObject());
      _failed++;
    }
  }
Ejemplo n.º 4
0
 @Override
 public String toString() {
   return destination.toString();
 }
Ejemplo n.º 5
0
 @Override
 public int hashCode() {
   return destination.hashCode();
 }