for (Map.Entry<String, Map<String,Long>> d2Service : trafficProportion.entrySet())
{
for (Map.Entry<String, Long> partition : d2Service.getValue().entrySet())
{
final URI uri = new URI("d2://" + d2Service.getKey() + "?partitionId=" + partition.getKey());
RestRequestBuilder requestBuilder = new RestRequestBuilder(uri).setMethod("get");
if (delay != null)
{
requestBuilder.setHeader("delay", delay.toString());
}
RestRequest request = requestBuilder.build();
Long queryPerSecond = partition.getValue();
for (int i = 0; i < queryPerSecond; i++)
{
//we don't care about the result from the server after all,
//you can see the traffic hits the echo server from stdout