com.github.kristofa.brave.internal.Util.checkNotBlank()方法的使用及代码示例

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

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

Util.checkNotBlank介绍

暂无

代码示例

代码示例来源: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: com.github.kristofa/brave-core

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

代码示例来源: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: 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: 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

/**
 * Constructor
 *
 * @param ip Int representation of ipv4 address.
 * @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.
 */
public ThreadLocalServerClientAndLocalSpanState(int ip, int port, String serviceName) {
  Util.checkNotBlank(serviceName, "Service name must be specified.");
  endpoint = Endpoint.create(serviceName, ip, port);
}

代码示例来源: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

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.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: 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: io.zipkin.brave/brave-core

void setStateCurrentTrace(Span span, String spanName) {
  checkNotBlank(spanName, "Null or blank span name");
  recorder().name(span, spanName);
  currentSpan().setCurrentSpan(ServerSpan.create(span));
}
/**

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

/**
 * Sets the current Trace/Span state. Using this method indicates we are part of an existing trace/span.
 *
 * @param traceId Trace id.
 * @param spanId Span id.
 * @param parentSpanId Parent span id. Can be <code>null</code>.
 * @param name Name should not be empty or <code>null</code>.
 * @see ServerTracer#setStateNoTracing()
 * @see ServerTracer#setStateUnknown(String)
 */
public void setStateCurrentTrace(long traceId, long spanId, @Nullable Long parentSpanId, @Nullable String name) {
  checkNotBlank(name, "Null or blank span name");
  spanAndEndpoint().state().setCurrentServerSpan(
    ServerSpan.create(traceId, spanId, parentSpanId, name));
}

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

/**
 * Sets the current Trace/Span state. Using this method indicates that we got no information about being part of an
 * existing trace or about the fact that we should not trace the current request. In this case the ServerTracer will
 * decide what to do.
 *
 * @param spanName The name of our current request/span.
 */
public void setStateUnknown(String spanName) {
  checkNotBlank(spanName, "Null or blank span name");
  long newTraceId = randomGenerator().nextLong();
  if (!traceSampler().isSampled(newTraceId)) {
    spanAndEndpoint().state().setCurrentServerSpan(ServerSpan.NOT_SAMPLED);
    return;
  }
  spanAndEndpoint().state().setCurrentServerSpan(
    ServerSpan.create(newTraceId, newTraceId, null, spanName));
}

相关文章

微信公众号

最新文章

更多