public abstract class GPUdbBase extends Object
GPUdb
class.
Usage patterns:
1. Unsecured setup
String url = "http://your_server_ip_or_FQDN:9191"; GPUdb.Options options = new GPUdb.Options(); options.setUsername("user"); options.setPassword("password"); GPUdb gpudb = new GPUdb( url, options );2. Secured setup
Modifier and Type | Class and Description |
---|---|
static class |
GPUdbBase.ClusterAddressInfo
Helper class which contains all possible address related information
for a given Kinetica cluster.
|
static class |
GPUdbBase.GetRecordsJsonResponse
This class models the response returned by the method
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
The default constructor is used to create instance whenever there is an error
encountered by the method getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long) . |
static class |
GPUdbBase.GPUdbExitException
A special exception indicating the server is shutting down
|
static class |
GPUdbBase.GPUdbFailoverDisabledException |
static class |
GPUdbBase.GPUdbHAUnavailableException |
static class |
GPUdbBase.GPUdbHostnameRegexFailureException |
static class |
GPUdbBase.GPUdbUnauthorizedAccessException
Indicates that there is an authorization-related problem occurred.
|
static class |
GPUdbBase.GPUdbVersion
Contains the version of the client API or the GPUdb server.
|
static class |
GPUdbBase.HAFailoverOrder
A enumeration of high-availability (inter-cluster) failover order.
|
static class |
GPUdbBase.HASynchronicityMode
A enumeration of high-availability synchronicity override modes.
|
static class |
GPUdbBase.InsertRecordsJsonRequest |
static class |
GPUdbBase.JsonOptions
This class provides options to control JSON ingest using
BulkInserter . |
static class |
GPUdbBase.Options
A set of configurable options for the GPUdb API.
|
static class |
GPUdbBase.SubmitException
An exception that occurred during the submission of a request to GPUdb.
|
Modifier and Type | Field and Description |
---|---|
static long |
END_OF_SET
Constant used with certain requests to indicate that the maximum allowed
number of results should be returned.
|
protected static String |
HEADER_AUTHORIZATION |
protected static String |
HEADER_CONTENT_TYPE |
protected static String |
HEADER_HA_SYNC_MODE |
protected static String[] |
PROTECTED_HEADERS |
protected static String |
SslErrorMessageFormat |
Modifier | Constructor and Description |
---|---|
protected |
GPUdbBase(List<URL> urls,
GPUdbBase.Options options) |
protected |
GPUdbBase(String url,
GPUdbBase.Options options) |
protected |
GPUdbBase(URL url,
GPUdbBase.Options options) |
Modifier and Type | Method and Description |
---|---|
void |
addHttpHeader(String header,
String value)
Adds an HTTP header to the map of additional HTTP headers to send to
GPUdb with each request.
|
<T> void |
addKnownType(String typeId,
Class<T> objectClass,
TypeObjectMap<T> typeObjectMap)
Adds a type object map for the specified class as a type descriptor for
a GPUdb type, identified by a type ID, to the known type list, and also
adds the type object map to the known type object map list.
|
void |
addKnownType(String typeId,
Object typeDescriptor)
Adds a type descriptor for a GPUdb type (excluding types of join tables),
identified by a type ID, to the known type list.
|
<T> void |
addKnownTypeFromTable(String tableName,
Class<T> objectClass,
TypeObjectMap<T> typeObjectMap)
Adds a type object map for the specified class as a type descriptor for
the GPUdb type stored in the specified table to the known type list, and
also adds the type object map to the known type object map list.
|
void |
addKnownTypeFromTable(String tableName,
Object typeDescriptor)
Adds a type descriptor for the GPUdb type stored in the specified table
to the known type list.
|
<T> void |
addKnownTypeObjectMap(Class<T> objectClass,
TypeObjectMap<T> typeObjectMap)
Adds a type object map for the specified class to the known type object
map list.
|
protected <T> List<T> |
decode(List<String> typeIds,
List<ByteBuffer> data) |
protected <T> List<T> |
decode(Object typeDescriptor,
List<ByteBuffer> data) |
protected <T> List<T> |
decode(String typeId,
List<ByteBuffer> data) |
protected <T> List<List<T>> |
decodeMultiple(List<String> typeIds,
List<List<ByteBuffer>> data) |
protected <T> List<List<T>> |
decodeMultiple(Object typeDescriptor,
List<List<ByteBuffer>> data) |
protected <T> List<ByteBuffer> |
encode(List<T> data) |
protected <T> List<ByteBuffer> |
encode(TypeObjectMap<T> typeObjectMap,
List<T> data) |
protected void |
finalize()
Clean up resources--namely, the HTTPClient object(s).
|
static String |
getApiVersion()
Gets the version number of the GPUdb Java API.
|
ExecutorService |
getExecutor()
Gets the
executor service used for managing
threads during data encoding and decoding operations. |
List<URL> |
getFailoverURLs()
Gets the list of URLs of the active head ranks of all the clusters for
the GPUdb server.
|
List<GPUdbBase.ClusterAddressInfo> |
getHARingInfo()
Gets a copy of the list of ClusterAddressInfo objects that contain
information about the Kinetica ring of clusters that this GPUdb
object is connected to.
|
int |
getHARingSize()
Gets the size of the high availability ring (i.e. how many clusters
are in it).
|
GPUdbBase.HASynchronicityMode |
getHASyncMode()
Gets the current high availability synchronicity override mode.
|
URL |
getHmURL()
Gets the active URL of the GPUdb host manager.
|
List<URL> |
getHmURLs()
Gets the list of URLs for the GPUdb host manager.
|
Map<String,String> |
getHttpHeaders()
Gets the map of additional HTTP headers that will be sent to GPUdb with
each request.
|
protected int |
getNumClusterSwitches()
Gets the number of times the client has switched to a different
cluster amongst the high availability ring.
|
String |
getPassword()
Gets the password used for authentication to GPUdb.
|
String |
getPrimaryHostname()
Gets the hostname of the primary cluster of the HA environment, if any
cluster is identified as the primary cluster.
|
URL |
getPrimaryUrl()
Gets the URL of the head node of the primary cluster of the HA
environment, if any cluster is identified as the primary cluster.
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit,
List<String> orderByColumns)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit,
String expression)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit,
String expression,
List<String> orderByColumns)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit,
String expression,
List<String> orderByColumns,
String havingClause)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GetRecordsJsonResponse |
getRecordsJson(String tableName,
List<String> columnNames,
long offset,
long limit,
String expression,
String havingClause)
This method is used to retrieve records from a Kinetica table in the form of
a JSON array (stringified).
|
GPUdbBase.GPUdbVersion |
getServerVersion()
Gets the version of the database server that this client is connected
to.
|
int |
getThreadCount()
Gets the number of threads used during data encoding and decoding
operations.
|
int |
getTimeout()
Gets the timeout value, in milliseconds, after which a lack of
response from the GPUdb server will result in requests being aborted.
|
protected Object |
getTypeDescriptor(String typeId) |
protected <T> TypeObjectMap<T> |
getTypeObjectMap(Class<T> objectClass) |
URL |
getURL()
Gets the active URL of the GPUdb server.
|
List<URL> |
getURLs()
Gets the list of URLs of the active head ranks of all the clusters for
the GPUdb server.
|
String |
getUsername()
Gets the username used for authentication to GPUdb.
|
boolean |
getUseSnappy()
Gets the value of the flag indicating whether Snappy compression will be
used for certain GPUdb requests that potentially submit large amounts of
data.
|
protected void |
incrementNumClusterSwitches()
Gets the number of times the client has switched to a different
cluster amongst the high availability ring.
|
protected HttpURLConnection |
initializeHttpConnection(URL url)
Create and initialize an HTTP connection object with the request headers
(including authorization header), connection type, time out etc.
|
protected HttpURLConnection |
initializeHttpConnection(URL url,
int timeout)
Create and initialize an HTTP connection object with the request headers
(including authorization header), connection type, time out etc.
|
protected org.apache.hc.client5.http.classic.methods.HttpPost |
initializeHttpPostRequest(URL url)
Create and initialize an HTTP connection object with the request headers
(including authorization header), connection type, time out etc.
|
protected org.apache.hc.client5.http.classic.methods.HttpPost |
initializeHttpPostRequest(URL url,
int timeout)
Create and initialize an HTTP connection object with the request headers
(including authorization header), connection type, time out etc.
|
Map<String,Object> |
insertRecordsFromJson(GPUdbBase.InsertRecordsJsonRequest insertRecordsJsonRequest,
GPUdbBase.JsonOptions jsonOptions)
This method inserts a JSON payload (either a single JSON record or an array) into a Kinetica table
|
Map<String,Object> |
insertRecordsFromJson(String jsonRecords,
String tableName)
This method inserts a JSON payload (either a single JSON record or an array) into a Kinetica table
with all default options
|
Map<String,Object> |
insertRecordsFromJson(String jsonRecords,
String tableName,
GPUdbBase.JsonOptions jsonOptions,
Map<String,String> createTableOptions,
Map<String,String> options)
This method inserts a JSON payload (either a single JSON record or an array) into a Kinetica table
|
boolean |
isAutoDiscoveryEnabled()
Gets whether auto-discovery is enabled or not on the current connection.
|
boolean |
isKineticaRunning(URL url)
Deprecated.
|
static <T> List<T> |
list(T... values)
A utility method for creating a list of objects inline.
|
static Map<String,String> |
options(String... values)
A utility method for creating a map of
strings to strings} inline.
|
void |
ping()
Verifies that GPUdb is running on the server.
|
String |
ping(URL url)
Pings the given URL and returns the response.
|
String |
ping(URL url,
int timeout)
Pings the given URL and returns the response.
|
void |
removeHttpHeader(String header)
Removes the given HTTP header from the map of additional HTTP headers to
send to GPUdb with each request.
|
protected void |
selectNextCluster()
Select the next cluster based on the HA failover priority set by the user.
|
void |
setHASyncMode(GPUdbBase.HASynchronicityMode syncMode)
Sets the current high availability synchronicity override mode.
|
GPUdbBase |
setHostManagerPort(int value)
Deprecated.
As of version 7.1.0.0, this method will no longer be
functional. This method will be a no-op, not changing host manager
port. The method will be removed in version 7.2.0.0.
|
protected void |
setTypeDescriptorIfMissing(String typeId,
String label,
String typeSchema,
Map<String,List<String>> properties) |
String |
submitRequest(String endpoint,
boolean enableCompression)
Submits an arbitrary request to GPUdb and saves the response into a
pre-created response object, optionally compressing the request before
sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequest(String endpoint,
org.apache.avro.generic.IndexedRecord request,
T response)
Submits an arbitrary request to GPUdb and saves the response into a
pre-created response object.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequest(String endpoint,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression)
Submits an arbitrary request to GPUdb and saves the response into a
pre-created response object, optionally compressing the request before
sending.
|
Map<String,Object> |
submitRequest(String endpoint,
String payload,
boolean enableCompression)
Submits an arbitrary request to GPUdb and saves the response into a
pre-created response object, optionally compressing the request before
sending.
|
String |
submitRequest(URL url,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequest(URL url,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequest(URL url,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression,
int timeout)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
Map<String,Object> |
submitRequest(URL url,
String payload,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
String |
submitRequestRaw(URL url,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
String |
submitRequestRaw(URL url,
boolean enableCompression,
int timeout)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequestRaw(URL url,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequestRaw(URL url,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression,
int timeout)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
Map<String,Object> |
submitRequestRaw(URL url,
String payload,
boolean enableCompression)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
Map<String,Object> |
submitRequestRaw(URL url,
String payload,
boolean enableCompression,
int timeout)
Submits an arbitrary request to GPUdb via the specified URL and saves the
response into a pre-created response object, optionally compressing the
request before sending.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequestToHM(String endpoint,
org.apache.avro.generic.IndexedRecord request,
T response)
Submits an arbitrary request to the GPUdb host manager and saves the
response into a pre-created response object.
|
<T extends org.apache.avro.generic.IndexedRecord> |
submitRequestToHM(String endpoint,
org.apache.avro.generic.IndexedRecord request,
T response,
boolean enableCompression)
Submits an arbitrary request to the GPUdb host manager and saves the
response into a pre-created response object, optionally compressing
the request before sending.
|
protected URL |
switchURL(URL oldURL,
int oldNumClusterSwitches)
Switches the URL of the HA ring cluster.
|
protected void |
updateServerVersion()
If the database version hasn't been set already, update it by querying
the server about its system properties.
|
public static final long END_OF_SET
protected static final String HEADER_HA_SYNC_MODE
protected static final String HEADER_AUTHORIZATION
protected static final String HEADER_CONTENT_TYPE
protected static final String[] PROTECTED_HEADERS
protected static final String SslErrorMessageFormat
protected GPUdbBase(String url, GPUdbBase.Options options) throws GPUdbException
GPUdbException
protected GPUdbBase(URL url, GPUdbBase.Options options) throws GPUdbException
GPUdbException
protected GPUdbBase(List<URL> urls, GPUdbBase.Options options) throws GPUdbException
GPUdbException
public static String getApiVersion()
@SafeVarargs public static <T> List<T> list(T... values)
T
- the type of objects in the listvalues
- the objects to be added to the listpublic static Map<String,String> options(String... values)
values
- an even number of string valuesIllegalArgumentException
- if an odd number of values is specifiedprotected void finalize() throws Throwable
public List<URL> getURLs()
getURL
to determine which one), but
in the event of failure, the other URLs will be tried in a randomized
order, and if a working one is found it will become the new active URL.public List<URL> getFailoverURLs()
getURL
to determine which one), but
in the event of failure, the other URLs will be tried in order, and if a
working one is found it will become the new active URL.public URL getURL()
public List<URL> getHmURLs()
getHmURL
to determine which one), but in the event of failure, the
other URLs will be tried in order, and if a working one is found
it will become the new active URL.public URL getHmURL()
public URL getPrimaryUrl()
public String getPrimaryHostname()
public GPUdbBase.GPUdbVersion getServerVersion()
GPUdbBase.GPUdbVersion
, or null.public GPUdbBase.HASynchronicityMode getHASyncMode()
setHASyncMode(HASynchronicityMode)
public String getUsername()
GPUdb constructor
via GPUdbBase.Options
.GPUdbBase.Options.setUsername(String)
public String getPassword()
GPUdb constructor
via GPUdbBase.Options
.GPUdbBase.Options.setPassword(String)
public boolean getUseSnappy()
false
if not overridden using the GPUdb constructor
via GPUdbBase.Options
.GPUdbBase.Options.setUseSnappy(boolean)
public boolean isAutoDiscoveryEnabled()
public int getThreadCount()
GPUdb constructor
via GPUdbBase.Options
.GPUdbBase.Options.setThreadCount(int)
public ExecutorService getExecutor()
executor service
used for managing
threads during data encoding and decoding operations. Will be
null
if none was provided to the
GPUdb constructor
via
GPUdbBase.Options
.GPUdbBase.Options.setExecutor(ExecutorService)
public Map<String,String> getHttpHeaders()
GPUdb constructor
via GPUdbBase.Options
.GPUdbBase.Options.addHttpHeader(String, String)
,
GPUdbBase.Options.setHttpHeaders(Map)
public int getTimeout()
GPUdbBase.Options.setTimeout(int)
public List<GPUdbBase.ClusterAddressInfo> getHARingInfo()
public int getHARingSize()
public void addHttpHeader(String header, String value) throws GPUdbException
header
- the HTTP header (cannot be null)value
- the value of the HTTP header (cannot be null)GPUdbException
getHttpHeaders()
,
removeHttpHeader(String)
public void removeHttpHeader(String header) throws GPUdbException
header
- the HTTP header (cannot be null)GPUdbException
getHttpHeaders()
,
addHttpHeader(String, String)
public void setHASyncMode(GPUdbBase.HASynchronicityMode syncMode)
GPUdbBase.HASynchronicityMode.DEFAULT
, normal operation will resume (where
the high availability process determines which endpoints will be
synchronous and which ones will be asynchronous).syncMode
- the ha synchronicity override mode@Deprecated public GPUdbBase setHostManagerPort(int value) throws IllegalArgumentException, GPUdbException
value
- the host manager port numberGPUdbBase
instanceIllegalArgumentException
GPUdbException
protected int getNumClusterSwitches()
protected void incrementNumClusterSwitches()
protected void selectNextCluster()
protected URL switchURL(URL oldURL, int oldNumClusterSwitches) throws GPUdbBase.GPUdbFailoverDisabledException, GPUdbBase.GPUdbHAUnavailableException, GPUdbBase.GPUdbUnauthorizedAccessException
oldURL
- the head rank URL in use at the time of the failover that
initiated this switcholdNumClusterSwitches
- the total number of cluster switches that have occurred
up to the moment before this thread's switch was initiated;
this will be used to determine whether another thread is
already trying to fail over to the next cluster and that
this thread should stand downURL
to tryGPUdbBase.GPUdbFailoverDisabledException
GPUdbBase.GPUdbHAUnavailableException
GPUdbBase.GPUdbUnauthorizedAccessException
protected org.apache.hc.client5.http.classic.methods.HttpPost initializeHttpPostRequest(URL url) throws Exception
url
- the URL to which the connection needs to be madeException
protected org.apache.hc.client5.http.classic.methods.HttpPost initializeHttpPostRequest(URL url, int timeout) throws Exception
url
- the URL to which the connection needs to be madetimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutException
protected HttpURLConnection initializeHttpConnection(URL url) throws Exception
url
- the URL to which the connection needs to be madeException
protected HttpURLConnection initializeHttpConnection(URL url, int timeout) throws Exception
url
- the URL to which the connection needs to be madetimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutException
public Map<String,Object> insertRecordsFromJson(GPUdbBase.InsertRecordsJsonRequest insertRecordsJsonRequest, GPUdbBase.JsonOptions jsonOptions) throws GPUdbException
insertRecordsJsonRequest
- - an instance of GPUdbBase.InsertRecordsJsonRequest
classGPUdbException
- - in case of an error raised by the underlying endpointpublic Map<String,Object> insertRecordsFromJson(String jsonRecords, String tableName) throws GPUdbException
jsonRecords
- - A single JSON record or an array of records as JSONtableName
- - the table to insert the records intoGPUdbException
- - in case of an error raised by the underlying endpointpublic Map<String,Object> insertRecordsFromJson(String jsonRecords, String tableName, GPUdbBase.JsonOptions jsonOptions, Map<String,String> createTableOptions, Map<String,String> options) throws GPUdbException
jsonRecords
- - A single JSON record or an array of records as JSONtableName
- - the table to insert the records intojsonOptions
- - Indicates whether Snappy compression is to be set on or notcreateTableOptions
- - an instance of the class
InsertRecordsJsonRequest.CreateTableOptions
options
- - an instance of the class
InsertRecordsJsonRequest.Options
GPUdbException
- - in case of an error raised by the underlying endpointpublic GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieve; a value of null will
return all columnsoffset
- - the offset to start fromlimit
- - the maximum number of recordsGPUdbBase.GetRecordsJsonResponse
classGPUdbException
public GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit, List<String> orderByColumns) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieve; a value of null will
return all columnsoffset
- - the offset to start fromlimit
- - the maximum number of recordsorderByColumns
- - the list of columns to order byGPUdbBase.GetRecordsJsonResponse
classGPUdbException
public GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit, String expression) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieve; a value of null will
return all columnsoffset
- - the offset to start fromlimit
- - the maximum number of recordsexpression
- - the filter expressionGPUdbBase.GetRecordsJsonResponse
classGPUdbException
public GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit, String expression, List<String> orderByColumns) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieve; a value of null will
return all columnsoffset
- - the offset to start fromlimit
- - the maximum number of recordsexpression
- - the filter expressionorderByColumns
- - the list of columns to order byGPUdbBase.GetRecordsJsonResponse
classGPUdbException
public GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit, String expression, String havingClause) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieve; a value of null will
return all columnsoffset
- - the offset to start fromlimit
- - the maximum number of recordsexpression
- - the filter expressionhavingClause
- - the having clauseGPUdbBase.GetRecordsJsonResponse
classGPUdbException
public GPUdbBase.GetRecordsJsonResponse getRecordsJson(String tableName, List<String> columnNames, long offset, long limit, String expression, List<String> orderByColumns, String havingClause) throws GPUdbException
tableName
- - Name of the tablecolumnNames
- - the columns names to retrieveoffset
- - the offset to start fromlimit
- - the maximum number of recordsexpression
- - the filter expressionorderByColumns
- - the list of columns to order byhavingClause
- - the having clauseGPUdbBase.GetRecordsJsonResponse
classGPUdbException
protected void updateServerVersion() throws GPUdbException
GPUdbException
public void addKnownType(String typeId, Object typeDescriptor)
typeId
- the type ID of the type in GPUdb (must not be the
type of a join table)typeDescriptor
- the type descriptor to be used for decoding the
typeIllegalArgumentException
- if typeDescriptor
is not a
Schema
, Type
, TypeObjectMap
, or Class
that implements IndexedRecord
public <T> void addKnownType(String typeId, Class<T> objectClass, TypeObjectMap<T> typeObjectMap)
T
- the classtypeId
- the type ID of the type in GPUdbobjectClass
- the classtypeObjectMap
- the type object map to be used for encoding and
decodingpublic void addKnownTypeFromTable(String tableName, Object typeDescriptor) throws GPUdbException
tableName
- the name of the table in GPUdbtypeDescriptor
- the type descriptor to be used for decoding the
typeIllegalArgumentException
- if typeDescriptor
is not a
Schema
, Type
, TypeObjectMap
, or Class
that implements IndexedRecord
GPUdbException
- if the table does not exist or is not homogeneous,
or if an error occurs during the request for table informationpublic <T> void addKnownTypeFromTable(String tableName, Class<T> objectClass, TypeObjectMap<T> typeObjectMap) throws GPUdbException
T
- the classtableName
- the name of the table in GPUdbobjectClass
- the classtypeObjectMap
- the type object map to be used for encoding and
decodingGPUdbException
- if the table does not exist or is not homogeneous,
or if an error occurs during the request for informationpublic <T> void addKnownTypeObjectMap(Class<T> objectClass, TypeObjectMap<T> typeObjectMap)
T
- the classobjectClass
- the classtypeObjectMap
- the type object map to be used for encodingprotected <T> List<T> decode(Object typeDescriptor, List<ByteBuffer> data) throws GPUdbException
GPUdbException
protected <T> List<T> decode(String typeId, List<ByteBuffer> data) throws GPUdbException
GPUdbException
protected <T> List<T> decode(List<String> typeIds, List<ByteBuffer> data) throws GPUdbException
GPUdbException
protected <T> List<List<T>> decodeMultiple(Object typeDescriptor, List<List<ByteBuffer>> data) throws GPUdbException
GPUdbException
protected <T> List<List<T>> decodeMultiple(List<String> typeIds, List<List<ByteBuffer>> data) throws GPUdbException
GPUdbException
protected <T> List<ByteBuffer> encode(List<T> data) throws GPUdbException
GPUdbException
protected <T> List<ByteBuffer> encode(TypeObjectMap<T> typeObjectMap, List<T> data) throws GPUdbException
GPUdbException
protected Object getTypeDescriptor(String typeId) throws GPUdbException
GPUdbException
protected <T> TypeObjectMap<T> getTypeObjectMap(Class<T> objectClass) throws GPUdbException
GPUdbException
protected void setTypeDescriptorIfMissing(String typeId, String label, String typeSchema, Map<String,List<String>> properties) throws GPUdbException
GPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequest(String endpoint, org.apache.avro.generic.IndexedRecord request, T response) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objectendpoint
- the GPUdb endpoint to send the request torequest
- the request objectresponse
- the response objectresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequest(String endpoint, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface. The request will only be compressed if
enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objectendpoint
- the GPUdb endpoint to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public Map<String,Object> submitRequest(String endpoint, String payload, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface. The request will only be compressed if
enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.endpoint
- the GPUdb endpoint to send the request topayload
- the payload as a JSON StringenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public String submitRequest(String endpoint, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface. The request will only be compressed if
enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants.endpoint
- the GPUdb endpoint to send the request toenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public String submitRequest(URL url, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants.url
- the URL to send the request toenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public Map<String,Object> submitRequest(URL url, String payload, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.url
- the URL to send the request topayload
- the payload as a JSON StringenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequestToHM(String endpoint, org.apache.avro.generic.IndexedRecord request, T response) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface.T
- the type of the response objectendpoint
- the GPUdb endpoint to send the request torequest
- the request objectresponse
- the response objectresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequestToHM(String endpoint, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbException
IndexedRecord
interface. The request
will only be compressed if enableCompression
is true
and
the GPUdb constructor
was
called with the Snappy compression
flag
set to true
.T
- the type of the response objectendpoint
- the GPUdb endpoint to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequest(URL url, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objecturl
- the URL to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequest(URL url, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression, int timeout) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
. Optionally, the timeout period can be set
in milliseconds.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objecturl
- the URL to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requesttimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequestRaw(URL url, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objecturl
- the URL to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public Map<String,Object> submitRequestRaw(URL url, String payload, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.url
- the URL to send the request topayload
- the payload as a JSON StringenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public String submitRequestRaw(URL url, boolean enableCompression) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants.url
- the URL to send the request toenableCompression
- whether to compress the requestresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public <T extends org.apache.avro.generic.IndexedRecord> T submitRequestRaw(URL url, org.apache.avro.generic.IndexedRecord request, T response, boolean enableCompression, int timeout) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of requests other than
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants and
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.T
- the type of the response objecturl
- the URL to send the request torequest
- the request objectresponse
- the response objectenableCompression
- whether to compress the requesttimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public Map<String,Object> submitRequestRaw(URL url, String payload, boolean enableCompression, int timeout) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
insertRecordsFromJson(com.gpudb.GPUdbBase.InsertRecordsJsonRequest, com.gpudb.GPUdbBase.JsonOptions)
and its other variants.url
- the URL to send the request topayload
- the payload as a JSON StringenableCompression
- whether to compress the requesttimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public String submitRequestRaw(URL url, boolean enableCompression, int timeout) throws GPUdbBase.SubmitException, GPUdbBase.GPUdbExitException, GPUdbException
IndexedRecord
interface. The request will only be
compressed if enableCompression
is true
and the
GPUdb constructor
was
called with the Snappy compression
flag
set to true
.
NOTE: This method's primary use is in support of
getRecordsJson(java.lang.String, java.util.List<java.lang.String>, long, long)
and its other variants.url
- the URL to send the request toenableCompression
- whether to compress the requesttimeout
- a positive integer representing the number of
milliseconds to use for connection timeoutresponse
parameter)GPUdbBase.SubmitException
- if an error occurs while submitting the requestGPUdbBase.GPUdbExitException
GPUdbException
public void ping() throws GPUdbException
GPUdbException
- if an error occurs and/or GPUdb is not running on
the serverpublic String ping(URL url)
public String ping(URL url, int timeout)
url
- the URL to which the connection needs to be madetimeout
- a positive integer representing the number of
milliseconds to use for connection timeout@Deprecated public boolean isKineticaRunning(URL url)
Copyright © 2024. All rights reserved.