public interface CloudService
Modifier and Type | Method and Description |
---|---|
void |
blockOnComputeOperations(List<String> references,
String zoneId)
Block and wait the operations with the provided references to complete
|
void |
createCloudStorageBucket(String bucket,
String location)
Create a bucket on the mass cloud storage
|
void |
downloadObjectFromCloudStorage(String object,
String outFile,
String bucket)
Download an object from cloud storage to a file, this method will block until the file is downloaded
|
void |
downloadObjectFromCloudStorage(String object,
String outFile,
String bucket,
Callback callback)
Download an object from cloud storage to a file
|
int |
getApiRecheckDelay()
Get the sleep period in seconds when waiting for async API operations to complete
|
String |
getInstanceId()
Get the id of the current instance
|
int |
getMaximumMetaDataSize()
Return the maximum metadata size for the underlying cloud provider implementation
|
VmMetaData |
getMetaData(boolean waitForChange)
Get the meta data of the current instance,
Wait for change will block until there is a change
|
VmMetaData |
getMetaData(String instanceId,
String zoneId)
Get the meta data for the provided instance id
|
VmMetaData |
init()
Perform any required initialization before
this cloud service is used
|
List<StorageObject> |
listCloudStorageObjects(String bucket)
List all the objects in the provided cloud storage bucket
|
String |
loadCloudStorageFilesIntoBigData(List<String> files,
BigDataTable table,
boolean createTable) |
List<String> |
loadLocalFilesIntoBigData(List<String> files,
BigDataTable table,
boolean createTable)
Load a list of local files into a big data table
|
QueryStats |
saveBigQueryResultsToCloudStorage(String jobId,
String bucket,
String filename)
TODO rename to BigData
Polls a big data job and once done exports the results to a cloud storage file then download it
|
QueryStats |
saveBigQueryResultsToFile(String jobId,
String filename)
TODO rename to BigData
Polls a big data job and once done save the results to a file
|
QueryStats |
saveBigQueryResultsToFile(String jobId,
String filename,
String bucket,
Integer minFiles,
int directDownloadRowLimit)
TODO rename to BigData
Polls a big data job and once done save the results to a file
|
<T> void |
setAuthenticationProvider(AuthenticationProvider<T> provider)
The authentication provider used by this instance
|
void |
setRemote(boolean remote)
Usually this cloud service is used in a cloud VM environment.
|
void |
shutdownInstance()
Delete the currently running vm, i.e.
|
void |
shutdownInstance(List<VmConfig> configs)
Delete the VMs provided in this config
|
String |
startBigDataQuery(String querySql)
Creates an asynchronous Query Job for a particular query on a dataset
|
String |
startBigDataQuery(String querySql,
BigDataTable table)
Creates an asynchronous Query Job for a particular query on a dataset.
|
boolean |
startInstance(List<VmConfig> configs,
boolean block)
Create VM instances, optionally block until all are created.
|
void |
updateMetadata(VmMetaData metaData)
Update the meta data of the current instance.
|
String |
updateMetadata(VmMetaData metaData,
String zoneId,
String instanceId,
boolean block)
Update the meta data of the the provided instance
|
StorageObject |
uploadFileToCloudStorage(String filename,
String bucket)
Upload a file to cloud storage and block until it's uploaded
|
StorageObject |
uploadFileToCloudStorage(String filename,
String bucket,
Callback callback)
Upload the provided file into cloud storage
|
VmMetaData init() throws IOException
IOException
- if any of the cloud api calls failVmMetaData getMetaData(boolean waitForChange) throws IOException
waitForChange
- - true to block until there is a change, false to return immediatelyVmMetaData
IOException
- if any of the cloud api calls failVmMetaData getMetaData(String instanceId, String zoneId) throws IOException
instanceId
- - the id of the vm instancezoneId
- - the zone or region idVmMetaData
IOException
- if any of the cloud api calls failvoid updateMetadata(VmMetaData metaData) throws IOException
metaData
- VmMetaData
IOException
- if any of the cloud api calls failString updateMetadata(VmMetaData metaData, String zoneId, String instanceId, boolean block) throws IOException
metaData
- VmMetaData
zoneId
- - the zone or region idinstanceId
- - the id of the vm instanceblock
- - true to wait for the api call to complete, false to return immediatelyIOException
- if any of the cloud api calls failvoid blockOnComputeOperations(List<String> references, String zoneId) throws IOException
references
- - the operations referenceszoneId
- - the zone or region idIOException
- if any of the cloud api calls failboolean startInstance(List<VmConfig> configs, boolean block) throws IOException
configs
- - the VmConfig
of the instances to startblock
- - true to wait for all the instance to start upIOException
- if any of the cloud api calls failvoid shutdownInstance(List<VmConfig> configs) throws IOException
configs
- - the VmConfig
of the instances to shutdownIOException
- if any of the cloud api calls failvoid shutdownInstance() throws IOException
IOException
- if any of the cloud api calls failString getInstanceId()
void createCloudStorageBucket(String bucket, String location) throws IOException
bucket
- - the cloud storage bucketlocation
- - the location where the bucket should be createdIOException
- if any of the cloud api calls failStorageObject uploadFileToCloudStorage(String filename, String bucket, Callback callback) throws IOException
filename
- - the name of the file to uploadbucket
- - the cloud bucketcallback
- - an optional callback when the upload is doneStorageObject
IOException
- if any of the cloud api calls failStorageObject uploadFileToCloudStorage(String filename, String bucket) throws IOException
filename
- - the name of the file to uploadbucket
- - the cloud storage bucketStorageObject
of the uploaded fileIOException
- if any of the cloud api calls failvoid downloadObjectFromCloudStorage(String object, String outFile, String bucket, Callback callback) throws IOException
object
- - the name of the object to downloadoutFile
- - the local file to save the objectbucket
- - the cloud storage bucketcallback
- - call when the operation completesIOException
- if any of the cloud api calls failvoid downloadObjectFromCloudStorage(String object, String outFile, String bucket) throws IOException
object
- - the name of the object to downloadoutFile
- - the local file to save the objectbucket
- - the cloud storage bucketIOException
- if any of the cloud api calls failList<StorageObject> listCloudStorageObjects(String bucket) throws IOException
bucket
- - the cloud storage bucketStorageObject
IOException
- if any of the cloud api calls failString loadCloudStorageFilesIntoBigData(List<String> files, BigDataTable table, boolean createTable) throws IOException
IOException
List<String> loadLocalFilesIntoBigData(List<String> files, BigDataTable table, boolean createTable) throws IOException
files
- - the names of the local files to upload to big datatable
- - the table definitioncreateTable
- - true if a new table should be created if it doesn't existList
of all the job idsIOException
- if any of the cloud api calls failString startBigDataQuery(String querySql) throws IOException
querySql
- the actual query stringIOException
- if any of the cloud api calls failString startBigDataQuery(String querySql, BigDataTable table) throws IOException
querySql
- the actual query stringtable
- the table being queriedIOException
- if any of the cloud api calls failQueryStats saveBigQueryResultsToFile(String jobId, String filename) throws IOException
jobId
- - the id of a previous big data jobfilename
- - the destination filenameIOException
- if any of the cloud api calls failQueryStats saveBigQueryResultsToFile(String jobId, String filename, String bucket, Integer minFiles, int directDownloadRowLimit) throws IOException
jobId
- - the id of a previous big data jobfilename
- - the destination filenamebucket
- - the cloud storage bucketminFiles
- - the minimum number of files to createdirectDownloadRowLimit
- - the limit to use for direct download, large than this limit
will use export to cloud storageIOException
- if any of the cloud api calls failQueryStats saveBigQueryResultsToCloudStorage(String jobId, String bucket, String filename) throws IOException
jobId
- - the id of a previous big data jobfilename
- - the destination filenamebucket
- - the cloud storage bucketIOException
- if any of the cloud api calls failint getMaximumMetaDataSize()
int getApiRecheckDelay()
void setRemote(boolean remote)
remote
- - true if this instance is not running on a VM<T> void setAuthenticationProvider(AuthenticationProvider<T> provider)
T
- the class of the authentication object returned by the providerprovider
- the authentication provider to useCopyright © 2016 iNetria. All rights reserved.