@Override public Future<Seq<Seq<Span>>> getTraces(QueryRequest input) { io.zipkin.QueryRequest.Builder request = new io.zipkin.QueryRequest.Builder() .serviceName(input.serviceName()) .spanName(input.spanName().isDefined() ? input.spanName().get() : null) .endTs(input.endTs()) .limit(input.limit()); for (Iterator<String> i = input.annotations().iterator(); i.hasNext(); ) { request.addAnnotation(i.next()); } for (Iterator<Tuple2<String, String>> i = input.binaryAnnotations().iterator(); i.hasNext(); ) { Tuple2<String, String> keyValue = i.next(); request.addBinaryAnnotation(keyValue._1(), keyValue._2()); } return toSeqFuture(this.spanStore.getTraces(request.build())); }