public interface XClusterManager extends Startable, Initializable
Modifier and Type | Method and Description |
---|---|
void |
archiveCommand(int commandVersion)
Archives a given command.
|
XClusterLock |
getClusterLock(String lockPath)
Returns a distributed lock unique to the given path.
|
String |
getCommandSpace()
Name of the command space to which this cluster manager is listening to.
|
int |
getCurrentCommandVersion()
Get's the current command version, which is the version of the last executed(by the command processor) command.
|
String |
getDomain() |
Optional<Integer> |
getNextSequenceNumber(String path)
Generates a distributed sequence number which is the next in line of a distributed sequence.
|
String |
getNodeName() |
CommandView |
getPublishedCommandView(int commandVersion)
Get the command view of the command with the given command version
|
Map<Integer,CommandView> |
getPublishedCommandViews(int from,
int to)
Gets the published commands between given two command versions (inclusive).
|
Status |
getStatus()
Get the cluster manager's current
Status . |
String |
publishControlCommand(String command)
This method is to be used over the REST API.
|
String |
publishControlCommand(XControlCommand command)
Publishes a command to the cluster.
|
String |
republishControlCommand(int commandVersion)
Republish a control command which was once published.
|
void |
retryCommand(int commandVersion)
Retries a given command.
|
destroy, init
XClusterLock getClusterLock(String lockPath)
XClusterLock
can be used to acquire a
lock which will guarantee a critical section between different instances of the cluster manager (project x/ultraESB)lockPath
- lock pathOptional<Integer> getNextSequenceNumber(String path)
Optional
as the result. Users have to check whether the value is available.path
- path to be used to generate the sequence numberString publishControlCommand(XControlCommand command)
XControlCommand
instance should be provided as the command. The command
will be marshaled and sent to the zookeeper for publishing the command.command
- the command to be publishedString publishControlCommand(String command)
command
- Marshaled XControlCommand
publishControlCommand(XControlCommand)
String republishControlCommand(int commandVersion)
commandVersion
- Version of the command to be republishedvoid archiveCommand(int commandVersion)
commandVersion
- sequence number of the command which is to be archivedvoid retryCommand(int commandVersion)
commandVersion
- command version number to be retriedint getCurrentCommandVersion()
Map<Integer,CommandView> getPublishedCommandViews(int from, int to)
from
- starting version from which the commands to be fetchedto
- ending version up to which commands has to be fetchedCommandView getPublishedCommandView(int commandVersion) throws Exception
commandVersion
- command versionException
- if unable to fetch the commandStatus getStatus()
Status
.String getCommandSpace()
String getNodeName()
String getDomain()
Copyright © 2016–2019 AdroitLogic. All rights reserved.