Class BroadcastableClusterInfoGroup

  • All Implemented Interfaces:
    java.io.Serializable, MultiClusterSupport<IBroadcastableClusterInfo>, IBroadcastableClusterInfo

    public final class BroadcastableClusterInfoGroup
    extends java.lang.Object
    implements IBroadcastableClusterInfo, MultiClusterSupport<IBroadcastableClusterInfo>
    Broadcastable wrapper for coordinated writes with ZERO transient fields to optimize Spark broadcasting.

    This class wraps multiple BroadcastableCluster instances for multi-cluster scenarios. Pre-computed values (partitioner, lowestCassandraVersion) are extracted from CassandraClusterInfoGroup on the driver to avoid duplicating aggregation/validation logic on executors.

    Why ZERO transient fields matters:
    Spark's SizeEstimator uses reflection to estimate object sizes before broadcasting. Each transient field forces SizeEstimator to inspect the field's type hierarchy, which is expensive. Logger references are particularly costly due to their deep object graphs (appenders, layouts, contexts). By eliminating ALL transient fields and Logger references, we:

    • Minimize SizeEstimator reflection overhead during broadcast preparation
    • Reduce broadcast variable serialization size
    • Avoid accidental serialization of non-serializable objects
    See Also:
    Serialized Form