Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insertRow(String accountId, JsonNode data) throws Exception {
- ProxyConfig proxyConfig = (new ObjectMapper()).readValue(new File("/Users/ankesh.maheshwari/flipkart/usl/core/src/main/resources/hbaseConfig.json"),ProxyConfig.class);
- SimpleProxy.PROXY.start(proxyConfig);
- CacheConfig cache = proxyConfig.cache;
- CommandCache commandCache = new GuavaCache(cache);
- HystrixCommand.Setter setter = HystrixCommand.Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("Group"));
- HBaseRequestV2 hBaseRequestV2 = HBasePutRequestV2
- .builder()
- .tableName("usl_test")
- .put(getRowKey(accountId,"search"), "value", "data", mapper.writeValueAsString(data))
- .responseHandler(CommandResponse::new)
- .build();
- CommandInfo commandInfo = CommandInfoManager.INSTANCE.getCommandInfo("hbase");
- HBaseCommandV2 commandV2 = new HBaseCommandV2(commandInfo, hBaseRequestV2, setter, commandCache);
- hBaseRequestV2.accept(commandV2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement