public class ESUIDSequencer extends AbstractUIDSequencer
UIDSequencer
.
Since elasticsearch does not seem to support a notion of native sequence, the implementation uses the auto-increment of the version attribute as described in the ElasticSearch::Sequence - a blazing fast ticket server blog post.
Modifier and Type | Field and Description |
---|---|
protected org.elasticsearch.client.Client |
esClient |
name
Constructor and Description |
---|
ESUIDSequencer() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Cleanup callback
|
protected void |
ensureESIndex(org.elasticsearch.client.Client esClient) |
protected org.elasticsearch.client.Client |
getClient() |
protected String |
getESIndexName() |
int |
getNext(String sequenceName)
For the given key returns the incremented UID which is also stored in the same sequence entry.
|
long |
getNextLong(String sequenceName)
Extends
UIDSequencer.getNext(java.lang.String) to return a long value. |
void |
init()
Init Sequencer
|
getName, initSequence, setName
protected org.elasticsearch.client.Client esClient
public ESUIDSequencer()
protected org.elasticsearch.client.Client getClient()
public void dispose()
UIDSequencer
dispose
in interface UIDSequencer
dispose
in class AbstractUIDSequencer
public long getNextLong(String sequenceName)
UIDSequencer
UIDSequencer.getNext(java.lang.String)
to return a long value. This method is compatible
with getNext in the integer range.getNextLong
in interface UIDSequencer
getNextLong
in class AbstractUIDSequencer
public int getNext(String sequenceName)
UIDSequencer
getNext
in interface UIDSequencer
getNext
in class AbstractUIDSequencer
public void init()
UIDSequencer
init
in interface UIDSequencer
init
in class AbstractUIDSequencer
protected void ensureESIndex(org.elasticsearch.client.Client esClient)
protected String getESIndexName()
Copyright © 2016 Nuxeo SA. All rights reserved.