Interface Command

    • Method Detail

      • getNames

        Set<String> getNames()
        The set of all names that can be used to refer to this command (e.g., "configuration", "config", and "conf").
      • getPrimaryName

        String getPrimaryName()
        The name that is returned with the command response and that appears in the list of all commands. This should be a member of the set returned by getNames().
      • getDoc

        String getDoc()
        A string documenting this command (e.g., what it does, any arguments it takes).
      • isServerRequired

        boolean isServerRequired()
        Returns:
        true if the command requires an active ZooKeeperServer or a synced peer in order to resolve
      • run

        CommandResponse run​(ZooKeeperServer zkServer,
                            Map<String,​String> kwargs)
        Run this command. Commands take a ZooKeeperServer and String-valued keyword arguments and return a map 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 -
        kwargs - keyword -> argument value mapping
        Returns:
        Map 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