kimi
2020-04-01 0d831f835708bab1351fa26c7e8aea0a9bf8911e
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
package com.highdatas.mdm.controller;
 
import com.highdatas.mdm.pojo.Result;
import com.highdatas.mdm.service.HBaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @author kimi
 * @description
 * @date 2019-12-13 10:57
 */
 
@Slf4j
@RestController
@RequestMapping("/hbase")
public class HbaseController {
 
    @Autowired
    HBaseService hBaseService;
 
 
    @RequestMapping(value = "/test")
    public Result deleteActUser(){
        List<org.apache.hadoop.hbase.client.Result> rowKeyAndColumn = hBaseService.getRowKeyAndColumn("test", "1", "2", "name", " 1 = 1");
        return Result.success(rowKeyAndColumn);
    }
 
    @RequestMapping(value = "/create/{tableName}")
    public Result create(@PathVariable String tableName){
        hBaseService.createTable(tableName);
        return Result.success(null);
    }
 
}