com.github.kristofa.brave.internal.Util类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(149)

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

Util介绍

[英]Utilities, typically copied in from guava, so as to avoid dependency conflicts.
[中]实用程序,通常从guava中复制,以避免依赖冲突。

代码示例

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

/**
 * Creates a new instance.
 *
 * @param state Server span state, should not be <code>null</code>
 */
public ServerSpanThreadBinder(ServerSpanState state) {
  this.state = checkNotNull(state, "state");
}

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

/**
 * @param endpoint Endpoint of the local service being traced.
 */
public ThreadLocalServerClientAndLocalSpanState(Endpoint endpoint) {
  Util.checkNotNull(endpoint, "endpoint must be specified.");
  Util.checkNotBlank(endpoint.service_name, "Service name must be specified.");
  this.endpoint = endpoint;
}

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

@Override
public boolean equals(Object o) {
 if (o == this) return true;
 if (!(o instanceof Span)) return false;
 Span that = (Span) o;
 return (this.trace_id_high == that.trace_id_high)
   && (this.trace_id == that.trace_id)
   && (this.name.equals(that.name))
   && (this.id == that.id)
   && equal(this.parent_id, that.parent_id)
   && equal(this.timestamp, that.timestamp)
   && equal(this.duration, that.duration)
   && equal(this.annotations, that.annotations)
   && equal(this.binary_annotations, that.binary_annotations)
   && equal(this.debug, that.debug)
   && equal(this.shared, that.shared);
}

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

public LoggingSpanCollector(String loggerName) {
  checkNotBlank(loggerName, "Null or blank loggerName");
  logger = Logger.getLogger(loggerName);
}

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

public LoggingReporter(String loggerName) {
 checkNotBlank(loggerName, "Null or blank loggerName");
 logger = Logger.getLogger(loggerName);
}

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

/**
 * Creates a new instance.
 *
 * @param state client span state, should not be <code>null</code>
 */
public ClientSpanThreadBinder(ClientSpanState state) {
  this.state = checkNotNull(state, "state");
}

代码示例来源:origin: com.github.kristofa/brave-core

BinaryAnnotation(String key, byte[] value, AnnotationType type, @Nullable Endpoint host) {
 this.key = checkNotBlank(key, "Null or blank key");
 this.value = checkNotNull(value, "Null value");
 this.type = type;
 this.host = host;
}

代码示例来源:origin: xuminwlt/j360-dubbo-app-all

public Slf4jLogReporter(String loggerName) {
  Util.checkNotBlank(loggerName, "Null or blank loggerName", new Object[0]);
  this.logger = LoggerFactory.getLogger(loggerName);
}

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

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof Endpoint) {
  Endpoint that = (Endpoint) o;
  return equal(this.service_name, that.service_name)
    && (this.ipv4 == that.ipv4)
    && (Arrays.equals(this.ipv6, that.ipv6))
    && equal(this.port, that.port);
 }
 return false;
}

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

SpanId(Builder builder) {
 checkNotNull(builder.spanId, "spanId");
 this.traceIdHigh = builder.traceIdHigh;
 this.traceId = builder.traceId != null ? builder.traceId : builder.spanId;
 this.parentId = builder.nullableParentId != null ? builder.nullableParentId : this.traceId;
 this.spanId = builder.spanId;
 this.flags = builder.flags;
}

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

BinaryAnnotation(String key, byte[] value, AnnotationType type, @Nullable Endpoint host) {
 this.key = checkNotBlank(key, "Null or blank key");
 this.value = checkNotNull(value, "Null value");
 this.type = type;
 this.host = host;
}

代码示例来源:origin: com.palantir.remoting1/brave-extensions

public SlfLoggingSpanCollector(String loggerName) {
  Util.checkNotBlank(loggerName, "loggerName must not be blank or null");
  log = LoggerFactory.getLogger(loggerName);
}

代码示例来源:origin: com.github.kristofa/brave-core

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof Span) {
  Span that = (Span) o;
  return (this.trace_id == that.trace_id)
    && (this.name.equals(that.name))
    && (this.id == that.id)
    && equal(this.parent_id, that.parent_id)
    && equal(this.timestamp, that.timestamp)
    && equal(this.duration, that.duration)
    && equal(this.annotations, that.annotations)
    && equal(this.binary_annotations, that.binary_annotations)
    && equal(this.debug, that.debug);
 }
 return false;
}

代码示例来源:origin: com.github.kristofa/brave-core

/**
 * Creates a new instance.
 * 
 * @param wrappedExecutor Wrapped ExecutorService to which execution will be delegated.
 * @param threadBinder Thread binder.
 */
public BraveExecutorService(final ExecutorService wrappedExecutor, final ServerSpanThreadBinder threadBinder) {
  this.wrappedExecutor = checkNotNull(wrappedExecutor, "Null wrappedExecutor");
  this.threadBinder = checkNotNull(threadBinder, "Null threadBinder");
}

代码示例来源:origin: com.github.kristofa/brave-core

/**
 * Constructor
 *
 * @param ip InetAddress of current host. If you don't have access to InetAddress you can use InetAddressUtilities#getLocalHostLANAddress()
 * @param port port on which current process is listening.
 * @param serviceName Name of the local service being traced. Should be lowercase and not <code>null</code> or empty.
 * @deprecated Please switch to constructor that takes 'int' for ip. This only does a conversion from the InetAddress to integer anyway
 *             and using InetAddress can result in ns lookup and nasty side effects.
 */
@Deprecated
public ThreadLocalServerClientAndLocalSpanState(InetAddress ip, int port, String serviceName) {
  Util.checkNotNull(ip, "ip address must be specified.");
  Util.checkNotBlank(serviceName, "Service name must be specified.");
  endpoint = Endpoint.create(serviceName, InetAddressUtilities.toInt(ip), port);
}

代码示例来源:origin: com.github.kristofa/brave-core

public LoggingSpanCollector(String loggerName) {
  checkNotBlank(loggerName, "Null or blank loggerName");
  logger = Logger.getLogger(loggerName);
}

代码示例来源:origin: com.github.kristofa/brave-core

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof Endpoint) {
  Endpoint that = (Endpoint) o;
  return this.service_name.equals(that.service_name)
    && this.ipv4 == that.ipv4
    && equal(this.port, that.port);
 }
 return false;
}

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

/**
 * Creates a new instance.
 *
 * @param state local span state, cannot be <code>null</code>
 */
public LocalSpanThreadBinder(LocalSpanState state) {
 this.state = checkNotNull(state, "state");
}

代码示例来源:origin: com.palantir.remoting/brave-extensions

public SlfLoggingSpanCollector(String loggerName) {
  Util.checkNotBlank(loggerName, "loggerName must not be blank or null");
  log = LoggerFactory.getLogger(loggerName);
}

代码示例来源:origin: com.github.kristofa/brave-core

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof BinaryAnnotation) {
  BinaryAnnotation that = (BinaryAnnotation) o;
  return (this.key.equals(that.key))
    && (Arrays.equals(this.value, that.value))
    && (this.type.equals(that.type))
    && equal(this.host, that.host);
 }
 return false;
}

相关文章

微信公众号

最新文章

更多