• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StorageComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中zipkin.storage.StorageComponent的典型用法代码示例。如果您正苦于以下问题:Java StorageComponent类的具体用法?Java StorageComponent怎么用?Java StorageComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StorageComponent类属于zipkin.storage包,在下文中一共展示了StorageComponent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: eventHubCollector

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
EventHubCollector eventHubCollector(EventHubCollectorProperties properties,
                                    CollectorSampler sampler,
                                    CollectorMetrics metrics,
                                    StorageComponent storage) {


  logger.log(Level.INFO,"===========EventHubCollectorAutoConfiguration==============");

  return properties.toBuilder()
      .sampler(sampler)
      .storage(storage)
      .metrics(metrics)
      .build()
      .start();
}
 
开发者ID:aliostad,项目名称:zipkin-collector-eventhub,代码行数:17,代码来源:EventHubCollectorAutoConfiguration.java


示例2: acceptsTrace

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Test
public void acceptsTrace() {
  storage = new InMemoryStorage();
  StorageConsumer storageConsumer = new StorageConsumer() {
    @Override Logger log() {
      return logger;
    }

    @Override protected StorageComponent tryCompute() {
      return storage;
    }
  };

  storageConsumer.accept(TestObjects.TRACE);
  assertThat(logger.lines())
      .extracting("level", "text")
      .containsExactly(tuple(LogLevel.DebugLevel, "Wrote 3 spans"));

  assertThat(storage.spanStore().getRawTrace(
      TestObjects.TRACE.get(0).traceIdHigh,
      TestObjects.TRACE.get(0).traceId
  )).isEqualTo(TestObjects.TRACE);
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:24,代码来源:StorageConsumerTest.java


示例3: get_memoizes

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Test(timeout = 1000L)
public void get_memoizes() throws InterruptedException {
  AtomicInteger provisionCount = new AtomicInteger();

  StorageConsumer storageConsumer = new StorageConsumer() {
    @Override protected StorageComponent tryCompute() {
      provisionCount.incrementAndGet();
      return new InMemoryStorage();
    }
  };

  int getCount = 1000;
  CountDownLatch latch = new CountDownLatch(getCount);
  ExecutorService exec = Executors.newFixedThreadPool(10);
  for (int i = 0; i < getCount; i++) {
    exec.execute(() -> {
      storageConsumer.get();
      latch.countDown();
    });
  }
  latch.await();
  exec.shutdown();
  exec.awaitTermination(1, TimeUnit.SECONDS);

  assertThat(provisionCount.get()).isEqualTo(1);
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:27,代码来源:StorageConsumerTest.java


示例4: storageConsumer

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@ConditionalOnBean(StorageComponent.class)
@Bean StorageConsumer storageConsumer(
    StorageComponent component,
    @Value("${zipkin.sparkstreaming.consumer.storage.fail-fast:true}") boolean failFast,
    BeanFactory bf
) throws IOException {
  if (failFast) checkStorageOk(component);
  Properties properties = extractZipkinProperties(bf.getBean(ConfigurableEnvironment.class));
  if (component instanceof V2StorageComponent) {
    zipkin2.storage.StorageComponent v2Storage = ((V2StorageComponent) component).delegate();
    if (v2Storage instanceof ElasticsearchHttpStorage) {
      return new ElasticsearchStorageConsumer(properties);
    } else if (v2Storage instanceof zipkin2.storage.cassandra.CassandraStorage) {
      return new Cassandra3StorageConsumer(properties);
    } else {
      throw new UnsupportedOperationException(v2Storage + " not yet supported");
    }
  } else if (component instanceof CassandraStorage) {
    return new CassandraStorageConsumer(properties);
  } else if (component instanceof MySQLStorage) {
    return new MySQLStorageConsumer(properties);
  } else {
    throw new UnsupportedOperationException(component + " not yet supported");
  }
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:26,代码来源:ZipkinStorageConsumerAutoConfiguration.java


示例5: newScribeSpanConsumer

import zipkin.storage.StorageComponent; //导入依赖的package包/类
ScribeSpanConsumer newScribeSpanConsumer(String category, AsyncSpanConsumer consumer) {
  return new ScribeSpanConsumer(ScribeCollector.builder()
      .category(category)
      .metrics(scribeMetrics)
      .storage(new StorageComponent() {
        @Override public SpanStore spanStore() {
          throw new AssertionError();
        }

        @Override public AsyncSpanStore asyncSpanStore() {
          throw new AssertionError();
        }

        @Override public AsyncSpanConsumer asyncSpanConsumer() {
          return consumer;
        }

        @Override public CheckResult check() {
          return CheckResult.OK;
        }

        @Override public void close() {
          throw new AssertionError();
        }
      }));
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:27,代码来源:ScribeSpanConsumerTest.java


示例6: newKafkaTransport

import zipkin.storage.StorageComponent; //导入依赖的package包/类
KafkaCollector newKafkaTransport(Builder builder, AsyncSpanConsumer consumer) {
  return new KafkaCollector(builder.storage(new StorageComponent() {
    @Override public SpanStore spanStore() {
      throw new AssertionError();
    }

    @Override public AsyncSpanStore asyncSpanStore() {
      throw new AssertionError();
    }

    @Override public AsyncSpanConsumer asyncSpanConsumer() {
      return consumer;
    }

    @Override public CheckResult check() {
      return CheckResult.OK;
    }

    @Override public void close() {
      throw new AssertionError();
    }
  })).start();
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:24,代码来源:KafkaCollectorTest.java


示例7: eventHubCollector

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
EventHubCollector eventHubCollector(ZipkinEventHubCollectorProperties properties,
    CollectorSampler sampler,
    CollectorMetrics metrics,
    StorageComponent storage) {

  return properties.toBuilder()
      .sampler(sampler)
      .storage(storage)
      .metrics(metrics)
      .build()
      .start();
}
 
开发者ID:openzipkin,项目名称:zipkin-azure,代码行数:14,代码来源:ZipkinEventHubCollectorAutoConfiguration.java


示例8: get

import zipkin.storage.StorageComponent; //导入依赖的package包/类
final StorageComponent get() {
  StorageComponent result = instance;
  if (result == null) {
    synchronized (this) {
      result = instance;
      if (result == null) {
        instance = result = tryCompute();
      }
    }
  }
  return result;
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:13,代码来源:StorageConsumer.java


示例9: tryCompute

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Override protected StorageComponent tryCompute() {
  AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
  PropertiesPropertySource source = new PropertiesPropertySource("consumer", properties);
  context.getEnvironment().getPropertySources().addLast(source);

  context.register(PropertyPlaceholderAutoConfiguration.class);
  registerAutoConfiguration(context);
  context.refresh();

  return context.getBean(StorageComponent.class);
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:12,代码来源:ZipkinStorageConsumerAutoConfiguration.java


示例10: postProcessAfterInitialization

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
  if (bean instanceof StorageComponent && brave != null) {
    return new TracedStorageComponent(brave, (StorageComponent) bean);
  }
  return bean;
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:8,代码来源:ZipkinServerConfiguration.java


示例11: sqsCollector

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
SQSCollector sqsCollector(ZipkinSQSCollectorProperties properties, AWSCredentialsProvider credentialsProvider,
    CollectorSampler sampler, CollectorMetrics metrics, StorageComponent storage) {
  return properties.toBuilder()
      .queueUrl(properties.getQueueUrl())
      .waitTimeSeconds(properties.getWaitTimeSeconds())
      .parallelism(properties.getParallelism())
      .endpointConfiguration(endpointConfiguration)
      .credentialsProvider(credentialsProvider)
      .sampler(sampler)
      .metrics(metrics)
      .storage(storage)
      .build()
      .start();
}
 
开发者ID:openzipkin,项目名称:zipkin-aws,代码行数:16,代码来源:ZipkinSQSCollectorAutoConfiguration.java


示例12: kinesisCollector

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
KinesisCollector kinesisCollector(ZipkinKinesisCollectorProperties properties,
    AWSCredentialsProvider credentialsProvider,
    CollectorSampler sampler, CollectorMetrics metrics, StorageComponent storage) {
  return KinesisCollector.builder()
      .credentialsProvider(credentialsProvider)
      .sampler(sampler)
      .metrics(metrics)
      .storage(storage)
      .streamName(properties.getStreamName())
      .appName(properties.getAppName())
      .build()
      .start();
}
 
开发者ID:openzipkin,项目名称:zipkin-aws,代码行数:15,代码来源:ZipkinKinesisCollectorAutoConfiguration.java


示例13: ZipkinMessageListener

import zipkin.storage.StorageComponent; //导入依赖的package包/类
/** lazy so transient storage errors don't crash bootstrap */
@Lazy
@Autowired
ZipkinMessageListener(StorageComponent storage, CollectorSampler sampler,
		CollectorMetrics metrics) {
	this.collector = Collector.builder(getClass())
			.storage(storage)
			.sampler(sampler)
			.metrics(metrics.forTransport("stream")).build();
}
 
开发者ID:reshmik,项目名称:Zipkin,代码行数:11,代码来源:ZipkinMessageListener.java


示例14: storage

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
StorageComponent storage() {
    return new InMemoryStorage();
}
 
开发者ID:aliostad,项目名称:zipkin-collector-eventhub,代码行数:5,代码来源:EventHubCollectorAutoConfigurationTest.java


示例15: storage

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean
StorageComponent storage() {
  return new InMemoryStorage();
}
 
开发者ID:openzipkin,项目名称:zipkin-azure,代码行数:5,代码来源:ZipkinEventHubCollectorAutoConfigurationTest.java


示例16: tryCompute

import zipkin.storage.StorageComponent; //导入依赖的package包/类
/** Subclasses should initialize this from serializable state. */
protected abstract StorageComponent tryCompute();
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:3,代码来源:StorageConsumer.java


示例17: tryCompute

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Override protected StorageComponent tryCompute() {
  return storage;
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:4,代码来源:StorageConsumerTest.java


示例18: checkStorageOk

import zipkin.storage.StorageComponent; //导入依赖的package包/类
void checkStorageOk(StorageComponent component) throws IOException {
  Component.CheckResult result = component.check();
  if (!result.ok) throw new IllegalStateException("Storage not ok", result.exception);
  component.close(); // we don't use this directly as job instantiates their own
}
 
开发者ID:openzipkin,项目名称:zipkin-sparkstreaming,代码行数:6,代码来源:ZipkinStorageConsumerAutoConfiguration.java


示例19: storage

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Bean StorageComponent storage() {
  return new InMemoryStorage();
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:4,代码来源:ZipkinServerConfiguration.java


示例20: ZipkinHttpCollector

import zipkin.storage.StorageComponent; //导入依赖的package包/类
@Autowired ZipkinHttpCollector(StorageComponent storage, CollectorSampler sampler,
    CollectorMetrics metrics) {
  this.metrics = metrics.forTransport("http");
  this.collector = Collector.builder(getClass())
      .storage(storage).sampler(sampler).metrics(this.metrics).build();
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:7,代码来源:ZipkinHttpCollector.java



注:本文中的zipkin.storage.StorageComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MavenProjectChanges类代码示例发布时间:2022-05-22
下一篇:
Java LoggingEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap