Commit b3336207 by haozi

完善Hbase demo,测试通过

parent 17fd3674
......@@ -20,6 +20,13 @@
<dependency>
<groupId>com.secoo.mall</groupId>
<artifactId>logger-starter</artifactId>
<!--解决启动加载apollo,Config空指针问题-->
<exclusions>
<exclusion>
<artifactId>apollo-client</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.secoo.mall</groupId>
......
package mall;
package com.secoo.mall;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
......
package mall.hbase;
package com.secoo.mall.hbase;
import com.secoo.mall.hbase.spring.boot.autoconfigure.HbaseTemplate;
import lombok.extern.slf4j.Slf4j;
......@@ -53,7 +53,9 @@ public class SimpleHBase implements InitializingBean {
log.info("Creating table. ");
Admin admin = hbaseTemplate.getConnection().getAdmin();
if(!admin.tableExists(TableName.valueOf(TABLE_NAME))){
admin.createTable(tableDescriptor);
}
log.info(" Done.");
}
......@@ -86,8 +88,8 @@ public class SimpleHBase implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
createTable();
// createTable();
// put();
// get();
get();
}
}
......@@ -7,4 +7,4 @@ server:
hbase:
zookeeper:
quorum: 10.0.255.184:2181,10.0.255.185:2181,10.0.255.186:2181
quorum: 10.4.3.236:2181,10.4.3.237:2181,10.4.3.235:2181
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment