Package org.apache.sysds.hops.fedplanner

# Class FederatedPlannerLogger

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

public class FederatedPlannerLogger extends Object
Unified utility class for logging federated planner information. Provides methods to log hop details including privacy constraints and FType information, as well as methods to print detailed FederatedMemoTable tree structures and cost analysis. This class integrates the functionality of the former FederatedMemoTablePrinter.

## Constructor Summary

Constructors
Constructor
Description
`FederatedPlannerLogger()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`logBasicHopInfo(Hop hop, String logPrefix)`
Logs basic hop information without privacy and FType details
`static void`
`logConflictResolutionError(long hopID, Object fedPlan, String logPrefix)`
Logs detailed error information for conflict resolution scenarios
`static void`
`logDataOpFTypeDebug(Hop hop, FTypes.FType fType, String opType, String reason)`
Logs FType debug information for DataOp operations (FEDERATED, TRANSIENTWRITE, TRANSIENTREAD)
`static void`
`logDetailedHopInfo(Hop hop, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, String logPrefix)`
Logs detailed hop information with dimension and data type
`static void`
`logFilteredChildHopsDebug(String hopName, long hopID, List<Hop> filteredChildHops, boolean isEmptyFilteredChildHops, String logPrefix)`
Logs debugging information for filtered child hops during TransRead rewiring
`static void`
`logFTypeMismatchError(Hop hop, List<Hop> filteredChildHops, Map<Long,FTypes.FType> fTypeMap, FTypes.FType expectedFType, FTypes.FType mismatchedFType, int mismatchIndex)`
Logs detailed FType mismatch error information for TransRead hop
`static void`
`logGetFederatedTypeDebug(Hop hop, FTypes.FType returnFType, String reason)`
Logs debug information for getFederatedType function
`static void`
`logHopErrorDetails(Hop hop, String logPrefix, String additionalMessage)`
Logs detailed hop error information with complete hop details
`static void`
`logHopInfo(Hop hop, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, String logPrefix)`
Logs hop information including name, hop ID, child hop IDs, privacy constraint, and ftype
`static void`
`logNullChildPlanDebug(org.apache.commons.lang3.tuple.Pair<Long,FEDInstruction.FederatedOutput> childFedPlanPair, FederatedMemoTable.FedPlan optimalPlan, FederatedMemoTable memoTable)`
Logs detailed null child plan debugging information
`static void`
`logNullFedPlanError(long hopID, String logPrefix)`
Logs error information for null fed plan scenarios
`static void`
`logTransReadRewireDebug(String hopName, long hopID, List<Hop> childHops, boolean isEmptyChildHops, String logPrefix)`
Logs debugging information for TransRead hop rewiring process
`static void`
`printFedPlanTree(FederatedMemoTable.FedPlan rootFedPlan, Set<Long> rootHopStatSet, FederatedMemoTable memoTable, double additionalTotalCost)`
Recursively prints a tree representation of the DAG starting from the given root FedPlan.

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

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

## Constructor Details

### FederatedPlannerLogger

public FederatedPlannerLogger()

## Method Details

### logHopInfo

public static void logHopInfo(Hop hop, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, String logPrefix)
Logs hop information including name, hop ID, child hop IDs, privacy constraint, and ftype

Parameters:
  `hop` - The hop to log information for
  `privacyConstraintMap` - Map containing privacy constraints for hops
  `fTypeMap` - Map containing FType information for hops
  `logPrefix` - Prefix string to identify the log source

### logBasicHopInfo

public static void logBasicHopInfo(Hop hop, String logPrefix)
Logs basic hop information without privacy and FType details

Parameters:
  `hop` - The hop to log information for
  `logPrefix` - Prefix string to identify the log source

### logDetailedHopInfo

public static void logDetailedHopInfo(Hop hop, Map<Long,FTypes.Privacy> privacyConstraintMap, Map<Long,FTypes.FType> fTypeMap, String logPrefix)
Logs detailed hop information with dimension and data type

Parameters:
  `hop` - The hop to log information for
  `privacyConstraintMap` - Map containing privacy constraints for hops
  `fTypeMap` - Map containing FType information for hops
  `logPrefix` - Prefix string to identify the log source

### logNullFedPlanError

public static void logNullFedPlanError(long hopID, String logPrefix)
Logs error information for null fed plan scenarios

Parameters:
  `hopID` - The hop ID that caused the error
  `logPrefix` - Prefix string to identify the log source

### logConflictResolutionError

public static void logConflictResolutionError(long hopID, Object fedPlan, String logPrefix)
Logs detailed error information for conflict resolution scenarios

Parameters:
  `hopID` - The hop ID that caused the error
  `fedPlan` - The federated plan with error details
  `logPrefix` - Prefix string to identify the log source

### logGetFederatedTypeDebug

public static void logGetFederatedTypeDebug(Hop hop, FTypes.FType returnFType, String reason)
Logs debug information for getFederatedType function

Parameters:
  `hop` - The hop being analyzed
  `returnFType` - The FType that will be returned
  `reason` - The reason for the FType decision

### logHopErrorDetails

public static void logHopErrorDetails(Hop hop, String logPrefix, String additionalMessage)
Logs detailed hop error information with complete hop details

Parameters:
  `hop` - The hop that caused the error
  `logPrefix` - Prefix string to identify the log source
  `additionalMessage` - Additional error message

### logNullChildPlanDebug

public static void logNullChildPlanDebug(org.apache.commons.lang3.tuple.Pair<Long,FEDInstruction.FederatedOutput> childFedPlanPair, FederatedMemoTable.FedPlan optimalPlan, FederatedMemoTable memoTable)
Logs detailed null child plan debugging information

Parameters:
  `childFedPlanPair` - The child federated plan pair that is null
  `optimalPlan` - The current optimal plan (parent)
  `memoTable` - The memo table for lookups

### logTransReadRewireDebug

public static void logTransReadRewireDebug(String hopName, long hopID, List<Hop> childHops, boolean isEmptyChildHops, String logPrefix)
Logs debugging information for TransRead hop rewiring process

Parameters:
  `hopName` - The name of the TransRead hop
  `hopID` - The ID of the TransRead hop
  `childHops` - List of child hops found during rewiring
  `isEmptyChildHops` - Whether the child hops list is empty
  `logPrefix` - Prefix string to identify the log source

### logFilteredChildHopsDebug

public static void logFilteredChildHopsDebug(String hopName, long hopID, List<Hop> filteredChildHops, boolean isEmptyFilteredChildHops, String logPrefix)
Logs debugging information for filtered child hops during TransRead rewiring

Parameters:
  `hopName` - The name of the TransRead hop
  `hopID` - The ID of the TransRead hop
  `filteredChildHops` - List of filtered child hops
  `isEmptyFilteredChildHops` - Whether the filtered child hops list is empty
  `logPrefix` - Prefix string to identify the log source

### logFTypeMismatchError

public static void logFTypeMismatchError(Hop hop, List<Hop> filteredChildHops, Map<Long,FTypes.FType> fTypeMap, FTypes.FType expectedFType, FTypes.FType mismatchedFType, int mismatchIndex)
Logs detailed FType mismatch error information for TransRead hop

Parameters:
  `hop` - The TransRead hop with FType mismatch
  `filteredChildHops` - List of filtered child hops
  `fTypeMap` - Map containing FType information for hops
  `expectedFType` - The expected FType
  `mismatchedFType` - The mismatched FType
  `mismatchIndex` - The index where mismatch occurred

### logDataOpFTypeDebug

public static void logDataOpFTypeDebug(Hop hop, FTypes.FType fType, String opType, String reason)
Logs FType debug information for DataOp operations (FEDERATED, TRANSIENTWRITE, TRANSIENTREAD)

Parameters:
  `hop` - The DataOp hop being analyzed
  `fType` - The FType that was determined for this operation
  `opType` - The operation type (FEDERATED, TRANSIENTWRITE, TRANSIENTREAD)
  `reason` - The reason for the FType decision

### printFedPlanTree

public static void printFedPlanTree(FederatedMemoTable.FedPlan rootFedPlan, Set<Long> rootHopStatSet, FederatedMemoTable memoTable, double additionalTotalCost)
Recursively prints a tree representation of the DAG starting from the given root FedPlan. Includes information about hopID, fedOutType, TotalCost, SelfCost, and NetCost for each node. Additionally, prints the additional total cost once at the beginning.

Parameters:
  `rootFedPlan` - The starting point FedPlan to print
  `rootHopStatSet` - Set of root hop statistics
  `memoTable` - The memoization table containing FedPlan variants
  `additionalTotalCost` - The additional cost to be printed once