/** * @deprecated since 7.0 Use {@link Builder} methods instead. */ @Deprecated public void setConnectionTimeout(int timeout) { this.connectionTimeout = timeout; synchronized (aliveServers) { Iterator<ServerWrapper> wrappersIt = aliveServers.values().iterator(); while (wrappersIt.hasNext()) { wrappersIt.next().client.setConnectionTimeout(timeout); } } Iterator<ServerWrapper> wrappersIt = zombieServers.values().iterator(); while (wrappersIt.hasNext()) { wrappersIt.next().client.setConnectionTimeout(timeout); } }
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"); } }
/** * Creates the datastore. * * @param url The URL of SOLR server * @param layerMapper The document loader. */ public SolrDataStore(URL url, SolrLayerMapper layerMapper) { // TODO: make connection timeouts configurable this.url = url; this.layerMapper = layerMapper; this.solrServer = new HttpSolrClient.Builder() .withBaseSolrUrl(url.toString()) .allowCompression(true) .build(); this.solrServer.setConnectionTimeout(10000); this.solrServer.setFollowRedirects(true); this.solrServer.setSoTimeout(10000); }
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"); } }
solrServer.setConnectionTimeout(connectionTimeout);
this.server.setConnectionTimeout(config.getConnTimeout());
this.server.setConnectionTimeout(config.getConnTimeout());