Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
Iterator<Pair<Q, E> > com.griddynamics.jagger.invoker.ExclusiveAccessLoadBalancer< Q, E >.provide ( )

Returns an iterator over pairs.

Author
Grid Dynamics
Details:

Scenario take the next pair of queries and endpoints and try to execute invocation with this data

Returns
iterator over pairs

Implements com.griddynamics.jagger.invoker.LoadBalancer< Q, E >.

Definition at line 51 of file ExclusiveAccessLoadBalancer.java.

51  {
52  return new AbstractIterator<Pair<Q, E>>() {
53 
54  Pair<Q, E> current = null;
55 
56  @Override
57  protected Pair<Q, E> computeNext() {
58  if (current != null && isToCircleAnIteration()) {
59  log.debug("Returning pair - {}", current);
60  pairQueue.add(current);
61  }
62  current = pollNext();
63 
64  log.debug("Providing pair - {}", current);
65  return current;
66  }
67 
68  @Override
69  public String toString() {
70  return super.getClass() + " iterator";
71  }
72  };
73  }