@ Override public ServiceInstance vote ( ) { List < ModelServiceInstance > instances = getServiceInstanceList ( ) ; if ( instances == null || instances . isEmpty ( ) ) { return null ; } int i = index . getAndIncrement ( ) ; int pos = i % instances . size ( ) ; ModelServiceInstance instance = instances . get ( pos ) ; return ServiceInstanceUtils . transferFromModelServiceInstance ( instance ) ; }
Vote a ServiceInstance based on the LoadBalancer algorithm .