Package com.gpudb
Class WorkerList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<URL>
-
- com.gpudb.WorkerList
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<URL>,Collection<URL>,List<URL>,RandomAccess
- Direct Known Subclasses:
BulkInserter.WorkerList
public class WorkerList extends ArrayList<URL>
A list of worker URLs to use for multi-head operations.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description WorkerList()Creates 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatterngetIpRegex()booleanisMultiHeadEnabled()return a boolean indicating whether multi-head I/O is enabled at the server.-
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, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
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
public WorkerList(GPUdb gpudb) throws GPUdbException
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 URLs- Throws:
GPUdbException- if an error occurs during the request for worker URLs
-
WorkerList
public WorkerList(GPUdb gpudb, Pattern ipRegex) throws GPUdbException
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 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 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 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.
-
-