Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer


                    {
                        synchronized (url.intern())
                        {
                            if((server = streamingClients.get(url)) == null)
                            {
                                server =  new StreamingUpdateSolrServer(url, 512, 1+(numClients/urls.length));
                                streamingClients.put(url, server);
                            }
                        }
                    }                
                   
View Full Code Here


  public SolrServer createNewSolrServer()
  {
    try {
      // setup the server...
      String url = "http://localhost:"+port+context;       // smaller queue size hits locks more often
      CommonsHttpSolrServer s = new StreamingUpdateSolrServer( url, 2, 5 ) {
        @Override
        public void handleError(Throwable ex) {
          // do something...    TODO?
        }
      };
      s.setConnectionTimeout(100); // 1/10th sec
      s.setDefaultMaxConnectionsPerHost(100);
      s.setMaxTotalConnections(100);
      return s;
    }
    catch( Exception ex ) {
      throw new RuntimeException( ex );
    }
View Full Code Here

  protected SolrServer createNewSolrServer()
  {
    try {
      // setup the server...
      String url = "http://localhost:"+port+context;       // smaller queue size hits locks more often
      CommonsHttpSolrServer s = new StreamingUpdateSolrServer( url, 2, 5 ) {
        @Override
        public void handleError(Throwable ex) {
          // do somethign...
        }
      };
      s.setConnectionTimeout(100); // 1/10th sec
      s.setDefaultMaxConnectionsPerHost(100);
      s.setMaxTotalConnections(100);
      return s;
    }
    catch( Exception ex ) {
      throw new RuntimeException( ex );
    }
View Full Code Here

    public void open(JobConf job, String name) throws IOException {
        String solrURL = job.get("solr.server.url");
        int queueSize = job.getInt("solr.client.queue.size", 100);
        int threadCount = job.getInt("solr.client.threads", 1);
        solr = new StreamingUpdateSolrServer(solrURL, queueSize, threadCount);
        /*
         * Generate mapping for Behemoth annotations/features to Solr fields
         * config values look like solr.f.<solr field> =
         * <annotationtype>.<feature> E.g., solr.f.foo = bar solr.f.foo =
         * spam.eggs generates the mapping {"bar":{"*","foo"},
 
View Full Code Here

        super(endpointUri, component);

        solrServer = new CommonsHttpSolrServer("http://" + address);
        streamingQueueSize = getIntFromString((String) parameters.get(SolrConstants.PARAM_STREAMING_QUEUE_SIZE), SolrConstants.DEFUALT_STREAMING_QUEUE_SIZE);
        streamingThreadCount = getIntFromString((String) parameters.get(SolrConstants.PARAM_STREAMING_THREAD_COUNT), SolrConstants.DEFAULT_STREAMING_THREAD_COUNT);
        streamingSolrServer = new StreamingUpdateSolrServer("http://" + address, streamingQueueSize, streamingThreadCount);
    }
View Full Code Here

                    {
                        synchronized (url.intern())
                        {
                            if((server = streamingClients.get(url)) == null)
                            {
                                server =  new StreamingUpdateSolrServer(url, numLoops, (numClients/urls.length));
                                System.err.println("Connection added by :"+threadId);
                                streamingClients.put(url, server);
                            }
                        }
                    }                
View Full Code Here

            if(hosts.size() == 0)
                throw new RuntimeException("no hosts defined");  
           
            int id = connectionCounter.incrementAndGet();
           
            indexWriter = new StreamingUpdateSolrServer("http://"+hosts.get(id % hosts.size())+":" + port + "/solandra/~wikassandra", 512, 8);
            indexWriter.setAllowCompression(true);
           
            clientPool.set(indexWriter);
        }
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer

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.