Package org.apache.solr.client.solrj.response

Examples of org.apache.solr.client.solrj.response.SolrPingResponse


    @Override
    public SolrPingResponse process( SolrServer server ) throws SolrServerException, IOException
    {
      long startTime = System.currentTimeMillis();
      SolrPingResponse res = new SolrPingResponse();
      res.setResponse( server.request( this ) );
      res.setElapsedTime( System.currentTimeMillis()-startTime );
      return res;
    }
View Full Code Here


        if (server==null) {
            log("Connection not initiated");
            return false;
        }
        try {
            @SuppressWarnings("unused")
            SolrPingResponse ping = server.ping();
        } catch (SolrServerException sse) {
            lastExceptionCauseName = sse.getMessage();
            log("Ping failed on solr (" + url + ") " + sse.getMessage());
            if (outputStackTrace) {
View Full Code Here

  public void shutdown() {
  }

  @Override
  public SolrPingResponse ping() {
    return new SolrPingResponse();
  }
View Full Code Here

    public void shutdown() {
    }

    @Override
    public SolrPingResponse ping() throws SolrServerException, IOException {
      return new SolrPingResponse();
    }
View Full Code Here

    }

    private SolrServer initializeWithExistingHttpServer() throws IOException, SolrServerException {
        // try basic Solr HTTP client
        HttpSolrServer httpSolrServer = new HttpSolrServer(remoteSolrServerConfiguration.getSolrHttpUrls()[0]);
        SolrPingResponse ping = httpSolrServer.ping();
        if (ping != null && 0 == ping.getStatus()) {
            return httpSolrServer;
        } else {
            throw new IOException("the found HTTP Solr server is not alive");
        }
View Full Code Here

            // SolrCloud may need some time to sync on collection creation (to spread it over the shards / replicas)
            int i = 0;
            while (i < 3) {
                try {
                    SolrPingResponse ping = cloudSolrServer.ping();
                    if (ping != null && 0 == ping.getStatus()) {
                        return cloudSolrServer;
                    } else {
                        throw new IOException("the found SolrCloud server is not alive");
                    }
                } catch (Exception e) {
View Full Code Here

  }

  @Test
  public void solrIsUp() throws Exception {
    SolrServer solrServer = mock(SolrServer.class);
    SolrPingResponse pingResponse = new SolrPingResponse();
    NamedList<Object> response = new NamedList<Object>();
    response.add("status", "OK");
    pingResponse.setResponse(response);
    given(solrServer.ping()).willReturn(pingResponse);

    SolrHealthIndicator healthIndicator = new SolrHealthIndicator(solrServer);
    Health health = healthIndicator.health();
    assertEquals(Status.UP, health.getStatus());
View Full Code Here

        EmbeddedSolrServerConfiguration solrServerConfiguration = new EmbeddedSolrServerConfiguration(getClass().getResource("/solr").getFile(),
                getClass().getResource("/solr/solr.xml").getFile(), "oak");
        EmbeddedSolrServerProvider embeddedSolrServerProvider = new EmbeddedSolrServerProvider(solrServerConfiguration);
        SolrServer solrServer = embeddedSolrServerProvider.getSolrServer();
        assertNotNull(solrServer);
        SolrPingResponse ping = solrServer.ping();
        assertNotNull(ping);
        assertEquals(0, ping.getStatus());
    }
View Full Code Here

    }

    private SolrServer initializeWithExistingHttpServer() throws IOException, SolrServerException {
        // try basic Solr HTTP client
        HttpSolrServer httpSolrServer = new HttpSolrServer(remoteSolrServerConfiguration.getSolrHttpUrls()[0]);
        SolrPingResponse ping = httpSolrServer.ping();
        if (ping != null && 0 == ping.getStatus()) {
            return httpSolrServer;
        } else {
            throw new IOException("the found HTTP Solr server is not alive");
        }
View Full Code Here

        // SolrCloud may need some time to sync on collection creation (to spread it over the shards / replicas)
        int i = 0;
        while (i < 3) {
            try {
                SolrPingResponse ping = cloudSolrServer.ping();
                if (ping != null && 0 == ping.getStatus()) {
                    return cloudSolrServer;
                } else {
                    throw new IOException("the found SolrCloud server is not alive");
                }
            } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.response.SolrPingResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.