Class LocalAlluxioMaster


  • @NotThreadSafe
    public final class LocalAlluxioMaster
    extends java.lang.Object
    Constructs an isolated master. Primary users of this class are the LocalAlluxioCluster and MultiMasterLocalAlluxioCluster. Isolated is defined as having its own root directory, and port.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearClients()
      Clears all the clients.
      static LocalAlluxioMaster create​(boolean includeSecondary)
      Creates a new local Alluxio master with an isolated work directory and port.
      static LocalAlluxioMaster create​(java.lang.String workDirectory, boolean includeSecondary)
      Creates a new local Alluxio master with a isolated port.
      java.net.InetSocketAddress getAddress()  
      alluxio.client.file.FileSystem getClient()  
      alluxio.client.file.FileSystem getClient​(alluxio.client.file.FileSystemContext context)  
      java.lang.String getJournalFolder()  
      alluxio.master.AlluxioMasterProcess getMasterProcess()  
      int getRpcLocalPort()
      Gets the actual port that the RPC service is listening on.
      java.lang.String getUri()  
      boolean isServing()  
      void start()
      Starts the master.
      void stop()
      Stops the master processes and cleans up client connections.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static LocalAlluxioMaster create​(boolean includeSecondary)
                                         throws java.io.IOException
        Creates a new local Alluxio master with an isolated work directory and port.
        Parameters:
        includeSecondary - whether to start a secondary master alongside the regular master
        Returns:
        an instance of Alluxio master
        Throws:
        java.io.IOException
      • create

        public static LocalAlluxioMaster create​(java.lang.String workDirectory,
                                                boolean includeSecondary)
                                         throws java.io.IOException
        Creates a new local Alluxio master with a isolated port.
        Parameters:
        workDirectory - Alluxio work directory, this method will create it if it doesn't exist yet
        includeSecondary - whether to start a secondary master alongside the regular master
        Returns:
        the created Alluxio master
        Throws:
        java.io.IOException
      • start

        public void start()
        Starts the master.
      • isServing

        public boolean isServing()
        Returns:
        true if the master is serving, false otherwise
      • stop

        public void stop()
                  throws java.lang.Exception
        Stops the master processes and cleans up client connections.
        Throws:
        java.lang.Exception
      • clearClients

        public void clearClients()
                          throws java.io.IOException
        Clears all the clients.
        Throws:
        java.io.IOException
      • getAddress

        public java.net.InetSocketAddress getAddress()
        Returns:
        the externally resolvable address of the master
      • getMasterProcess

        public alluxio.master.AlluxioMasterProcess getMasterProcess()
        Returns:
        the internal MasterProcess
      • getRpcLocalPort

        public int getRpcLocalPort()
        Gets the actual port that the RPC service is listening on.
        Returns:
        the RPC local port
      • getUri

        public java.lang.String getUri()
        Returns:
        the URI of the master
      • getClient

        public alluxio.client.file.FileSystem getClient()
                                                 throws java.io.IOException
        Returns:
        the client from the pool
        Throws:
        java.io.IOException
      • getClient

        public alluxio.client.file.FileSystem getClient​(alluxio.client.file.FileSystemContext context)
                                                 throws java.io.IOException
        Parameters:
        context - the FileSystemContext to use
        Returns:
        the client from the pool, using a specific context
        Throws:
        java.io.IOException
      • getJournalFolder

        public java.lang.String getJournalFolder()
        Returns:
        the folder of the journal