public interface TDClientApi<ClientImpl> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
ClientImpl |
authenticate(String email,
String password)
Perform user email and password based authentication and return a new client that will use apikey based authentication.
|
void |
commitBulkImportSession(String sessionName) |
void |
createBulkImportSession(String sessionName,
String databaseName,
String tableName) |
void |
createDatabase(String databaseName)
Create a new database
|
void |
createDatabaseIfNotExists(String databaseName) |
void |
createTable(String databaseName,
String tableName)
Create a new table
|
void |
createTableIfNotExists(String databaseName,
String tableName) |
void |
deleteBulkImportSession(String sessionName) |
void |
deleteDatabase(String databaseName)
Delete a specified database.
|
void |
deleteDatabaseIfExists(String databaseName) |
void |
deleteTable(String databaseName,
String tableName) |
void |
deleteTableIfExists(String databaseName,
String tableName) |
boolean |
existsDatabase(String databaseName) |
boolean |
existsTable(String databaseName,
String table) |
void |
freezeBulkImportSession(String sessionName) |
<Result> Result |
getBulkImportErrorRecords(String sessionName,
com.google.common.base.Function<InputStream,Result> resultStreamHandler) |
TDBulkImportSession |
getBulkImportSession(String sessionName) |
TDJob |
jobInfo(String jobId) |
<Result> Result |
jobResult(String jobId,
TDResultFormat format,
com.google.common.base.Function<InputStream,Result> resultStreamHandler)
Open an input stream to retrieve the job result.
|
TDJobSummary |
jobStatus(String jobId) |
void |
killJob(String jobId) |
List<String> |
listBulkImportParts(String sessionName) |
List<TDBulkImportSession> |
listBulkImportSessions() |
List<String> |
listDatabaseNames()
Get the list of databases
|
List<TDDatabase> |
listDatabases()
Get the detailed information of databases
|
TDJobList |
listJobs() |
TDJobList |
listJobs(long fromJobId,
long toJobId) |
List<TDTable> |
listTables(String databaseName)
Get the list of the tables in the specified database
|
TDPartialDeleteJob |
partialDelete(String databaseName,
String tableName,
long from,
long to) |
void |
performBulkImportSession(String sessionName) |
void |
performBulkImportSession(String sessionName,
TDJob.Priority priority) |
void |
renameTable(String databaseName,
String tableName,
String newTableName) |
void |
renameTable(String databaseName,
String tableName,
String newTableName,
boolean overwrite) |
String |
serverStatus() |
String |
startSavedQuery(String name,
Date scheduledTime)
Start a query saved on the cloud.
|
String |
submit(TDJobRequest jobRequest)
Submit a new job request
|
String |
submitExportJob(TDExportJobRequest jobRequest)
Start a table export job.
|
void |
swapTables(String databaseName,
String tableName1,
String tableName2) |
void |
unfreezeBulkImportSession(String sessionName) |
void |
updateTableSchema(String databaseName,
String tableName,
List<TDColumn> newSchema) |
void |
uploadBulkImportPart(String sessionName,
String uniquePartName,
File path) |
ClientImpl |
withApiKey(String newApiKey)
Return a TDClientApi implementation that uses the given api key.
|
close
ClientImpl withApiKey(String newApiKey)
newApiKey
- ClientImpl authenticate(String email, String password)
withApiKey(String)
method, closing the returned client will invalidate the current instance.email
- password
- String serverStatus()
List<String> listDatabaseNames()
TDClientException
- if failed to retrieve the database listList<TDDatabase> listDatabases()
TDClientException
- if failed to retrieve the database list.void createDatabase(String databaseName)
databaseName
- TDClientException
- if the specified database already existsvoid createDatabaseIfNotExists(String databaseName)
void deleteDatabase(String databaseName)
databaseName
- TDClientException
- if no such a database existsvoid deleteDatabaseIfExists(String databaseName)
List<TDTable> listTables(String databaseName)
databaseName
- TDClientException
boolean existsDatabase(String databaseName)
void createTable(String databaseName, String tableName)
databaseName
- tableName
- TDClientException
void renameTable(String databaseName, String tableName, String newTableName, boolean overwrite)
TDPartialDeleteJob partialDelete(String databaseName, String tableName, long from, long to)
void updateTableSchema(String databaseName, String tableName, List<TDColumn> newSchema)
String submit(TDJobRequest jobRequest)
jobRequest
- TDClientException
TDJobList listJobs()
TDJobList listJobs(long fromJobId, long toJobId)
void killJob(String jobId)
TDJobSummary jobStatus(String jobId)
<Result> Result jobResult(String jobId, TDResultFormat format, com.google.common.base.Function<InputStream,Result> resultStreamHandler)
jobId
- format
- resultStreamHandler
- List<TDBulkImportSession> listBulkImportSessions()
void createBulkImportSession(String sessionName, String databaseName, String tableName)
TDBulkImportSession getBulkImportSession(String sessionName)
void uploadBulkImportPart(String sessionName, String uniquePartName, File path)
void freezeBulkImportSession(String sessionName)
void unfreezeBulkImportSession(String sessionName)
void performBulkImportSession(String sessionName)
void performBulkImportSession(String sessionName, TDJob.Priority priority)
void commitBulkImportSession(String sessionName)
void deleteBulkImportSession(String sessionName)
<Result> Result getBulkImportErrorRecords(String sessionName, com.google.common.base.Function<InputStream,Result> resultStreamHandler)
String startSavedQuery(String name, Date scheduledTime)
name
- name of the saved queryscheduledTime
- the return time of TD_SCHEDULED_TIMEString submitExportJob(TDExportJobRequest jobRequest)
jobRequest
- Copyright © 2016. All rights reserved.