Class NetworkClient

java.lang.Object
com.agisoft.metashape.NetworkClient
All Implemented Interfaces:
AutoCloseable

public class NetworkClient extends Object implements AutoCloseable
NetworkClient class provides access to the network processing server and allows
to create and manage tasks.
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • NetworkClient

      protected NetworkClient(long cPtr, boolean cMemoryOwn)
    • NetworkClient

      public NetworkClient()
  • Method Details

    • getCPtr

      protected static long getCPtr(NetworkClient obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • connect

      public boolean connect(String host, int port)
      Connect to the server.
      Parameters:
      host - Server hostname.
      port - Communication port.
    • disconnect

      public void disconnect()
      Disconnect from the server.
    • createBatch

      public int createBatch(String path, NetworkTask[] tasks, Map<String,String> meta)
      Create new batch.
      Parameters:
      path - Project path relative to root folder.
      tasks - List of processing tasks to execute.
      meta - Batch metadata.
      Returns:
      Batch id.
    • findBatch

      public int findBatch(String path)
      Get batch id based on project path.
      Parameters:
      path - Project path relative to root folder.
      Returns:
      Batch id.
    • abortBatch

      public void abortBatch(int batch_id)
      Abort batch.
      Parameters:
      batch_id - Batch id.
    • setBatchPaused

      public void setBatchPaused(int batch_id, boolean paused)
      Set batch paused state.
      Parameters:
      batch_id - Batch id.
      paused - Paused state.
    • setBatchPriority

      public void setBatchPriority(int batch_id, int priority)
      Set batch priority.
      Parameters:
      batch_id - Batch id.
      priority - Batch priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).
    • setBatchNodeLimit

      public void setBatchNodeLimit(int batch_id, int node_limit)
      Set node limit of the batch.
      Parameters:
      batch_id - Batch id.
      node_limit - Node limit of the batch (0 - unlimited).
    • abortNode

      public void abortNode(int node_id)
      Abort node.
      Parameters:
      node_id - Node id.
    • quitNode

      public void quitNode(int node_id)
      Quit node.
      Parameters:
      node_id - Node id.
    • setNodePaused

      public void setNodePaused(int node_id, boolean paused)
      Set node paused state.
      Parameters:
      node_id - Node id.
      paused - Paused state.
    • setNodePriority

      public void setNodePriority(int node_id, int priority)
      Set node priority.
      Parameters:
      node_id - Node id.
      priority - Node priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).
    • setNodeCapability

      public void setNodeCapability(int node_id, int capability)
      Set node capability.
      Parameters:
      node_id - Node id.
      capability - Node capability (1 - CPU, 2 - GPU, 3 - Any).
    • setNodeGPUMask

      public void setNodeGPUMask(int node_id, long gpu_mask)
      Set node GPU mask.
      Parameters:
      node_id - Node id.
      gpu_mask - GPU device mask.
    • setNodeCPUEnable

      public void setNodeCPUEnable(int node_id, boolean cpu_enable)
      Set node CPU enable flag.
      Parameters:
      node_id - Node id.
      cpu_enable - CPU enable flag.
    • getServerInfo

      public NetworkClient.ServerInfo getServerInfo()
      Get server information.
    • getServerStatus

      public NetworkClient.ServerStatus getServerStatus(long revision)
      Get server status.
      Parameters:
      revision - First revision to get.
      Returns:
      Server status.
    • setMasterServer

      public void setMasterServer(String hostname)
      Set master server.
    • getBatchStatus

      public NetworkClient.BatchStatus getBatchStatus(int batch_id, long revision)
      Get batch status.
      Parameters:
      batch_id - Batch id.
      revision - First revision to get.
      Returns:
      Batch status.
    • getNodeStatus

      public NetworkClient.NodeStatus getNodeStatus(int node_id, long revision)
      Get node status.
      Parameters:
      node_id - Node id.
      revision - First revision to get.
      Returns:
      Node status.
    • getBatchList

      public NetworkClient.BatchList getBatchList(long revision)
      Get list of batches.
      Parameters:
      revision - First revision to get.
      Returns:
      List of batches.
    • getNodeList

      public NetworkClient.NodeList getNodeList(long revision)
      Get list of nodes.
      Parameters:
      revision - : First revision to get.
      Returns:
      List of nodes.
    • dumpBatches

      public String dumpBatches(int[] keys)
      Dump current state of batches.

      Returns:
      Batches data.
    • loadBatches

      public void loadBatches(String data)
      Load batches from dump.
      Parameters:
      data - Batches data.