java.lang.Object
com.dna.jopt.member.bucket.route.controller.loadcontroller.LoadController
All Implemented Interfaces:
ILoadController, Serializable

public class LoadController extends Object implements ILoadController
Manages the dynamic per-node INodeDepot state for one entity.

Design — flat one-level COW with on-demand deep isolation

Every instance has two fields:

Performance

partialCopy() is O(1): it passes this.ownMap by reference as the child's parentMap and allocates a fresh empty ownMap for the child. No depot copying happens at clone time. Copying is deferred to getFlexLoadNodeDepot(java.lang.String): only the specific depot that an operator actually touches is deep-copied at the moment it is first accessed on the clone.

Correctness — why deep copy in lazy isolation

Lazy isolation calls INodeDepot.copy() (deep — ILoad.copy() per item), not partialCopy() (shallow — shared ILoad references). This is essential: FlexLoadOperator calls setLoad() directly on an ILoad object that is already inside the depot's item list. A shallow copy would leave that object shared between the clone and the parent, so mutations on the clone would corrupt the parent's depot state. A deep copy gives the clone fully independent ILoad objects.

Thread safety

Both maps are ConcurrentHashMap instances. get and put are safe under concurrent assessor threads. parentMap is never modified after construction, so reads are always safe. ownMap is iterated with a weakly-consistent iterator in partialCopy() — never throws CME.

See Also:
  • Constructor Details

    • LoadController

      public LoadController()
      Creates a standalone instance with an empty depot map.
  • Method Details