public class NetworkClient
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
NetworkClient.BatchInfo |
static class |
NetworkClient.BatchItem |
static class |
NetworkClient.BatchList |
static class |
NetworkClient.OutputRecord |
static class |
NetworkClient.ResourceRecord |
static class |
NetworkClient.ServerInfo |
static class |
NetworkClient.ServerVersion |
static class |
NetworkClient.State |
static class |
NetworkClient.TaskInfo |
static class |
NetworkClient.WorkerInfo |
static class |
NetworkClient.WorkerItem |
static class |
NetworkClient.WorkerList |
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Modifier | Constructor and Description |
---|---|
|
NetworkClient() |
protected |
NetworkClient(long cPtr,
boolean cMemoryOwn) |
Modifier and Type | Method and Description |
---|---|
void |
abortBatch(int batch_id)
Abort batch.
|
void |
abortWorker(int worker_id)
Abort worker.
|
void |
close() |
boolean |
connect(java.lang.String host,
int port)
Connect to the server.
|
int |
createBatch(java.lang.String path,
NetworkTask[] tasks,
java.util.Map<java.lang.String,java.lang.String> meta)
Create new batch.
|
void |
delete() |
void |
disconnect()
Disconnect from the server.
|
java.lang.String |
exportBatches(int[] batch_ids)
Export current state of batches.
|
protected void |
finalize() |
int |
findBatch(java.lang.String path)
Get batch id based on project path.
|
NetworkClient.BatchInfo |
getBatchInfo(int batch_id,
long revision)
Get batch information.
|
NetworkClient.BatchList |
getBatchList(long revision)
Get list of batches.
|
protected static long |
getCPtr(NetworkClient obj) |
NetworkClient.ServerInfo |
getServerInfo(long revision)
Get server information.
|
NetworkClient.ServerVersion |
getServerVersion()
Get server version.
|
NetworkClient.WorkerInfo |
getWorkerInfo(int worker_id,
long revision)
Get worker information.
|
NetworkClient.WorkerList |
getWorkerList(long revision)
Get list of workers.
|
void |
importBatches(java.lang.String data)
Import batches from exported data.
|
void |
quitWorker(int worker_id)
Quit worker.
|
void |
setBatchPaused(int batch_id,
boolean paused)
Set batch paused state.
|
void |
setBatchPriority(int batch_id,
int priority)
Set batch priority.
|
void |
setBatchWorkerLimit(int batch_id,
int worker_limit)
Set worker limit of the batch.
|
void |
setMasterServer(java.lang.String hostname)
Set master server.
|
void |
setWorkerCapability(int worker_id,
int capability)
Set worker capability.
|
void |
setWorkerCpuEnabled(int worker_id,
boolean cpu_enabled)
Set worker CPU enabled flag.
|
void |
setWorkerGpuMask(int worker_id,
long gpu_mask)
Set worker GPU mask.
|
void |
setWorkerPaused(int worker_id,
boolean paused)
Set worker paused state.
|
void |
setWorkerPriority(int worker_id,
int priority)
Set worker priority.
|
protected NetworkClient(long cPtr, boolean cMemoryOwn)
public NetworkClient()
protected static long getCPtr(NetworkClient obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public void close()
close
in interface java.lang.AutoCloseable
public boolean connect(java.lang.String host, int port)
host
- Server hostname.port
- Communication port.public void disconnect()
public int createBatch(java.lang.String path, NetworkTask[] tasks, java.util.Map<java.lang.String,java.lang.String> meta)
path
- Project path relative to root folder.tasks
- List of processing tasks to execute.meta
- Batch metadata.public int findBatch(java.lang.String path)
path
- Project path relative to root folder.public void abortBatch(int batch_id)
batch_id
- Batch id.public void setBatchPaused(int batch_id, boolean paused)
batch_id
- Batch id.paused
- Paused state.public void setBatchPriority(int batch_id, int priority)
batch_id
- Batch id.priority
- Batch priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).public void setBatchWorkerLimit(int batch_id, int worker_limit)
batch_id
- Batch id.worker_limit
- Worker limit of the batch (0 - unlimited).public void abortWorker(int worker_id)
worker_id
- Worker id.public void quitWorker(int worker_id)
worker_id
- Worker id.public void setWorkerPaused(int worker_id, boolean paused)
worker_id
- Worker id.paused
- Paused state.public void setWorkerPriority(int worker_id, int priority)
worker_id
- Worker id.priority
- Worker priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).public void setWorkerCapability(int worker_id, int capability)
worker_id
- Worker id.capability
- Worker capability (1 - CPU, 2 - GPU, 3 - Any).public void setWorkerGpuMask(int worker_id, long gpu_mask)
worker_id
- Worker id.gpu_mask
- GPU device mask.public void setWorkerCpuEnabled(int worker_id, boolean cpu_enabled)
worker_id
- Worker id.cpu_enabled
- CPU enabled flag.public NetworkClient.ServerVersion getServerVersion()
public NetworkClient.ServerInfo getServerInfo(long revision)
revision
- First revision to get.public void setMasterServer(java.lang.String hostname)
public NetworkClient.BatchInfo getBatchInfo(int batch_id, long revision)
batch_id
- Batch id.revision
- First revision to get.public NetworkClient.WorkerInfo getWorkerInfo(int worker_id, long revision)
worker_id
- Worker id.revision
- First revision to get.public NetworkClient.BatchList getBatchList(long revision)
revision
- First revision to get.public NetworkClient.WorkerList getWorkerList(long revision)
revision:
- First revision to get.public java.lang.String exportBatches(int[] batch_ids)
batch_ids
- Batch ids to export.public void importBatches(java.lang.String data)
data
- Batches data.