Пример #1
0
 private RocksService getNodeClient() throws Exception {
   if (nodeClient.get() == null) {
     try {
       nodeClient.set(
           clientManager
               .createClient(
                   new FramedClientConnector(fromParts(hostNodes, portNodes)), RocksService.class)
               .get());
       logger.info("Opened node Rocksdb connection to " + hostNodes + ":" + portNodes);
     } catch (Exception e) {
       logger.error("Error in open node! Host " + hostNodes + " port ++" + portNodes + " " + e);
       throw e;
     }
   }
   return nodeClient.get();
 }
Пример #2
0
 public void clearErrors(int threadID) {
   logger.warn("Closing Rocksdb connection in threadID " + threadID);
   try {
     if (assocClient.get() != null) {
       assocClient.get().close();
       assocClient.remove();
     }
     if (nodeClient.get() != null) {
       nodeClient.get().close();
       nodeClient.remove();
     }
   } catch (Throwable e) {
     logger.error("Error in Reopen!" + e);
     e.printStackTrace();
   }
 }