Class Commands.LastSnapshotCommand
java.lang.Object
org.apache.zookeeper.server.admin.CommandBase
org.apache.zookeeper.server.admin.GetCommand
org.apache.zookeeper.server.admin.Commands.LastSnapshotCommand
- All Implemented Interfaces:
Command
- Enclosing class:
Commands
Command returns information of the last snapshot that zookeeper server
has finished saving to disk. During the time between the server starts up
and it finishes saving its first snapshot, the command returns the zxid
and last modified time of the snapshot file used for restoration at
server startup. Returned map contains:
- "zxid": String
- "timestamp": Long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrunGet
(ZooKeeperServer zkServer, Map<String, String> kwargs) Run this command for HTTP GET request.Methods inherited from class org.apache.zookeeper.server.admin.GetCommand
runPost
Methods inherited from class org.apache.zookeeper.server.admin.CommandBase
getAuthRequest, getNames, getPrimaryName, initializeResponse, isServerRequired
-
Constructor Details
-
LastSnapshotCommand
public LastSnapshotCommand()
-
-
Method Details
-
runGet
Description copied from interface:Command
Run this command for HTTP GET request. Commands take a ZooKeeperServer, String-valued keyword arguments and return a CommandResponse object containing any information constituting the response to the command. Commands are responsible for parsing keyword arguments and performing any error handling if necessary. Errors should be reported by setting the "error" entry of the returned map with an appropriate message rather than throwing an exception.- Parameters:
zkServer
- ZooKeeper serverkwargs
- keyword -> argument value mapping- Returns:
- CommandResponse representing response to command containing at minimum: - "command" key containing the command's primary name - "error" key containing a String error message or null if no error
-