MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / createLoadBalancer

Method createLoadBalancer

LoadBalancer.java:105–111  ·  view source on GitHub ↗
(String lbType)

Source from the content-addressed store, hash-verified

103
104class LoadBalancerFactory {
105 public LoadBalancer createLoadBalancer(String lbType) {
106 return switch (lbType) {
107 case "round-robin" -> new RoundRobinLoadBalancer();
108 case "least-connection" -> new LeastConnectionLoadBalancer();
109 default -> new LeastConnectionLoadBalancer();
110 };
111 }
112}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected