return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
responseAttributes.put(ATTRIBUTE_SOLR_STATUS, String.valueOf(response.getStatus())); responseAttributes.put(ATTRIBUTE_QUERY_TIME, String.valueOf(response.getQTime())); flowFileResponse = session.putAllAttributes(flowFileResponse, responseAttributes);
/** * Takes up one dead server and check for aliveness. The check is done in a roundrobin. Each server is checked for * aliveness once in 'x' millis where x is decided by the setAliveCheckinterval() or it is defaulted to 1 minute * * @param zombieServer a server in the dead pool */ private void checkAZombieServer(ServerWrapper zombieServer) { long currTime = System.currentTimeMillis(); checkLock.lock(); try { zombieServer.lastChecked = currTime; QueryResponse resp = zombieServer.solrServer.query(solrQuery); if (resp.getStatus() == 0) { //server has come back up zombieServer.lastUsed = currTime; zombieServers.remove(zombieServer); aliveServers.add(zombieServer); zombieServer.failedPings = 0; } } catch (Exception e) { zombieServer.failedPings++; //Expected . The server is still down } finally { checkLock.unlock(); } }
public QueryResponse query(ModifiableSolrParams params) throws SolrServerException { try { QueryResponse response = server.query(params); if(response.getStatus() != 0) { solrTracker.setSolrActive(false); } return response; } catch(SolrServerException e) { solrTracker.setSolrActive(false); throw e; } }
public QueryResponse query(ModifiableSolrParams params) throws SolrServerException { try { QueryResponse response = server.query(params); if(response.getStatus() != 0) { solrTracker.setSolrActive(false); } return response; } catch(SolrServerException e) { solrTracker.setSolrActive(false); throw e; } }
try { QueryResponse resp = zombieServer.client.query(solrQuery); if (resp.getStatus() == 0) {
zombieServer.lastChecked = currTime; QueryResponse resp = zombieServer.client.query(solrQuery); if (resp.getStatus() == 0) {
protected void pingSolr() { ModifiableSolrParams params = new ModifiableSolrParams(); params.set("qt", "/admin/cores"); params.set("action", "STATUS"); QueryResponse response = basicQuery(params); if(response != null && response.getStatus() == 0) { NamedList<Object> results = response.getResponse(); @SuppressWarnings("unchecked") NamedList<Object> report = (NamedList<Object>)results.get("status"); Iterator<Map.Entry<String, Object>> coreIterator = report.iterator(); List<String> cores = new ArrayList<String>(report.size()); while(coreIterator.hasNext()) { Map.Entry<String, Object> core = coreIterator.next(); cores.add(core.getKey()); } registerCores(cores); setSolrActive(true); } else { setSolrActive(false); } }
protected void pingSolr() { ModifiableSolrParams params = new ModifiableSolrParams(); params.set("qt", "/admin/cores"); params.set("action", "STATUS"); QueryResponse response = basicQuery(params); if(response != null && response.getStatus() == 0) { NamedList<Object> results = response.getResponse(); @SuppressWarnings("unchecked") NamedList<Object> report = (NamedList<Object>)results.get("status"); Iterator<Map.Entry<String, Object>> coreIterator = report.iterator(); List<String> cores = new ArrayList<String>(report.size()); while(coreIterator.hasNext()) { Map.Entry<String, Object> core = coreIterator.next(); cores.add(core.getKey()); } registerCores(cores); setSolrActive(true); } else { setSolrActive(false); } }
return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
return checkStatus(response.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace();
responseAttributes.put(ATTRIBUTE_SOLR_STATUS, String.valueOf(response.getStatus())); responseAttributes.put(ATTRIBUTE_QUERY_TIME, String.valueOf(response.getQTime())); flowFileResponse = session.putAllAttributes(flowFileResponse, responseAttributes);