Package com.gpudb

Class WorkerList

    • Constructor Detail

      • WorkerList

        public WorkerList()
        Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head operations. Note that worker URLs must be added in rank order, starting with rank 1, and all worker ranks must be included; otherwise operations may fail for certain data types.
      • WorkerList

        public WorkerList​(GPUdb gpudb)
                   throws GPUdbException
        Creates a WorkerList and automatically populates it with the worker URLs from GPUdb to support multi-head operations. (If the specified GPUdb instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.) Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; this constructor uses the first IP returned by the server for each worker. To override this behavior, use one of the alternate constructors that accepts an IP regex or an IP prefix.
        Parameters:
        gpudb - the GPUdb instance from which to obtain the worker URLs
        Throws:
        GPUdbException - if an error occurs during the request for worker URLs
      • WorkerList

        public WorkerList​(GPUdb gpudb,
                          Pattern ipRegex)
                   throws GPUdbException
        Creates a WorkerList and automatically populates it with the worker URLs from GPUdb to support multi-head operations. (If the specified GPUdb instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.) Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; the optional ipRegex parameter can be used in such cases to filter for an IP range that is accessible, e.g., a regex of "192\.168\..*" will use worker IP addresses in the 192.168.* range.
        Parameters:
        gpudb - the GPUdb instance from which to obtain the worker URLs
        ipRegex - optional IP regex to match
        Throws:
        GPUdbException - if an error occurs during the request for worker URLs or no IP addresses matching the IP regex could be found for one or more workers
      • WorkerList

        public WorkerList​(GPUdb gpudb,
                          String ipPrefix)
                   throws GPUdbException
        Creates a WorkerList and automatically populates it with the worker URLs from GPUdb to support multi-head operations. (If the specified GPUdb instance has multi-head operations disabled, the worker list will be empty and multi-head operations will not be used.) Note that in some cases, workers may be configured to use more than one IP address, not all of which may be accessible to the client; the optional ipPrefix parameter can be used in such cases to filter for an IP range that is accessible, e.g., a prefix of "192.168." will use worker IP addresses in the 192.168.* range.
        Parameters:
        gpudb - the GPUdb instance from which to obtain the worker URLs
        ipPrefix - optional IP prefix to match
        Throws:
        GPUdbException - if an error occurs during the request for worker URLs or no IP addresses matching the IP prefix could be found for one or more workers
    • Method Detail

      • getIpRegex

        public Pattern getIpRegex()
        Returns:
        the IP regular expression used to create this worker list.
      • isMultiHeadEnabled

        public boolean isMultiHeadEnabled()
        return a boolean indicating whether multi-head I/O is enabled at the server.