You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jb...@apache.org on 2015/03/27 13:19:15 UTC
svn commit: r1669554 -
/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/
Author: jbernste
Date: Fri Mar 27 12:19:15 2015
New Revision: 1669554
URL: http://svn.apache.org/r1669554
Log:
SOLR-7082: Editing Javadoc
Modified:
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/CloudSolrStream.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/MultiComp.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ParallelStream.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/PushBackStream.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ReducerStream.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrStream.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/StreamContext.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java
lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/TupleStream.java
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/CloudSolrStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/CloudSolrStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/CloudSolrStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/CloudSolrStream.java Fri Mar 27 12:19:15 2015
@@ -42,10 +42,11 @@ import org.apache.solr.common.cloud.Slic
import org.apache.solr.common.util.SolrjNamedThreadFactory;
/**
-* Connects to Zookeeper to pick replicas from a specific collection to send the query to.
-* Under the covers SolrStream instances are used to send the query to the replicas.
-* SolrStreams are opened using a Thread pool, but a single thread is used to iterate through each stream's tuples.
-**/
+ * Connects to Zookeeper to pick replicas from a specific collection to send the query to.
+ * Under the covers the SolrStream instances send the query to the replicas.
+ * SolrStreams are opened using a thread pool, but a single thread is used
+ * to iterate and merge Tuples from each SolrStream.
+ **/
public class CloudSolrStream extends TupleStream {
@@ -100,6 +101,10 @@ public class CloudSolrStream extends Tup
this.streamContext = context;
}
+ /**
+ * Opens the CloudSolrStream
+ *
+ ***/
public void open() throws IOException {
this.tuples = new TreeSet();
this.solrStreams = new ArrayList();
@@ -216,6 +221,9 @@ public class CloudSolrStream extends Tup
}
}
+ /**
+ * Closes the CloudSolrStream
+ **/
public void close() throws IOException {
for(TupleStream solrStream : solrStreams) {
solrStream.close();
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/MultiComp.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/MultiComp.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/MultiComp.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/MultiComp.java Fri Mar 27 12:19:15 2015
@@ -22,7 +22,7 @@ import java.util.Comparator;
/**
- * Wraps multiple Comparators to provide sub sorting.
+ * Wraps multiple Comparators to provide sub-sorting.
**/
public class MultiComp implements Comparator<Tuple>, Serializable {
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ParallelStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ParallelStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ParallelStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ParallelStream.java Fri Mar 27 12:19:15 2015
@@ -40,7 +40,7 @@ import org.apache.solr.common.cloud.ZkSt
import org.apache.solr.common.util.Base64;
/**
- * The ParallelStream decorates a TupleStream implementation and pushes it N workers for parallel execution.
+ * The ParallelStream decorates a TupleStream implementation and pushes it to N workers for parallel execution.
* Workers are chosen from a SolrCloud collection.
* Tuples that are streamed back from the workers are ordered by a Comparator.
**/
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/PushBackStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/PushBackStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/PushBackStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/PushBackStream.java Fri Mar 27 12:19:15 2015
@@ -22,6 +22,12 @@ import java.util.Comparator;
import java.util.List;
import java.util.ArrayList;
+/**
+ * A TupleStream that allows a single Tuple to be pushed back onto the stream after it's been read.
+ * This is a useful class when building streams that maintain the order of Tuples between multiple
+ * substreams.
+ **/
+
public class PushBackStream extends TupleStream {
private static final long serialVersionUID = 1;
@@ -29,12 +35,6 @@ public class PushBackStream extends Tupl
private TupleStream stream;
private Tuple tuple;
- /**
- * A TupleStream that allows a single Tuple to be pushed back into Stream after it's been read.
- * This is a useful class when building streams that maintain the order of the tuples from two or
- * more substreams.
- **/
-
public PushBackStream(TupleStream stream) {
this.stream = stream;
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ReducerStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ReducerStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ReducerStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/ReducerStream.java Fri Mar 27 12:19:15 2015
@@ -25,16 +25,16 @@ import java.util.Map;
import java.util.HashMap;
/**
- * Iterates over a TupleStream and buffers Tuples that are equal based on a field comparator.
- * This allows tuples to be grouped by a common field.
+ * Iterates over a TupleStream and buffers Tuples that are equal based on a comparator.
+ * This allows tuples to be grouped by common field(s).
*
- * The read() method emits one tuple per group. The top levels fields reflect the first tuple
+ * The read() method emits one tuple per group. The fields of the emitted Tuple reflect the first tuple
* encountered in the group.
*
- * Use the Tuple.getMaps() method to return the all the Tuples in the group. The method returns
+ * Use the Tuple.getMaps() method to return all the Tuples in the group. This method returns
* a list of maps (including the group head), which hold the data for each Tuple in the group.
*
- * Note: This ReducerStream requires that the underlying streams be sorted and partitioned by same
+ * Note: The ReducerStream requires that it's underlying stream be sorted and partitioned by the same
* fields as it's comparator.
*
**/
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java Fri Mar 27 12:19:15 2015
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
/**
- * The SolrClientCache caches SolrClients that they can be reused by different TupleStreams.
+ * The SolrClientCache caches SolrClients so they can be reused by different TupleStreams.
**/
public class SolrClientCache implements Serializable {
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrStream.java Fri Mar 27 12:19:15 2015
@@ -29,7 +29,7 @@ import org.apache.solr.common.params.Mod
import org.apache.solr.common.params.SolrParams;
/**
-* Queries a Solr instance, and maps SolrDocs to a Stream of Tuples.
+* Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.
**/
public class SolrStream extends TupleStream {
@@ -88,6 +88,10 @@ public class SolrStream extends TupleStr
}
}
+ /**
+ * Setting trace to true will include the "_CORE_" field in each Tuple emitted by the stream.
+ **/
+
public void setTrace(boolean trace) {
this.trace = trace;
}
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/StreamContext.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/StreamContext.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/StreamContext.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/StreamContext.java Fri Mar 27 12:19:15 2015
@@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHa
/**
* The StreamContext is passed to TupleStreams using the TupleStream.setStreamContext() method.
- * The StreamContext is used pass shared context info from to concentrically wrapped TupleStreams.
+ * The StreamContext is used to pass shared context to concentrically wrapped TupleStreams.
*
* Note: The StreamContext contains the SolrClientCache which is used to cache SolrClients for reuse
* across multiple TupleStreams.
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java Fri Mar 27 12:19:15 2015
@@ -32,7 +32,13 @@ import java.util.Iterator;
public class Tuple implements Cloneable {
- public boolean EOF;
+ /**
+ * When EOF field is true the Tuple marks the end of the stream.
+ * The EOF Tuple will not contain a record from the stream, but it may contain
+ * metrics/aggregates gathered by underlying streams.
+ * */
+
+ public boolean EOF;
public Map fields = new HashMap();
public Tuple(Map fields) {
Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/TupleStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/TupleStream.java?rev=1669554&r1=1669553&r2=1669554&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/TupleStream.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/io/TupleStream.java Fri Mar 27 12:19:15 2015
@@ -20,12 +20,6 @@ package org.apache.solr.client.solrj.io;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
-
public abstract class TupleStream implements Serializable {