org.apache.sysds.runtime.controlprogram.paramserv

## Class FederatedPSControlThread

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.paramserv.PSWorker
  - - org.apache.sysds.runtime.controlprogram.paramserv.FederatedPSControlThread

All Implemented Interfaces:
  Serializable, Callable<Void>

    public class FederatedPSControlThread
    extends PSWorker
    implements Callable<Void>

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`FederatedPSControlThread(int workerID, String updFunc, Statement.PSFrequency freq, Statement.PSRuntimeBalancing runtimeBalancing, boolean weighting, int epochs, long batchSize, int numBatchesPerGlobalEpoch, ExecutionContext ec, ParamServer ps, int nbatches, boolean modelAvg)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Void` `call()` Entry point of the functionality
`String` `getWorkerName()`
`void` `setup(double weightingFactor)` Sets up the federated worker and control thread
`void` `teardown()` cleans up the execution context of the federated worker

### Methods inherited from class org.apache.sysds.runtime.controlprogram.paramserv.PSWorker

`getFeatures, getLabels, setFeatures, setLabels`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FederatedPSControlThread

    public FederatedPSControlThread(int workerID,
                                    String updFunc,
                                    Statement.PSFrequency freq,
                                    Statement.PSRuntimeBalancing runtimeBalancing,
                                    boolean weighting,
                                    int epochs,
                                    long batchSize,
                                    int numBatchesPerGlobalEpoch,
                                    ExecutionContext ec,
                                    ParamServer ps,
                                    int nbatches,
                                    boolean modelAvg)

### Method Detail

#### setup

    public void setup(double weightingFactor)

Sets up the federated worker and control thread

Parameters:
  `weightingFactor` - Gradients from this worker will be multiplied by this factor if weighting is enabled

#### teardown

    public void teardown()

cleans up the execution context of the federated worker

#### call

    public Void call()
              throws Exception

Entry point of the functionality

Specified by:
  `call` in interface `Callable<Void>`
Returns:
  void
Throws:
  `Exception` - incase the execution fails

#### getWorkerName

    public String getWorkerName()

Specified by:
  `getWorkerName` in class `PSWorker`