brave.propagation.TraceContext.equals()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中brave.propagation.TraceContext.equals()方法的一些代码示例,展示了TraceContext.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TraceContext.equals()方法的具体详情如下:
包路径:brave.propagation.TraceContext
类名称:TraceContext
方法名:equals

TraceContext.equals介绍

[英]Includes mandatory fields #traceIdHigh(), #traceId(), #spanId() and the #shared().

The shared flag is included to have parity with the #hashCode().
[中]包括必填字段#traceIdHigh()、#traceId()、#spanId()和#shared()。
包含共享标志是为了与#hashCode()具有奇偶性。

代码示例

代码示例来源:origin: openzipkin/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof RealSpan)) return false;
 return context.equals(((RealSpan) o).context);
}

代码示例来源:origin: openzipkin/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof NoopSpan)) return false;
 return context.equals(((NoopSpan) o).context);
}

代码示例来源:origin: openzipkin/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof NoopScopedSpan)) return false;
 NoopScopedSpan that = (NoopScopedSpan) o;
 return context.equals(that.context) && scope.equals(that.scope);
}

代码示例来源:origin: openzipkin/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof RealScopedSpan)) return false;
 RealScopedSpan that = (RealScopedSpan) o;
 return context.equals(that.context) && scope.equals(that.scope);
}

代码示例来源:origin: openzipkin/brave

/** Resolves hash code collisions */
 @Override public boolean equals(Object other) {
  TraceContext thisContext = get(), thatContext = ((RealKey) other).get();
  if (thisContext == null) {
   return thatContext == null;
  } else {
   return thisContext.equals(thatContext);
  }
 }
}

代码示例来源:origin: openzipkin/brave

KafkaTracing(Builder builder) { // intentionally hidden constructor
 this.tracing = builder.tracing;
 this.extractor = tracing.propagation().extractor(KafkaPropagation.GETTER);
 List<String> keyList = builder.tracing.propagation().keys();
 // Use a more efficient injector if we are only propagating a single header
 if (builder.writeB3SingleFormat || keyList.equals(Propagation.B3_SINGLE_STRING.keys())) {
  TraceContext testExtraction = extractor.extract(B3_SINGLE_TEST_HEADERS).context();
  if (!TEST_CONTEXT.equals(testExtraction)) {
   throw new IllegalArgumentException(
     "KafkaTracing.Builder.writeB3SingleFormat set, but Tracing.Builder.propagationFactory cannot parse this format!");
  }
  this.injector = KafkaPropagation.B3_SINGLE_INJECTOR;
 } else {
  this.injector = tracing.propagation().injector(KafkaPropagation.SETTER);
 }
 this.propagationKeys = new LinkedHashSet<>(keyList);
 this.remoteServiceName = builder.remoteServiceName;
}

代码示例来源:origin: openzipkin/brave

SpringRabbitTracing(Builder builder) { // intentionally hidden constructor
 this.tracing = builder.tracing;
 this.extractor = tracing.propagation().extractor(SpringRabbitPropagation.GETTER);
 List<String> keyList = builder.tracing.propagation().keys();
 // Use a more efficient injector if we are only propagating a single header
 if (builder.writeB3SingleFormat || keyList.equals(Propagation.B3_SINGLE_STRING.keys())) {
  TraceContext testExtraction = extractor.extract(B3_SINGLE_TEST_HEADERS).context();
  if (!TEST_CONTEXT.equals(testExtraction)) {
   throw new IllegalArgumentException(
     "SpringRabbitTracing.Builder.writeB3SingleFormat set, but Tracing.Builder.propagationFactory cannot parse this format!");
  }
  this.injector = SpringRabbitPropagation.B3_SINGLE_INJECTOR;
 } else {
  this.injector = tracing.propagation().injector(SpringRabbitPropagation.SETTER);
 }
 this.propagationKeys = keyList;
 this.remoteServiceName = builder.remoteServiceName;
 Field beforePublishPostProcessorsField = null;
 try {
  beforePublishPostProcessorsField =
    RabbitTemplate.class.getDeclaredField("beforePublishPostProcessors");
  beforePublishPostProcessorsField.setAccessible(true);
 } catch (NoSuchFieldException e) {
 }
 this.beforePublishPostProcessorsField = beforePublishPostProcessorsField;
}

代码示例来源:origin: openzipkin/brave

return newScope(null);
return currentSpan.equals(currentScope) ? Scope.NOOP : newScope(currentSpan);

代码示例来源:origin: io.zipkin.brave/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof NoopSpan)) return false;
 return context.equals(((NoopSpan) o).context);
}

代码示例来源:origin: io.zipkin.brave/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof RealSpan)) return false;
 return context.equals(((RealSpan) o).context);
}

代码示例来源:origin: io.zipkin.brave/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof NoopScopedSpan)) return false;
 NoopScopedSpan that = (NoopScopedSpan) o;
 return context.equals(that.context) && scope.equals(that.scope);
}

代码示例来源:origin: io.zipkin.brave/brave

@Override public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof RealScopedSpan)) return false;
 RealScopedSpan that = (RealScopedSpan) o;
 return context.equals(that.context) && scope.equals(that.scope);
}

代码示例来源:origin: io.zipkin.brave/brave

/** Resolves hash code collisions */
 @Override public boolean equals(Object other) {
  TraceContext thisContext = get(), thatContext = ((RealKey) other).get();
  if (thisContext == null) {
   return thatContext == null;
  } else {
   return thisContext.equals(thatContext);
  }
 }
}

代码示例来源:origin: io.zipkin.brave/brave-instrumentation-kafka-clients

KafkaTracing(Builder builder) { // intentionally hidden constructor
 this.tracing = builder.tracing;
 this.extractor = tracing.propagation().extractor(KafkaPropagation.GETTER);
 List<String> keyList = builder.tracing.propagation().keys();
 // Use a more efficient injector if we are only propagating a single header
 if (builder.writeB3SingleFormat || keyList.equals(Propagation.B3_SINGLE_STRING.keys())) {
  TraceContext testExtraction = extractor.extract(B3_SINGLE_TEST_HEADERS).context();
  if (!TEST_CONTEXT.equals(testExtraction)) {
   throw new IllegalArgumentException(
     "KafkaTracing.Builder.writeB3SingleFormat set, but Tracing.Builder.propagationFactory cannot parse this format!");
  }
  this.injector = KafkaPropagation.B3_SINGLE_INJECTOR;
 } else {
  this.injector = tracing.propagation().injector(KafkaPropagation.SETTER);
 }
 this.propagationKeys = new LinkedHashSet<>(keyList);
 this.remoteServiceName = builder.remoteServiceName;
}

代码示例来源:origin: io.zipkin.brave/brave

return newScope(null);
return currentSpan.equals(currentScope) ? Scope.NOOP : newScope(currentSpan);

相关文章