java.lang.Object
java.util.AbstractCollection<URL>
java.util.AbstractList<URL>
java.util.ArrayList<URL>
com.gpudb.WorkerList
All Implemented Interfaces:
Direct Known Subclasses:
A list of worker URLs to use for multi-head operations.
See Also:
Field Summary
Fields inherited from class java.util.AbstractList
modCountConstructor Summary
ConstructorsConstructorDescriptionCreates an emptyWorkerListthat can be populated manually with worker URLs to support multi-head operations.WorkerList(GPUdb gpudb) Creates aWorkerListand automatically populates it with the worker URLs from GPUdb to support multi-head operations.WorkerList(GPUdb gpudb, String ipPrefix) Creates aWorkerListand automatically populates it with the worker URLs from GPUdb to support multi-head operations.WorkerList(GPUdb gpudb, Pattern ipRegex) Creates aWorkerListand automatically populates it with the worker URLs from GPUdb to support multi-head operations.WorkerList(List<URL> urls) Creates aWorkerListpopulated with the given URLs.Method Summary
Modifier and TypeMethodDescriptionGets the regular expression used to filter this worker list, if one were specified during creation.booleanChecks whether multi-head I/O is enabled in the server configuration.booleanChecks whether this worker list was created by querying the given server for the URLs, or instead, whether they were given explicitly.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
Constructor Details
WorkerList
public WorkerList()Creates an emptyWorkerListthat 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
Creates aWorkerListand 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 anIP regexor anIP prefix.Parameters:gpudb- theGPUdbinstance from which to obtain the worker URLsThrows:GPUdbException- if an error occurs during the request for worker URLsWorkerList
Creates aWorkerListand 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 optionalipRegexparameter 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- theGPUdbinstance from which to obtain the worker URLsipRegex- optional IP regex to matchThrows: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 workersWorkerList
Creates aWorkerListand 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 optionalipPrefixparameter 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- theGPUdbinstance from which to obtain the worker URLsipPrefix- optional IP prefix to matchThrows: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 Details
isMultiHeadEnabled
public boolean isMultiHeadEnabled()Checks whether multi-head I/O is enabled in the server configuration.Returns:a boolean indicating whether multi-head I/O is enabled on the server.isQueriedUrlList
public boolean isQueriedUrlList()Checks whether this worker list was created by querying the given server for the URLs, or instead, whether they were given explicitly.Returns:a boolean indicating whether this worker list was created via a server query.