Class LocalAlluxioCluster


  • @NotThreadSafe
    public final class LocalAlluxioCluster
    extends AbstractLocalAlluxioCluster
    Local Alluxio cluster for integration tests. Example to use
     // Create a cluster instance
     localAlluxioCluster = new LocalAlluxioCluster(WORKER_CAPACITY_BYTES, BLOCK_SIZE_BYTES);
     // If you have special conf parameter to set for integration tests:
     AlluxioConfiguration testConf = localAlluxioCluster.newTestConf();
     testConf.set(Constants.USER_FILE_BUFFER_BYTES, String.valueOf(BUFFER_BYTES));
     // After setting up the test conf, start this local cluster:
     localAlluxioCluster.start(testConf);
     
    • Constructor Detail

      • LocalAlluxioCluster

        public LocalAlluxioCluster()
        Runs a test Alluxio cluster with a single Alluxio worker.
      • LocalAlluxioCluster

        public LocalAlluxioCluster​(int numWorkers,
                                   boolean includeSecondary,
                                   boolean includeProxy)
        Parameters:
        numWorkers - the number of workers to run
        includeSecondary - weather to include the secondary master
        includeProxy - weather to include the proxy
      • LocalAlluxioCluster

        public LocalAlluxioCluster​(int numWorkers,
                                   boolean includeSecondary)
        Parameters:
        numWorkers - the number of workers to run
        includeSecondary - weather to include the secondary master
    • Method Detail

      • getClient

        public alluxio.client.file.FileSystem getClient​(alluxio.client.file.FileSystemContext context)
                                                 throws java.io.IOException
        Specified by:
        getClient in class AbstractLocalAlluxioCluster
        Parameters:
        context - the FileSystemContext to use
        Returns:
        a FileSystem client, using a specific context
        Throws:
        java.io.IOException
      • getHostname

        public java.lang.String getHostname()
        Returns:
        the hostname of the cluster
      • getMasterURI

        public java.lang.String getMasterURI()
        Returns:
        the URI of the master
      • getMasterRpcPort

        public int getMasterRpcPort()
        Returns:
        the RPC port of the master
      • getAlluxioHome

        public java.lang.String getAlluxioHome()
        Returns:
        the home path to Alluxio
      • getWorkerProcess

        public alluxio.worker.WorkerProcess getWorkerProcess()
        Returns:
        the first worker
      • getWorkerAddress

        public alluxio.wire.WorkerNetAddress getWorkerAddress()
        Returns:
        the address of the first worker
      • initConfiguration

        public void initConfiguration​(java.lang.String name)
                               throws java.io.IOException
        Description copied from class: AbstractLocalAlluxioCluster
        Creates a default Configuration for testing.
        Specified by:
        initConfiguration in class AbstractLocalAlluxioCluster
        Parameters:
        name - the name of the test/cluster
        Throws:
        java.io.IOException