diff options
| author | wangwei <[email protected]> | 2023-04-17 15:21:42 +0800 |
|---|---|---|
| committer | wangwei <[email protected]> | 2023-04-17 15:26:43 +0800 |
| commit | 9d5063e30e29b08094d6c35613a71181468fb38a (patch) | |
| tree | 033fa234cfe62efed9b3c95dfe2eb4707d557df2 | |
| parent | debce5cc94e7bf16d53443285259f4d76fb1c0fc (diff) | |
修改初始化配置23.05.01
6 files changed, 18 insertions, 12 deletions
diff --git a/config/application.yml b/config/application.yml index 3562367..164218d 100644 --- a/config/application.yml +++ b/config/application.yml @@ -1,8 +1,8 @@ nacos: config: type: yaml #配置集的配置格式 - server-addr: 192.168.44.12:8848 #配置中心地址 - namespace: prod #命名空间 + server-addr: 127.0.0.1:8848 #配置中心地址 + namespace: dev #命名空间 data-id: galaxy-report-service.yml # 数据集ID auto-refresh: true #开启自动刷新 group: Galaxy #配置对应的分组 diff --git a/config/nacos/config/fixed-127.0.0.1_8848-dev_nacos/data/config-data-tenant/dev/Galaxy/galaxy-report-service.yml b/config/nacos/config/fixed-127.0.0.1_8848-dev_nacos/data/config-data-tenant/dev/Galaxy/galaxy-report-service.yml index 20b8194..275baf6 100644 --- a/config/nacos/config/fixed-127.0.0.1_8848-dev_nacos/data/config-data-tenant/dev/Galaxy/galaxy-report-service.yml +++ b/config/nacos/config/fixed-127.0.0.1_8848-dev_nacos/data/config-data-tenant/dev/Galaxy/galaxy-report-service.yml @@ -20,7 +20,7 @@ hbase: rpc_timeout: 100000 connect_pool: 10 #存入Hbase的cell级别生存时间 根据部署环境填写:1.TSG 不设置(永久有效); 2.CN 7(默认7天) 单位:Day - cell_ttl: 7 + cell_ttl_d: #查询网关ip ck: gateway_ip: 192.168.44.55:9999 diff --git a/docs/release/release-23-04.md b/docs/release/release-23-04.md deleted file mode 100644 index 68fdc93..0000000 --- a/docs/release/release-23-04.md +++ /dev/null @@ -1,3 +0,0 @@ -Release 23.04 -* 离线报告服务支持指定结果储存TTL (GAL-317) -* 离线报告服务支持Nacos本地配置 (GAL-321)
\ No newline at end of file diff --git a/docs/release/release-23-05.md b/docs/release/release-23-05.md new file mode 100644 index 0000000..f5c6e04 --- /dev/null +++ b/docs/release/release-23-05.md @@ -0,0 +1,3 @@ +Release 23.05 +* 支持通过配置可指定结果储存TTL(GAL-317) +* 支持项目使用Nacos本地配置(GAL-321)
\ No newline at end of file diff --git a/src/main/java/com/mesa/reportservice/configuration/HbaseProperties.java b/src/main/java/com/mesa/reportservice/configuration/HbaseProperties.java index e814a6e..46fefc8 100644 --- a/src/main/java/com/mesa/reportservice/configuration/HbaseProperties.java +++ b/src/main/java/com/mesa/reportservice/configuration/HbaseProperties.java @@ -31,6 +31,8 @@ public class HbaseProperties { private String table; + private Integer cell_ttl_d; + public String getZookeeper_quorum() { @@ -98,4 +100,12 @@ public class HbaseProperties { public void setTable(String table) { this.table = table; } + + public void setCell_ttl_d(Integer cell_ttl_d) { + this.cell_ttl_d = cell_ttl_d; + } + + public Integer getCell_ttl_d() { + return cell_ttl_d; + } } diff --git a/src/main/java/com/mesa/reportservice/service/impl/HbaseServiceImpl.java b/src/main/java/com/mesa/reportservice/service/impl/HbaseServiceImpl.java index 89570ad..6932853 100644 --- a/src/main/java/com/mesa/reportservice/service/impl/HbaseServiceImpl.java +++ b/src/main/java/com/mesa/reportservice/service/impl/HbaseServiceImpl.java @@ -11,7 +11,6 @@ import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.util.Bytes; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.IOException; @@ -24,9 +23,6 @@ import java.io.IOException; @Service public class HbaseServiceImpl implements HbaseService { - @Value("${hbase.cell_ttl}") - private Long cellTTL; - @Autowired private Connection hbaseConnection; @@ -68,8 +64,8 @@ public class HbaseServiceImpl implements HbaseService { if (jobEntity.getMemory_usage() != null) { put.addColumn(Bytes.toBytes("detail"), Bytes.toBytes("memory_usage"), Bytes.toBytes(jobEntity.getMemory_usage())); } - if (cellTTL != null) { - put.setTTL(cellTTL * 86400 * 1000); + if (hbproperties.getCell_ttl_d() != null) { + put.setTTL(hbproperties.getCell_ttl_d() * 86400 * 1000); } table.put(put); status = true; |
