Class OortMasterLong

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
All Implemented Interfaces:
EventListener, Bayeux.BayeuxListener, ConfigurableServerChannel.ServerChannelListener, ServerChannel.MessageListener, org.eclipse.jetty.util.component.LifeCycle

public class OortMasterLong
extends OortMasterService<Long,​OortMasterLong.Context>

A distributed counter service to be deployed on a Oort cluster that modifies a long value hosted in a "master" node.

Instances of this service may be used as unique ID generator, or as unique counter across the cluster, for example to aggregate values from different nodes, such as the number of users connected to each node.

Applications may call methods addAndGet(long, Callback) or getAndAdd(long, Callback) providing the amount to add (it may be negative) and a OortMasterLong.Callback object that will be invoked on the requesting node when the result has been computed and transmitted back by the "master" node.