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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Constructor
  3. *
  4. * @param ip Int representation of ipv4 address.
  5. * @param port port on which current process is listening.
  6. * @param serviceName Name of the local service being traced. Should be lowercase and not <code>null</code> or empty.
  7. */
  8. public ThreadLocalServerClientAndLocalSpanState(int ip, int port, String serviceName) {
  9. Util.checkNotBlank(serviceName, "Service name must be specified.");
  10. endpoint = Endpoint.create(serviceName, ip, port);
  11. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章