Class ElasticsearchNodeCommand

    • Field Detail

      • FAILED_TO_OBTAIN_NODE_LOCK_MSG

        protected static final java.lang.String FAILED_TO_OBTAIN_NODE_LOCK_MSG
        See Also:
        Constant Field Values
      • GLOBAL_GENERATION_MISSING_MSG

        protected static final java.lang.String GLOBAL_GENERATION_MISSING_MSG
        See Also:
        Constant Field Values
      • ABORTED_BY_USER_MSG

        protected static final java.lang.String ABORTED_BY_USER_MSG
        See Also:
        Constant Field Values
    • Constructor Detail

      • ElasticsearchNodeCommand

        public ElasticsearchNodeCommand​(java.lang.String description)
    • Method Detail

      • processNodePathsWithLock

        protected void processNodePathsWithLock​(Terminal terminal,
                                                joptsimple.OptionSet options,
                                                Environment env)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • loadMetaData

        protected Tuple<Manifest,​MetaData> loadMetaData​(Terminal terminal,
                                                              java.nio.file.Path[] dataPaths)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • confirm

        protected void confirm​(Terminal terminal,
                               java.lang.String msg)
      • validateBeforeLock

        protected boolean validateBeforeLock​(Terminal terminal,
                                             Environment env)
        Validate that the command can run before taking any locks.
        Parameters:
        terminal - the terminal to print to
        env - the env to validate.
        Returns:
        true to continue, false to stop (must print message in validate).
      • processNodePaths

        protected abstract void processNodePaths​(Terminal terminal,
                                                 java.nio.file.Path[] dataPaths,
                                                 Environment env)
                                          throws java.io.IOException
        Process the paths. Locks for the paths is held during this method invocation.
        Parameters:
        terminal - the terminal to use for messages
        dataPaths - the paths of the node to process
        env - the env of the node to process
        Throws:
        java.io.IOException
      • writeNewMetaData

        protected void writeNewMetaData​(Terminal terminal,
                                        Manifest oldManifest,
                                        long newCurrentTerm,
                                        MetaData oldMetaData,
                                        MetaData newMetaData,
                                        java.nio.file.Path[] dataPaths)