本文整理汇总了Java中org.apache.curator.drivers.TracerDriver类的典型用法代码示例。如果您正苦于以下问题:Java TracerDriver类的具体用法?Java TracerDriver怎么用?Java TracerDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TracerDriver类属于org.apache.curator.drivers包,在下文中一共展示了TracerDriver类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ConnectionState
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
ConnectionState(ZookeeperFactory zookeeperFactory, EnsembleProvider ensembleProvider, int sessionTimeoutMs, int connectionTimeoutMs, Watcher parentWatcher, AtomicReference<TracerDriver> tracer, boolean canBeReadOnly, ConnectionHandlingPolicy connectionHandlingPolicy)
{
this.ensembleProvider = ensembleProvider;
this.sessionTimeoutMs = sessionTimeoutMs;
this.connectionTimeoutMs = connectionTimeoutMs;
this.tracer = tracer;
this.connectionHandlingPolicy = connectionHandlingPolicy;
if ( parentWatcher != null )
{
parentWatchers.offer(parentWatcher);
}
zooKeeper = new HandleHolder(zookeeperFactory, this, ensembleProvider, sessionTimeoutMs, canBeReadOnly);
}
示例2: getInstance_TracerDriver_ReturnsValue
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
@Test
public void getInstance_TracerDriver_ReturnsValue() {
TracerDriver driver = Guice.createInjector(new MetricsModule()).getInstance(
Key.get(TracerDriver.class, Curator.class));
assertNotNull(driver);
}
示例3: configure
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
@Override
protected void configure() {
install(new PrivateModule() {
@Override
protected void configure() {
requireBinding(MetricRegistry.class);
bindConstant().annotatedWith(Names.named("Cultivar.Metrics.prefix")).to(prefix);
bind(TracerDriver.class).to(MetricsTracerDriver.class);
expose(TracerDriver.class);
bind(ConnectionStateMetricsListener.class).in(Singleton.class);
expose(ConnectionStateMetricsListener.class);
}
});
Multibinder<ConnectionStateListener> listeners = Multibinder.newSetBinder(binder(),
ConnectionStateListener.class);
listeners.addBinding().to(ConnectionStateMetricsListener.class);
}
示例4: getInstance_TracerDriver_ReturnsValue
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
@Test
public void getInstance_TracerDriver_ReturnsValue() {
TracerDriver driver = Guice.createInjector(new MetricsModule()).getInstance(TracerDriver.class);
assertNotNull(driver);
}
示例5: RetryLoop
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
RetryLoop(RetryPolicy retryPolicy, AtomicReference<TracerDriver> tracer)
{
this.retryPolicy = retryPolicy;
this.tracer = tracer;
}
示例6: OperationTrace
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
public OperationTrace(String name, TracerDriver driver) {
this(name, driver, -1);
}
示例7: configure
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
@Override
protected void configure() {
install(new PrivateModule() {
@Override
protected void configure() {
requireBinding(MetricRegistry.class);
bindConstant().annotatedWith(Names.named("Cultivar.Metrics.prefix")).to(prefix);
bind(TracerDriver.class).annotatedWith(Curator.class).to(MetricsTracerDriver.class);
expose(TracerDriver.class).annotatedWith(Curator.class);
bind(ConnectionStateMetricsListener.class).in(Singleton.class);
expose(ConnectionStateMetricsListener.class);
}
});
Multibinder<ConnectionStateListener> listeners = Multibinder.newSetBinder(binder(),
ConnectionStateListener.class);
listeners.addBinding().to(ConnectionStateMetricsListener.class);
}
示例8: setTracerDriver
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
@Inject(optional = true)
public void setTracerDriver(@Curator final TracerDriver tracerDriver) {
this.tracerDriver = Optional.of(tracerDriver);
}
示例9: TimeTrace
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
/**
* Create and start a timer
*
* @param name name of the event
* @param driver driver
*/
public TimeTrace(String name, TracerDriver driver)
{
this.name = name;
this.driver = driver;
}
示例10: getTracerDriver
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
/**
* Return the current tracing driver
*
* @return tracing driver
*/
public TracerDriver getTracerDriver()
{
return tracer.get();
}
示例11: setTracerDriver
import org.apache.curator.drivers.TracerDriver; //导入依赖的package包/类
/**
* Change the tracing driver
*
* @param tracer new tracing driver
*/
public void setTracerDriver(TracerDriver tracer)
{
this.tracer.set(tracer);
}