Package org.apache.sysds.hops.fedplanner

# Class FederatedPlanCostEnumerator

java.lang.Object
org.apache.sysds.hops.fedplanner.FederatedPlanCostEnumerator

public class FederatedPlanCostEnumerator extends Object

## Constructor Summary

Constructors
Constructor
Description
`FederatedPlanCostEnumerator()`

## Method Summary

Modifier and Type
Method
Description
`static FederatedMemoTable.FedPlan`
`enumerateFunctionDynamic(FunctionStatementBlock function, FederatedMemoTable memoTable, boolean isPrint)`
`static FederatedMemoTable.FedPlan`
`enumerateProgram(DMLProgram prog, FederatedMemoTable memoTable, boolean isPrint)`
Enumerates the entire DML program to generate federated execution plans.
`static void`
`enumerateStatementBlock(StatementBlock sb, DMLProgram prog, FederatedMemoTable memoTable, Map<Long,FederatedMemoTable.HopCommon> hopCommonTable, Map<Long,List<Hop>> rewireTable, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, Set<Long> unRefTwriteSet, Set<String> fnStack, int numOfWorkers, Set<Long> visitedHops)`
Enumerates the statement block and updates the transient and memoization tables.

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

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

## Constructor Details

### FederatedPlanCostEnumerator

public FederatedPlanCostEnumerator()

## Method Details

### enumerateProgram

public static FederatedMemoTable.FedPlan enumerateProgram(DMLProgram prog, FederatedMemoTable memoTable, boolean isPrint)
Enumerates the entire DML program to generate federated execution plans. It processes each statement block, computes the optimal federated plan, detects and resolves conflicts, and optionally prints the plan tree.

Parameters:
  `prog` - The DML program to enumerate.
  `isPrint` - A boolean indicating whether to print the federated plan tree.

### enumerateFunctionDynamic

public static FederatedMemoTable.FedPlan enumerateFunctionDynamic(FunctionStatementBlock function, FederatedMemoTable memoTable, boolean isPrint)

### enumerateStatementBlock

public static void enumerateStatementBlock(StatementBlock sb, DMLProgram prog, FederatedMemoTable memoTable, Map<Long,FederatedMemoTable.HopCommon> hopCommonTable, Map<Long,List<Hop>> rewireTable, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, Set<Long> unRefTwriteSet, Set<String> fnStack, int numOfWorkers, Set<Long> visitedHops)
Enumerates the statement block and updates the transient and memoization tables. This method processes different types of statement blocks such as If, For, While, and Function blocks. It recursively enumerates the Hop DAGs within these blocks and updates the corresponding tables. The method also calculates weights recursively for if-else/loops and handles inner and outer block distinctions.