Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public void insertRow(String accountId, JsonNode data) throws Exception {
  2. ProxyConfig proxyConfig = (new ObjectMapper()).readValue(new File("/Users/ankesh.maheshwari/flipkart/usl/core/src/main/resources/hbaseConfig.json"),ProxyConfig.class);
  3. SimpleProxy.PROXY.start(proxyConfig);
  4.  
  5. CacheConfig cache = proxyConfig.cache;
  6. CommandCache commandCache = new GuavaCache(cache);
  7. HystrixCommand.Setter setter = HystrixCommand.Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("Group"));
  8. HBaseRequestV2 hBaseRequestV2 = HBasePutRequestV2
  9. .builder()
  10. .tableName("usl_test")
  11. .put(getRowKey(accountId,"search"), "value", "data", mapper.writeValueAsString(data))
  12. .responseHandler(CommandResponse::new)
  13. .build();
  14. CommandInfo commandInfo = CommandInfoManager.INSTANCE.getCommandInfo("hbase");
  15. HBaseCommandV2 commandV2 = new HBaseCommandV2(commandInfo, hBaseRequestV2, setter, commandCache);
  16. hBaseRequestV2.accept(commandV2);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement