本文整理汇总了Java中org.apache.accumulo.core.trace.DistributedTrace类的典型用法代码示例。如果您正苦于以下问题:Java DistributedTrace类的具体用法?Java DistributedTrace怎么用?Java DistributedTrace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DistributedTrace类属于org.apache.accumulo.core.trace包,在下文中一共展示了DistributedTrace类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: traceOn
import org.apache.accumulo.core.trace.DistributedTrace; //导入依赖的package包/类
@Override
public void traceOn(String description, Map<String, String> data) {
if (!distributedTraceEnabled) {
try {
ClientConfiguration conf = getConfiguration().getClientConfiguration();
DistributedTrace.enable(null, AccumuloGraph.class.getSimpleName(), conf);
distributedTraceEnabled = true;
} catch (Exception e) {
throw new VertexiumException("Could not enable DistributedTrace", e);
}
}
if (Trace.isTracing()) {
throw new VertexiumException("Trace already running");
}
Span span = Trace.on(description);
for (Map.Entry<String, String> dataEntry : data.entrySet()) {
span.data(dataEntry.getKey(), dataEntry.getValue());
}
LOGGER.info("Started trace '%s'", description);
}
示例2: enableTracing
import org.apache.accumulo.core.trace.DistributedTrace; //导入依赖的package包/类
public void enableTracing(Opts opts) throws Exception {
DistributedTrace.enable("myHost", "myApp");
}