/** * Closes the Stream to a single Solr Instance * */ public void close() throws IOException { if (closeableHttpResponse != null) { closeableHttpResponse.close(); } if(cache == null) { client.close(); } }
@Override @Deprecated public void shutdown() { try { close(); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Closes the Stream to a single Solr Instance * */ public void close() throws IOException { jsonTupleStream.close(); if(cache == null) { client.close(); } }
@Override public void dispose() { try { solrServer.close(); } catch (IOException ex) { LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } finally { super.dispose(); } } }
@Override public void close() throws ResourceException { if (this.server != null) { try { this.server.close(); } catch (IOException e) { throw new ResourceException(e); } } }
@Override public void close() throws ResourceException { if (this.server != null) { try { this.server.close(); } catch (IOException e) { throw new ResourceException(e); } } }
@Override public Request call() { Request req = new Request(); LOG.info("Live merge " + dir.getPath() + " into " + mergeUrl); final HttpSolrClient server = new HttpSolrClient.Builder(mergeUrl).build(); try { CoreAdminRequest.MergeIndexes mergeRequest = new CoreAdminRequest.MergeIndexes(); mergeRequest.setCoreName(name); mergeRequest.setIndexDirs(Arrays.asList(dir.getPath().toString() + "/data/index")); try { mergeRequest.process(server); req.success = true; } catch (SolrServerException e) { req.e = e; return req; } catch (IOException e) { req.e = e; return req; } } finally { try { server.close(); } catch (java.io.IOException e) { throw new RuntimeException(e); } } return req; } };
server.close();
private SolrClient initializeWithExistingHttpServer() throws IOException, SolrServerException { // try basic Solr HTTP client HttpSolrClient httpSolrServer = new HttpSolrClient(remoteSolrServerConfiguration.getSolrHttpUrls()[0]); httpSolrServer.setConnectionTimeout(remoteSolrServerConfiguration.getConnectionTimeout()); httpSolrServer.setSoTimeout(remoteSolrServerConfiguration.getSocketTimeout()); SolrPingResponse ping = httpSolrServer.ping(); if (ping != null && 0 == ping.getStatus()) { return httpSolrServer; } else { httpSolrServer.close(); throw new IOException("the found HTTP Solr server is not alive"); } }
private SolrClient initializeWithExistingHttpServer() throws IOException, SolrServerException { // try basic Solr HTTP client HttpSolrClient httpSolrServer = new HttpSolrClient(remoteSolrServerConfiguration.getSolrHttpUrls()[0]); httpSolrServer.setConnectionTimeout(remoteSolrServerConfiguration.getConnectionTimeout()); httpSolrServer.setSoTimeout(remoteSolrServerConfiguration.getSocketTimeout()); SolrPingResponse ping = httpSolrServer.ping(); if (ping != null && 0 == ping.getStatus()) { return httpSolrServer; } else { httpSolrServer.close(); throw new IOException("the found HTTP Solr server is not alive"); } }