use of org.apache.zookeeper_voltpatches.proto.WatcherEvent in project voltdb by VoltDB.
the class NIOServerCnxn method process.
/*
* (non-Javadoc)
*
* @see org.apache.zookeeper.server.ServerCnxnIface#process(org.apache.zookeeper.proto.WatcherEvent)
*/
@Override
public synchronized void process(WatchedEvent event) {
ReplyHeader h = new ReplyHeader(-1, -1L, 0);
if (LOG.isTraceEnabled()) {
ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK, "Deliver event " + event + " to 0x" + Long.toHexString(this.sessionId) + " through " + this);
}
// Convert WatchedEvent to a type that can be sent over the wire
WatcherEvent e = event.getWrapper();
sendResponse(h, e, "notification");
}
use of org.apache.zookeeper_voltpatches.proto.WatcherEvent in project voltdb by VoltDB.
the class WatcherEvent method equals.
@Override
public boolean equals(Object peer_) {
if (!(peer_ instanceof WatcherEvent)) {
return false;
}
if (peer_ == this) {
return true;
}
WatcherEvent peer = (WatcherEvent) peer_;
boolean ret = false;
ret = (type == peer.type);
if (!ret)
return ret;
ret = (state == peer.state);
if (!ret)
return ret;
ret = path.equals(peer.path);
if (!ret)
return ret;
return ret;
}
use of org.apache.zookeeper_voltpatches.proto.WatcherEvent in project voltdb by VoltDB.
the class WatcherEvent method compareTo.
public int compareTo(Object peer_) throws ClassCastException {
if (!(peer_ instanceof WatcherEvent)) {
throw new ClassCastException("Comparing different types of records.");
}
WatcherEvent peer = (WatcherEvent) peer_;
int ret = 0;
ret = (type == peer.type) ? 0 : ((type < peer.type) ? -1 : 1);
if (ret != 0)
return ret;
ret = (state == peer.state) ? 0 : ((state < peer.state) ? -1 : 1);
if (ret != 0)
return ret;
ret = path.compareTo(peer.path);
if (ret != 0)
return ret;
return ret;
}
Aggregations