Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2AA19200CA9 for ; Fri, 16 Jun 2017 15:55:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 29558160BDD; Fri, 16 Jun 2017 13:55:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4A3A9160BD2 for ; Fri, 16 Jun 2017 15:55:39 +0200 (CEST) Received: (qmail 52565 invoked by uid 500); 16 Jun 2017 13:55:37 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 52501 invoked by uid 99); 16 Jun 2017 13:55:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2017 13:55:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6BA0E1B089A for ; Fri, 16 Jun 2017 13:55:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.85 X-Spam-Level: X-Spam-Status: No, score=0.85 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, KAM_LIVE=1, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id eSV9-aHqXT5i for ; Fri, 16 Jun 2017 13:55:33 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 0A0D35FBBD for ; Fri, 16 Jun 2017 13:55:33 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id y77so30889666ioe.3 for ; Fri, 16 Jun 2017 06:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=PTeBHTq0WscEoDBm9+4NqjOAYtJaaSR1IWDRStXJO14=; b=btLbnnvIGWnYvfD8PHCdLP45edSpQCObvhxS637tPNFO8o0wkQPcWkOu8y6JmSEgP2 vp3OyggFfEl4E4etH6arLxgrYuRgtBZz4qF1GyNvXk+KpiGUUQcURUjpD71U6NPluwJC 2/dJemaOG06MyIn7GIrU84jf4hIYqNGyHNmfoN5JI1JoyFDTtuEt4C7OKUtTklTFt1WT rtJ+qDhor/VFS+uzcpmpXFZZX1KLKaVLpF1b4odPvwoyP7A5ngst/Wk/xY6Jn5jQisZT XqEohS9KgRGieWBJfajUqkFISnQMRmFxdFp0bPE4g9jOyq+z55BchUrQr41h3p/iyWJX LtiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=PTeBHTq0WscEoDBm9+4NqjOAYtJaaSR1IWDRStXJO14=; b=r7ZLKYmGwe39hyUdqjV8Yqw+1KR15pcwwqXVpppMjoXmCSdO8IWMUOq/xOcosi0jh3 dJ11mfDU++4KT+dm//cffYWzGF1cqT33LGM7WhaKH/eEC98slrCnc7ZU5ddTtBSGmdnL eBomqWXwHPGYjn9jaAD/GGP1bDTWhLyT8rbKyaIyTbqvmDbGMHKY3W2eVaqbSiQqUnLE YzGGztHseD59r8s/Qrh2RqPBNIPgC99zPaJ/z3TyyMR4iQeJUcl8IaJYaqDTaI/8rPsF 8M8CrUAQzYXhrUHlfGRpp42niogtY6EM975HseUfa+0Kne2RmU+bLaXLRpO9Z4Gj1Dch C1nA== X-Gm-Message-State: AKS2vOy7O8ZPbOsljB5QXOlrt8x6erGEgvUcYbfWlhuMCojNgeJGZyad CMlXnmlIcWVaBvnoMczlyKB964K47u5m X-Received: by 10.107.142.135 with SMTP id q129mr9926291iod.186.1497621331444; Fri, 16 Jun 2017 06:55:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.154.146 with HTTP; Fri, 16 Jun 2017 06:55:30 -0700 (PDT) Received: by 10.107.154.146 with HTTP; Fri, 16 Jun 2017 06:55:30 -0700 (PDT) In-Reply-To: References: From: Aman Deep Singh Date: Fri, 16 Jun 2017 06:55:30 -0700 Message-ID: Subject: Re: Possible bug in Solrj-6.6.0 To: solr-user Content-Type: multipart/alternative; boundary="94eb2c05c04678304d0552142341" archived-at: Fri, 16 Jun 2017 13:55:40 -0000 --94eb2c05c04678304d0552142341 Content-Type: text/plain; charset="UTF-8" Thanks Joel, It is working now One quick question,as you say that we can use solr client cache multiple time so can I create a single instance of solr client cache and use it again and again ,since we are using one single bean for client object. On 16-Jun-2017 6:28 PM, "Joel Bernstein" wrote: The issue is that in 6.6 CloudSolrStream is expecting a StreamContext to be set. So you'll need to update your code to do this. This was part of changes made to make streaming work in non-SolrCloud environments. You also need to create a SolrClientCache which caches the SolrClients. Example: SolrClientCache cache = new SolrClientCache(); StreamContext streamContext = new StreamContext(); streamContext.setSolrClientCache(cache); CloudSolrStream stream = new CloudSolrStream(...); stream.setStreamContext(streamContext); stream.open(); .... The SolrClientCache can be shared by multiple requests and should be closed when the application exits. Joel Bernstein http://joelsolr.blogspot.com/ On Fri, Jun 16, 2017 at 2:17 AM, Aman Deep Singh wrote: > Hi, > I think their is a possible bug in Solrj version 6.6.0 ,as streaming is not > working > as i have a piece of code > > public Set getAllIds(String requestId, String field) { > LOG.info("Now Trying to fetch all the ids from SOLR for request Id > {}", requestId); > Map props = new HashMap(); > props.put("q", field + ":*"); > props.put("qt", "/export"); > props.put("sort", field + " asc"); > props.put("fl", field); > Set idSet = new HashSet<>(); > try (CloudSolrStream cloudSolrStream = new > CloudSolrStream(cloudSolrClient.getZkHost(), > cloudSolrClient.getDefaultCollection(), new > MapSolrParams(props))) { > cloudSolrStream.open(); > while (true) { > Tuple tuple = cloudSolrStream.read(); > if (tuple.EOF) { > break; > } > idSet.add(tuple.getString(field)); > } > return idSet; > } catch (IOException ex) { > LOG.error("Error while fetching the ids from SOLR for request > Id {} ", requestId, ex); > } > return Collections.emptySet(); > } > > > This is working in the Solrj 6.5.1 but now it start throwing Error > after upgrading to solrj-6.6.0 > > java.io.IOException: java.lang.NullPointerException > at org.apache.solr.client.solrj.io.stream.CloudSolrStream. > constructStreams(CloudSolrStream.java:408) > ~[solr-solrj-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 > - ishan - 2017-05-30 07:32:54] > at org.apache.solr.client.solrj.io.stream.CloudSolrStream. > open(CloudSolrStream.java:299) > ~[solr-solrj-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 > - ishan - 2017-05-30 07:32:54] > > > Thanks, > > Aman Deep Singh > --94eb2c05c04678304d0552142341--