Hi all,
  I'm writing a distributed queue monitoring class for our leader node in
the cluster.  We're queueing messages per input hardware device, this queue
is then assigned to a node with the least load in our cluster.  To do this,
I maintain 2 Persistent Znode with the following format.

data queue

/dataqueue/devices/<unit id>/<data packet>

processing follower

/dataqueue/nodes/<node name>/<unit id>

The queue monitor watches for changes on the path of /dataqueue/devices.
 When the first packet from a unit is received, the queue writer will create
the queue with the unit id.  This triggers the watch event on the monitoring
class, which in turn creates the znode for the path with the least loaded
node.  This path is watched for child node creation and the node creates a
queue consumer to consume messages from the new queue.


Our list of queues can become quite large, and I would prefer not to
maintain a list of queues I have assigned then perform a delta when the
event fires to determine which queues are new and caused the watch event. I
can't really use sequenced nodes and keep track of my last read position,
because I don't want to iterate over the list of queues to determine which
sequenced node belongs to the current unit id (it would require full
iteration, which really doesn't save me any reads).  Is it possible to
create a watch to return the path and Stat of the child node that caused the
event to fire?

Thanks,
Todd

Reply via email to