如何使用spring boot

时间:2018-06-08 07:28:32

标签: hadoop spring-boot spring-data-jpa hbase

如何使用spring boot java将数据读入和写入hbase,这是我的代码。如何使用application.properties将hadoop属性配置到我的api中?

    @Controller
    @ComponentScan(basePackages = "com.eyedentify.*")
    @SpringBootApplication
    public class SampleHadoopApplication{
        public static void main(String[] args) {
            SpringApplication.run(SampleHadoopApplication.class, args);
        }
        @RequestMapping(value="/")
        @ResponseBody
        public String home() {
            return "Hello !!...";
        }

@Controller
@RequestMapping(value = "/sample")
@Api(value = "Eye-SampleController", tags = "Eyedentify API")

public class SampleController {
@RequestMapping(value = "/test", method = RequestMethod.GET)
@ResponseBody
public String sample() {
    return "eydentify sample is Up !!";
}

我希望我的Controller与存储库通信并相应地执行操作。

/*
 * @RequestMapping(value="/")
 * 
 * @ResponseBody public String home() { return "Hello MMBit"; }
 */
@RequestMapping(value = "/hi", method = RequestMethod.GET)
@ResponseBody
public String getHello() {
    return "Hello image Api is working";
}   
===============================    

application.properties

 spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
server.port=9090

如何配置Hbase驱动程序以及如何与DB建立通信以及如何执行crud操作?

0 个答案:

没有答案