public class GetFeaturesBatchRequest
extends java.lang.Object
maxParallelRequests
configurations in the TectonClientOptions.
GetFeaturesBatchRequest uses either the /get-features or the /get-features-batch endpoint
depending on the configuration microBatchSize. By default, the microBatchSize is set to
RequestConstants.DEFAULT_MICRO_BATCH_SIZE. It can be configured to any value in the range
[ 1, RequestConstants.MAX_MICRO_BATCH_SIZE ]
For a GetFeaturesBatchRequest with a GetFeaturesRequestData of size n and a
microBatchSize of 1, the client enqueues n HTTP calls to be sent parallely to the
/get-features endpoint. The client waits until all calls are complete or a specific time
(configured with timeout) has elapsed and returns a List of GetFeaturesResponse objects of size n.
For a GetFeaturesBatchRequest with a GetFeaturesRequestData of size n and a
microBatchSize of k where k is in the range [ 1, RequestConstants.MAX_MICRO_BATCH_SIZE ], the client enqueues Math.ceil(n/k) microbatch requests
to be sent parallely to the /get-features-batch endpoint, waits until all microbatch requests are
complete or a specific configured timeout has elapsed and returns a List of GetFeaturesResponse objects of size n.
| Modifier and Type | Class and Description |
|---|---|
static class |
GetFeaturesBatchRequest.Builder
A Builder class for building instances of
GetFeaturesBatchRequest objects from values
configured by setters |
| Constructor and Description |
|---|
GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList)
Constructor that creates a new GetFeaturesBatchRequest with the specified parameters.
|
GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions)
Constructor that creates a new GetFeaturesBatchRequest with the specified parameters.
|
GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions,
int microBatchSize)
Constructor that creates a new GetFeaturesBatchRequest with the specified parameters.
|
GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions,
int microBatchSize,
java.time.Duration timeout)
Constructor that creates a new GetFeaturesBatchRequest with the specified parameters
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Overrides equals() in class
Object |
java.lang.String |
getEndpoint() |
TectonHttpClient.HttpMethod |
getMethod() |
int |
getMicroBatchSize()
Getter for microBatchSize
|
java.util.List<? extends AbstractGetFeaturesRequest> |
getRequestList()
Return Batch Request List
|
java.time.Duration |
getTimeout()
Getter for timeout
|
int |
hashCode()
Overrides hashCode() in class
Object |
public GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList)
metadataOptions defaults to RequestConstants.DEFAULT_METADATA_OPTIONS , microBatchSize defaults to RequestConstants.DEFAULT_MICRO_BATCH_SIZE and timeout defaults to NoneworkspaceName - Name of the workspace in which the Feature Service is definedfeatureServiceName - Name of the Feature Service for which the feature vectors are being
requestedrequestDataList - a List of GetFeaturesRequestData object with joinKeyMap
and/or requestContextMapTectonClientException - when workspacename or featureServiceName is empty or nullTectonClientException - when requestDataList is invalid (null/empty or contains
null/empty elements)public GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions)
microBatchSize defaults to RequestConstants.DEFAULT_MICRO_BATCH_SIZE and timeout defaults to NoneworkspaceName - Name of the workspace in which the Feature Service is definedfeatureServiceName - Name of the Feature Service for which the feature vectors are being
requestedrequestDataList - a List of GetFeaturesRequestData object with joinKeyMap
and/or requestContextMapmetadataOptions - A Set of MetadataOption for retrieving additional
metadata about the feature values. Use RequestConstants.ALL_METADATA_OPTIONS to
request all metadata and RequestConstants.NONE_METADATA_OPTIONS to request no
metadata respectively. By default, RequestConstants.DEFAULT_METADATA_OPTIONS will
be added to each requestTectonClientException - when workspaceName or featureServiceName is empty or nullTectonClientException - when requestDataList is invalid (null/empty or contains
null/empty elements)public GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions,
int microBatchSize)
timeout defaults to None.workspaceName - Name of the workspace in which the Feature Service is definedfeatureServiceName - Name of the Feature Service for which the feature vectors are being
requestedrequestDataList - a List of GetFeaturesRequestData object with joinKeyMap
and/or requestContextMapmetadataOptions - A Set of MetadataOption for retrieving additional
metadata about the feature values. Use RequestConstants.ALL_METADATA_OPTIONS to
request all metadata and RequestConstants.NONE_METADATA_OPTIONS to request no
metadata respectively. By default, RequestConstants.DEFAULT_METADATA_OPTIONS will
be added to each requestmicroBatchSize - an int value between 1 and . The client splits the GetFeaturesBatchRequest into
multiple micro batches of this size and executes them parallely. By default, the
microBatchSize is set to TectonClientException - when workspaceName or featureServiceName is empty or nullTectonClientException - when requestDataList is invalid (null/empty or contains
null/empty elements)public GetFeaturesBatchRequest(java.lang.String workspaceName,
java.lang.String featureServiceName,
java.util.List<GetFeaturesRequestData> requestDataList,
java.util.Set<MetadataOption> metadataOptions,
int microBatchSize,
java.time.Duration timeout)
workspaceName - Name of the workspace in which the Feature Service is definedfeatureServiceName - Name of the Feature Service for which the feature vectors are being
requestedrequestDataList - a List of GetFeaturesRequestData object with joinKeyMap
and/or requestContextMapmetadataOptions - metadataOptions A Set of MetadataOption for retrieving
additional metadata about the feature values. Use RequestConstants.ALL_METADATA_OPTIONS to request all metadata and RequestConstants.NONE_METADATA_OPTIONS to request no metadata respectively. By default,
RequestConstants.DEFAULT_METADATA_OPTIONS will be added to each requestmicroBatchSize - an int value between 1 and . The client splits the GetFeaturesBatchRequest into
multiple micro batches of this size and executes them parallely. By default, the
microBatchSize is set to timeout - The max time in Duration for which the client waits for the batch
requests to complete before canceling the operation and returning the partial list of
results.TectonClientException - when workspacename or featureServiceName is empty or nullTectonClientException - when requestDataList is invalid (null/empty or contains
null/empty elements)TectonClientException - when the microBatchSize is out of bounds of [ 1, ]public java.util.List<? extends AbstractGetFeaturesRequest> getRequestList()
of {@link AbstractGetFeaturesRequest} representing the list of batch
requestpublic java.time.Duration getTimeout()
Durationpublic int getMicroBatchSize()
public TectonHttpClient.HttpMethod getMethod()
public java.lang.String getEndpoint()
public boolean equals(java.lang.Object o)
Objectequals in class java.lang.Objectpublic int hashCode()
ObjecthashCode in class java.lang.Object