public class ESSequenceGeneratorComponent extends DefaultComponent implements SequenceGenerator
SequenceGenerator service on top of Elasticsearch. 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 http://blogs.perl.org/users/clinton_gormley/2011/10/elasticsearchsequence-- -a-blazing-fast-ticket-server.html| Modifier and Type | Field and Description |
|---|---|
static String |
IDX_NAME |
static String |
IDX_TYPE |
| Constructor and Description |
|---|
ESSequenceGeneratorComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
long |
getNextId(String sequenceName)
For the given sequence name, increment it and return the value
|
activate, applicationStarted, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, unregisterContribution, unregisterExtensionpublic static final String IDX_NAME
public static final String IDX_TYPE
public long getNextId(String sequenceName)
SequenceGeneratorgetNextId in interface SequenceGeneratorsequenceName - the name of the sequencepublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextCopyright © 2015 Nuxeo SA. All rights reserved.