Hi,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to [email protected] and follow simple instructions in
the reply.


waterg wrote
> Hello everyone, 
> 
> I've just started using Ignite for couple months. And hope to get some
> help from better using Ignite.
> I have a single node Ignite and another client application that will
> connect to the server (cluster in future) that process a batch data. The
> automicSequence has a 1000 reserveSize. I'm using AtomicSequence to
> generate ids. what I noticed is that, the first time the client connects
> the sequence starts from 1, and second it start from 1000, and third it
> starts from 2000 and so on. 
> I was hoping the sequence serveSize would only include server nodes, not
> client nodes. Could I change the configuration to make it perform the
> following activity?
> 
> 1)The client connects first time it creates it the sequence starts from 1.
> Let's say when it disconnects, the sequence has grown to 100.  The second
> the client connects, it gets the existing sequence, and the next number it
> gets will become 101.
> 
> 2) In a cluster environment, if the data will end in one node, then it'll
> get the sequence from the reserve range from that particular node.
> 
> Thank you very much for your help!

The whole point of atomic sequence is that it reserves a range of values
locally on the node that uses the API (client in your case) and therefore
avoids network trips while within the range. When client stops, reservation
is lost and it has to reserve another range. To get globally sequential ID
generation, you can use IgniteAtomicLong instead, however note that it's
much slower as implies a distributed cache update on each increment.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-usage-questions-tp11098p11104.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to