/** * Name of the datacenter that will be considered "local" for latency load balancing. When * unset, load-balancing is round-robin. */ public Builder localDc(@Nullable String localDc) { this.localDc = localDc; return this; }
/** Will throw an exception on startup if authentication fails. No default. */ public Builder password(@Nullable String password) { this.password = password; return this; }
/** * Version of {@link zipkin.SpanStore#getDependencies} that returns {@link ListenableFuture}. */ ListenableFuture<List<DependencyLink>> getDependencies(long endTs, @Nullable Long lookback); }
DependencyLinkV2SpanIterator(PeekingIterator<Record> delegate, @Nullable Long traceIdHi, long traceIdLo) { this.delegate = delegate; this.traceIdHi = traceIdHi; this.traceIdLo = traceIdLo; }
@Override public void toJson(JsonWriter writer, @Nullable BinaryAnnotation value) throws IOException { throw new UnsupportedOperationException(); } };
@Override public void toJson(JsonWriter writer, @Nullable Endpoint value) throws IOException { throw new UnsupportedOperationException(); } }.nullSafe();
@Override public Set<Object> apply(@Nullable List<Map<Object, ?>> input) { Set<Object> traceIds = Sets.newLinkedHashSet(input.get(0).keySet()); for (int i = 1; i < input.size(); i++) { traceIds.retainAll(input.get(i).keySet()); } return traceIds; }
@Override public List<String> apply(@Nullable ResultSet input) { Set<String> spanNames = new HashSet<>(); for (Row row : input) { spanNames.add(row.getString("span_name")); } return Ordering.natural().sortedCopy(spanNames); } }
@Nullable @Override public Integer statusCode(@Nonnull Response response) { return response.getStatusCode(); } }
@Nullable @Override public Integer statusCode(@Nonnull Response response) { return response.getStatusCode(); } }
@Override public Map<Long, Long> apply(@Nullable ResultSet input) { Map<Long, Long> traceIdsToTimestamps = new LinkedHashMap<>(); for (Row row : input) { traceIdsToTimestamps.put(row.getLong("trace_id"), timestampCodec.deserialize(row, "ts")); } return traceIdsToTimestamps; } }
@Nullable @Override public String method(@Nonnull Invocation invocation) { return invocation.getOperationMeta().getHttpMethod(); }
@Nullable @Override public String method(@Nonnull Invocation invocation) { return invocation.getOperationMeta().getHttpMethod(); }
@Nullable @Override public String path(@Nonnull Invocation request) { return request.getOperationMeta().getOperationPath(); }
@Override public List<DependencyLink> apply(@Nullable ResultSet rs) { ImmutableList.Builder<DependencyLink> unmerged = ImmutableList.builder(); for (Row row : rs) { ByteBuffer encodedDayOfDependencies = row.getBytes("dependencies"); for (DependencyLink link : Dependencies.fromThrift(encodedDayOfDependencies).links) { unmerged.add(link); } } return DependencyLinker.merge(unmerged.build()); }
@Override public ListenableFuture<List<DependencyLink>> getDependencies(long endTs, @Nullable Long lookback) { CallbackListenableFuture<List<DependencyLink>> result = new CallbackListenableFuture<>(); delegate.getDependencies(endTs, lookback, result); return result; }
@Override public ListenableFuture<List<DependencyLink>> getDependencies(long endTs, @Nullable Long lookback) { CallbackListenableFuture<List<DependencyLink>> result = new CallbackListenableFuture<>(); asyncSpanStore.getDependencies(endTs, lookback, result); return result; }
@Override public List<Span> apply(@Nullable ResultSet input) { List<Span> result = new ArrayList<>(input.getAvailableWithoutFetching()); for (Row row : input) { result.add(Codec.THRIFT.readSpan(row.getBytes("span"))); } return result; } }
@Override public void onSuccess(@Nullable List<String> value) { if (!value.isEmpty()) callback.onSuccess(value); // Special cased code until sites update their collectors. What this does is do a more // expensive nested query to get service names when the servicespan type returns nothing. SearchRequest.Filters filters = new SearchRequest.Filters(); filters.addRange("timestamp_millis", beginMillis, endMillis); SearchRequest request = SearchRequest.create(indices, SPAN).filters(filters) .addAggregation(Aggregation.nestedTerms("annotations.endpoint.serviceName")) .addAggregation(Aggregation.nestedTerms("binaryAnnotations.endpoint.serviceName")); submit(search.newCall(request, KEYS), callback); }