TraceStoreUtils.java
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.yoho.trace.sleuth.util;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.ValueFilter;
import com.yoho.trace.sleuth.Span;
import com.yoho.trace.sleuth.Spans;
import com.yoho.trace.sleuth.ZipkinESStoreConfiguration;
import com.yoho.trace.sleuth.ZipkinMessageListener;
import org.apache.commons.collections.CollectionUtils;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.util.Bytes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by markeloff on 2017/7/26.
*/
public class TraceStoreUtils {
private static ZipkinMessageListener zipkinMessageListener;
private static final Logger logger = LoggerFactory.getLogger(TraceStoreUtils.class);
static {
zipkinMessageListener = ZipkinESStoreConfiguration.createZipkinMessageListener();
}
public static void store(Spans spans) {
if (spans != null && CollectionUtils.isNotEmpty(spans.getSpans())) {
//zipkinMessageListener.sink(spans);
}
}
}