hbase连接实例化在线程内部
This commit is contained in:
@@ -32,8 +32,6 @@ public class BaselineSingleThread extends Thread {
|
||||
|
||||
private final int BASELINE_SAVE_LEVEL = ApplicationConfig.BASELINE_SAVE_LEVEL;
|
||||
|
||||
private final HbaseUtils hbaseUtils;
|
||||
private final Table hbaseTable;
|
||||
private final List<String> attackTypeList;
|
||||
private final Integer baselinePointNum;
|
||||
private final int batchPartitionRange;
|
||||
@@ -52,9 +50,6 @@ public class BaselineSingleThread extends Thread {
|
||||
int currentBatch,
|
||||
CountDownLatch countDownLatch
|
||||
){
|
||||
hbaseUtils = HbaseUtils.getInstance();
|
||||
|
||||
this.hbaseTable = hbaseUtils.getHbaseTable();
|
||||
this.attackTypeList = attackTypeList;
|
||||
this.baselinePointNum = baselinePointNum;
|
||||
this.batchPartitionRange = batchPartitionRange;
|
||||
@@ -65,6 +60,8 @@ public class BaselineSingleThread extends Thread {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void run(){
|
||||
HbaseUtils hbaseUtils = HbaseUtils.getInstance();
|
||||
Table hbaseTable = hbaseUtils.getHbaseTable();
|
||||
long start = System.currentTimeMillis();
|
||||
// 数据读取
|
||||
Map<String, List<Map<String, Object>>> batchDruidData = new HashMap<>();
|
||||
@@ -144,7 +141,6 @@ public class BaselineSingleThread extends Thread {
|
||||
|
||||
LOG.info("开始数据处理");
|
||||
readFromDruid = DruidData.selectAll(maps);
|
||||
LOG.info("完成数据处理");
|
||||
|
||||
} catch (SQLException e){
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -18,7 +18,7 @@ hbase.zookeeper.client.port=2181
|
||||
# 0:读取默认范围天数read.historical.days;
|
||||
# 1:指定时间范围
|
||||
read.druid.time.limit.type=1
|
||||
read.druid.min.time=1630080000000
|
||||
read.druid.min.time=1627747200000
|
||||
read.druid.max.time=1630425600000
|
||||
|
||||
#Druid字段映射
|
||||
@@ -68,7 +68,7 @@ monitor.frequency.bin.num=100
|
||||
##########################################
|
||||
################ 并发参数 #################
|
||||
##########################################
|
||||
thread.pool.num=10
|
||||
thread.pool.num=5
|
||||
#druid分区字段partition_num的最大值为9999
|
||||
druid.statement.query.timeout=36000
|
||||
druid.partition.num.max=10000
|
||||
|
||||
Reference in New Issue
Block a user