File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
# 项目介绍
2
2
自定义的spring-boot的hbase starter,为hbase的query和更新等操作提供简易的api并集成spring-boot的auto configuration
3
+ # 打包
4
+ 修改相关的maven私服地址
5
+ ``` shell
6
+ gradle clean install uploadArchives
7
+ ```
3
8
# 使用方式
9
+ ## 依赖
10
+ ``` shell
11
+ compile " jthink:spring-boot-starter-hbase:0.0.1"
12
+ ```
4
13
## 集成
5
14
在spring-boot项目的application.properties文件中加入spring.data.hbase.quorum配置项,并赋予正确的值
6
15
## 使用
7
16
### query
8
-
17
+ 1 . 将上述配置项赋予正确的值
18
+ 2 . dto定义
9
19
``` java
10
20
public class PeopleDto {
11
21
@@ -32,6 +42,7 @@ public class PeopleDto {
32
42
}
33
43
}
34
44
```
45
+ 3 . RowMapper定义
35
46
``` java
36
47
import com.jthink.skyeye.data.hbase.api.RowMapper ;
37
48
import org.apache.hadoop.hbase.client.Result ;
@@ -54,6 +65,7 @@ public class PeopleRowMapper implements RowMapper<PeopleDto> {
54
65
}
55
66
}
56
67
```
68
+ 4 . query操作
57
69
``` java
58
70
import com.jthink.skyeye.data.hbase.api.HbaseTemplate ;
59
71
import org.apache.hadoop.hbase.client.Scan ;
@@ -82,6 +94,8 @@ public class QueryService {
82
94
}
83
95
```
84
96
### update等
97
+ 1 . 将上述配置项赋予正确的值
98
+ 2 . update、delete、put操作
85
99
``` java
86
100
import com.jthink.skyeye.data.hbase.api.HbaseTemplate ;
87
101
import org.apache.hadoop.hbase.client.Delete ;
@@ -126,4 +140,4 @@ public class QueryService {
126
140
```
127
141
128
142
### 其他
129
- 不可以满足需求的可以使用hbaseTemplate暴露出来的getConnection()方法
143
+ 不可以满足需求的可以使用hbaseTemplate暴露出来的getConnection()方法
You can’t perform that action at this time.
0 commit comments