You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/01/08 04:40:37 UTC
svn commit: r1430130 [20/27] - in /lucene/dev/branches/lucene4547: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/maven/ dev-tools/maven/solr/
dev-tools/maven/solr/contrib/analysis-extras/
dev-tools/maven/solr/contrib/cluste...
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/highlight/SolrFragmenter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/highlight/SolrFragmenter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/highlight/SolrFragmenter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/highlight/SolrFragmenter.java Tue Jan 8 03:40:16 2013
@@ -30,6 +30,7 @@ public interface SolrFragmenter extends
* may be specified when declaring a request handler in
* solrconfig.xml
*/
+ @Override
public void init(NamedList args);
/**
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CSVStrategy.java Tue Jan 8 03:40:16 2013
@@ -140,6 +140,7 @@ public class CSVStrategy implements Clon
return this.printerNewline;
}
+ @Override
public Object clone() {
try {
return super.clone();
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/CharBuffer.java Tue Jan 8 03:40:16 2013
@@ -201,6 +201,7 @@ public class CharBuffer {
* Converts the contents of the buffer into a StringBuffer.
* This method involves copying the new data once!
*/
+ @Override
public String toString() {
return new String(c, 0, length);
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/ExtendedBufferedReader.java Tue Jan 8 03:40:16 2013
@@ -75,6 +75,7 @@ class ExtendedBufferedReader extends Buf
* Reads the next char from the input stream.
* @return the next char or END_OF_STREAM if end of stream has been reached.
*/
+ @Override
public int read() throws IOException {
// initalize the lookahead
if (lookaheadChar == UNDEFINED) {
@@ -113,6 +114,7 @@ class ExtendedBufferedReader extends Buf
*
* @return nof chars actually read or END_OF_STREAM
*/
+ @Override
public int read(char[] buf, int off, int len) throws IOException {
// do not claim if len == 0
if (len == 0) {
@@ -178,6 +180,7 @@ class ExtendedBufferedReader extends Buf
* including any line-termination characters, or null
* if the end of the stream has been reached
*/
+ @Override
public String readLine() throws IOException {
if (lookaheadChar == UNDEFINED) {
@@ -223,6 +226,7 @@ class ExtendedBufferedReader extends Buf
*
* @return nof skiped chars
*/
+ @Override
public long skip(long n) throws IllegalArgumentException, IOException {
if (lookaheadChar == UNDEFINED) {
@@ -300,6 +304,7 @@ class ExtendedBufferedReader extends Buf
return -1;
}
}
+ @Override
public boolean markSupported() {
/* note uh: marking is not supported, cause we cannot
* see into the future...
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/internal/csv/writer/CSVConfig.java Tue Jan 8 03:40:16 2013
@@ -246,6 +246,7 @@ public class CSVConfig {
* TODO..
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj == null && !(obj instanceof CSVConfig)) {
return false;
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/FastCharStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/FastCharStream.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/FastCharStream.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/FastCharStream.java Tue Jan 8 03:40:16 2013
@@ -42,6 +42,7 @@ public final class FastCharStream implem
input = r;
}
+ @Override
public final char readChar() throws IOException {
if (bufferPosition >= bufferLength)
refill();
@@ -76,25 +77,30 @@ public final class FastCharStream implem
bufferLength += charsRead;
}
+ @Override
public final char BeginToken() throws IOException {
tokenStart = bufferPosition;
return readChar();
}
+ @Override
public final void backup(int amount) {
bufferPosition -= amount;
}
+ @Override
public final String GetImage() {
return new String(buffer, tokenStart, bufferPosition - tokenStart);
}
+ @Override
public final char[] GetSuffix(int len) {
char[] value = new char[len];
System.arraycopy(buffer, bufferPosition - len, value, 0, len);
return value;
}
+ @Override
public final void Done() {
try {
input.close();
@@ -102,21 +108,27 @@ public final class FastCharStream implem
}
}
+ @Override
public final int getColumn() {
return bufferStart + bufferPosition;
}
+ @Override
public final int getLine() {
return 1;
}
+ @Override
public final int getEndColumn() {
return bufferStart + bufferPosition;
}
+ @Override
public final int getEndLine() {
return 1;
}
+ @Override
public final int getBeginColumn() {
return bufferStart + tokenStart;
}
+ @Override
public final int getBeginLine() {
return 1;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/QueryParser.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/QueryParser.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/QueryParser.java Tue Jan 8 03:40:16 2013
@@ -91,6 +91,7 @@ public class QueryParser extends SolrQue
}
// This makes sure that there is no garbage after the query string
+ @Override
final public Query TopLevelQuery(String field) throws ParseException, SyntaxError {
Query q;
q = Query(field);
@@ -478,6 +479,7 @@ public class QueryParser extends SolrQue
}
/** Reinitialise. */
+ @Override
public void ReInit(CharStream stream) {
token_source.ReInit(stream);
token = new Token();
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java Tue Jan 8 03:40:16 2013
@@ -119,6 +119,7 @@ public abstract class SolrQueryParserBas
this.field = field;
this.subParser = subParser;
}
+ @Override
public String toString() {
return field;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/Token.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/Token.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/Token.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/Token.java Tue Jan 8 03:40:16 2013
@@ -97,6 +97,7 @@ public class Token implements java.io.Se
/**
* Returns the image.
*/
+ @Override
public String toString()
{
return image;
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java Tue Jan 8 03:40:16 2013
@@ -121,6 +121,7 @@ public class TokenMgrError extends Error
*
* from this method for such cases in the release version of your parser.
*/
+ @Override
public String getMessage() {
return super.getMessage();
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java Tue Jan 8 03:40:16 2013
@@ -95,6 +95,7 @@ class PerSegmentSingleValuedFaceting {
final SegFacet segFacet = new SegFacet(leave);
Callable<SegFacet> task = new Callable<SegFacet>() {
+ @Override
public SegFacet call() throws Exception {
segFacet.countTerms();
return segFacet;
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SimpleFacets.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SimpleFacets.java Tue Jan 8 03:40:16 2013
@@ -386,6 +386,7 @@ public class SimpleFacets {
static final Executor directExecutor = new Executor() {
+ @Override
public void execute(Runnable r) {
r.run();
}
@@ -708,7 +709,7 @@ public class SimpleFacets {
// TODO: specialize when base docset is a bitset or hash set (skipDocs)? or does it matter for this?
// TODO: do this per-segment for better efficiency (MultiDocsEnum just uses base class impl)
// TODO: would passing deleted docs lead to better efficiency over checking the fastForRandomSet?
- docsEnum = termsEnum.docs(null, docsEnum, 0);
+ docsEnum = termsEnum.docs(null, docsEnum, DocsEnum.FLAG_NONE);
c=0;
if (docsEnum instanceof MultiDocsEnum) {
@@ -1201,6 +1202,7 @@ public class SimpleFacets {
CountPair<?,?> that = (CountPair<?,?>) o;
return (this.key.equals(that.key) && this.val.equals(that.val));
}
+ @Override
public int compareTo(CountPair<K,V> o) {
int vc = o.val.compareTo(val);
return (0 != vc ? vc : key.compareTo(o.key));
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java Tue Jan 8 03:40:16 2013
@@ -52,32 +52,38 @@ public abstract class SolrQueryRequestBa
this.params = this.origParams = params;
}
+ @Override
public Map<Object,Object> getContext() {
// SolrQueryRequest as a whole isn't thread safe, and this isn't either.
if (context==null) context = new HashMap<Object,Object>();
return context;
}
+ @Override
public SolrParams getParams() {
return params;
}
+ @Override
public SolrParams getOriginalParams() {
return origParams;
}
+ @Override
public void setParams(SolrParams params) {
this.params = params;
}
protected final long startTime=System.currentTimeMillis();
// Get the start time of this request in milliseconds
+ @Override
public long getStartTime() {
return startTime;
}
// The index searcher associated with this request
protected RefCounted<SolrIndexSearcher> searcherHolder;
+ @Override
public SolrIndexSearcher getSearcher() {
if(core == null) return null;//a request for a core admin will no have a core
// should this reach out and get a searcher from the core singleton, or
@@ -92,11 +98,13 @@ public abstract class SolrQueryRequestBa
}
// The solr core (coordinator, etc) associated with this request
+ @Override
public SolrCore getCore() {
return core;
}
// The index schema associated with this request
+ @Override
public IndexSchema getSchema() {
//a request for a core admin will no have a core
return core == null? null: core.getSchema();
@@ -106,6 +114,7 @@ public abstract class SolrQueryRequestBa
* Frees resources associated with this request, this method <b>must</b>
* be called when the object is no longer in use.
*/
+ @Override
public void close() {
if (searcherHolder!=null) {
searcherHolder.decref();
@@ -115,6 +124,7 @@ public abstract class SolrQueryRequestBa
/** A Collection of ContentStreams passed to the request
*/
+ @Override
public Iterable<ContentStream> getContentStreams() {
return streams;
}
@@ -123,6 +133,7 @@ public abstract class SolrQueryRequestBa
streams = s;
}
+ @Override
public String getParamString() {
return origParams.toString();
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -43,6 +43,7 @@ public class BinaryResponseWriter implem
private static final Logger LOG = LoggerFactory.getLogger(BinaryResponseWriter.class);
public static final Set<Class> KNOWN_TYPES = new HashSet<Class>();
+ @Override
public void write(OutputStream out, SolrQueryRequest req, SolrQueryResponse response) throws IOException {
Resolver resolver = new Resolver(req, response.getReturnFields());
Boolean omitHeader = req.getParams().getBool(CommonParams.OMIT_HEADER);
@@ -51,14 +52,17 @@ public class BinaryResponseWriter implem
codec.marshal(response.getValues(), out);
}
+ @Override
public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException {
throw new RuntimeException("This is a binary writer , Cannot write to a characterstream");
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return "application/octet-stream";
}
+ @Override
public void init(NamedList args) {
/* NOOP */
}
@@ -78,6 +82,7 @@ public class BinaryResponseWriter implem
this.returnFields = returnFields;
}
+ @Override
public Object resolve(Object o, JavaBinCodec codec) throws IOException {
if (o instanceof ResultContext) {
writeResults((ResultContext) o, codec);
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -45,9 +45,11 @@ import java.util.*;
public class CSVResponseWriter implements QueryResponseWriter {
+ @Override
public void init(NamedList n) {
}
+ @Override
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
CSVWriter w = new CSVWriter(writer, req, rsp);
try {
@@ -57,6 +59,7 @@ public class CSVResponseWriter implement
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
// using the text/plain allows this to be viewed in the browser easily
return CONTENT_TYPE_TEXT_UTF8;
@@ -352,12 +355,14 @@ class CSVWriter extends TextResponseWrit
public void writeNamedList(String name, NamedList val) throws IOException {
}
+ @Override
public void writeStartDocumentList(String name,
long start, int size, long numFound, Float maxScore) throws IOException
{
// nothing
}
+ @Override
public void writeEndDocumentList() throws IOException
{
// nothing
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -45,6 +45,7 @@ public class JSONResponseWriter implemen
private String contentType = CONTENT_TYPE_JSON_UTF8;
+ @Override
public void init(NamedList namedList) {
String contentType = (String) namedList.get("content-type");
if (contentType != null) {
@@ -52,6 +53,7 @@ public class JSONResponseWriter implemen
}
}
+ @Override
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
JSONWriter w = new JSONWriter(writer, req, rsp);
try {
@@ -61,6 +63,7 @@ public class JSONResponseWriter implemen
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return contentType;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -26,11 +26,18 @@ import org.apache.solr.request.SolrQuery
public class PHPResponseWriter implements QueryResponseWriter {
static String CONTENT_TYPE_PHP_UTF8="text/x-php;charset=UTF-8";
- public void init(NamedList n) {
- /* NOOP */
+ private String contentType = CONTENT_TYPE_PHP_UTF8;
+
+ @Override
+ public void init(NamedList namedList) {
+ String contentType = (String) namedList.get("content-type");
+ if (contentType != null) {
+ this.contentType = contentType;
+ }
}
-
- public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
+
+ @Override
+ public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
PHPWriter w = new PHPWriter(writer, req, rsp);
try {
w.writeResponse();
@@ -39,8 +46,9 @@ public class PHPResponseWriter implement
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
- return CONTENT_TYPE_TEXT_UTF8;
+ return contentType;
}
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -41,10 +41,18 @@ import org.apache.solr.search.ReturnFiel
public class PHPSerializedResponseWriter implements QueryResponseWriter {
static String CONTENT_TYPE_PHP_UTF8="text/x-php-serialized;charset=UTF-8";
- public void init(NamedList n) {
+ private String contentType = CONTENT_TYPE_PHP_UTF8;
+
+ @Override
+ public void init(NamedList namedList) {
+ String contentType = (String) namedList.get("content-type");
+ if (contentType != null) {
+ this.contentType = contentType;
+ }
}
- public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
+ @Override
+ public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
PHPSerializedWriter w = new PHPSerializedWriter(writer, req, rsp);
try {
w.writeResponse();
@@ -53,8 +61,9 @@ public class PHPSerializedResponseWriter
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
- return CONTENT_TYPE_TEXT_UTF8;
+ return contentType;
}
}
@@ -82,6 +91,7 @@ class PHPSerializedWriter extends JSONWr
+ @Override
public void writeStartDocumentList(String name,
long start, int size, long numFound, Float maxScore) throws IOException
{
@@ -99,6 +109,7 @@ class PHPSerializedWriter extends JSONWr
writeArrayOpener(size);
}
+ @Override
public void writeEndDocumentList() throws IOException
{
writeArrayCloser(); // doc list
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PythonResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PythonResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PythonResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/PythonResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -26,10 +26,12 @@ import org.apache.solr.request.SolrQuery
public class PythonResponseWriter implements QueryResponseWriter {
static String CONTENT_TYPE_PYTHON_ASCII="text/x-python;charset=US-ASCII";
+ @Override
public void init(NamedList n) {
/* NOOP */
}
+ @Override
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
PythonWriter w = new PythonWriter(writer, req, rsp);
try {
@@ -39,13 +41,16 @@ public class PythonResponseWriter implem
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return CONTENT_TYPE_TEXT_ASCII;
}
}
class PythonWriter extends NaNFloatWriter {
+ @Override
protected String getNaN() { return "float('NaN')"; }
+ @Override
protected String getInf() { return "float('Inf')"; }
public PythonWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/QueryResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/QueryResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/QueryResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/QueryResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -80,6 +80,7 @@ public interface QueryResponseWriter ext
* may be specified when declaring a response writer in
* solrconfig.xml
*/
+ @Override
public void init(NamedList args);
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RawResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RawResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RawResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RawResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -54,6 +54,7 @@ public class RawResponseWriter implement
public static final String CONTENT = "content";
private String _baseWriter = null;
+ @Override
public void init(NamedList n) {
if( n != null ) {
Object base = n.get( "base" );
@@ -69,6 +70,7 @@ public class RawResponseWriter implement
return request.getCore().getQueryResponseWriter( _baseWriter );
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
Object obj = response.getValues().get( CONTENT );
if( obj != null && (obj instanceof ContentStream ) ) {
@@ -77,6 +79,7 @@ public class RawResponseWriter implement
return getBaseWriter( request ).getContentType( request, response );
}
+ @Override
public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException
{
Object obj = response.getValues().get( CONTENT );
@@ -95,6 +98,7 @@ public class RawResponseWriter implement
}
}
+@Override
public void write(OutputStream out, SolrQueryRequest request,
SolrQueryResponse response) throws IOException {
Object obj = response.getValues().get( CONTENT );
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RubyResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RubyResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RubyResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/RubyResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -25,11 +25,13 @@ import org.apache.solr.request.SolrQuery
public class RubyResponseWriter implements QueryResponseWriter {
static String CONTENT_TYPE_RUBY_UTF8="text/x-ruby;charset=UTF-8";
+ @Override
public void init(NamedList n) {
/* NOOP */
}
- public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
+ @Override
+public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
RubyWriter w = new RubyWriter(writer, req, rsp);
try {
w.writeResponse();
@@ -38,6 +40,7 @@ public class RubyResponseWriter implemen
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return CONTENT_TYPE_TEXT_UTF8;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java Tue Jan 8 03:40:16 2013
@@ -20,6 +20,7 @@ package org.apache.solr.response;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.search.ReturnFields;
+import org.apache.solr.search.SolrReturnFields;
import java.util.*;
@@ -123,7 +124,7 @@ public class SolrQueryResponse {
*/
public ReturnFields getReturnFields() {
if( returnFields == null ) {
- returnFields = new ReturnFields(); // by default return everything
+ returnFields = new SolrReturnFields(); // by default return everything
}
return returnFields;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XMLResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XMLResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XMLResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XMLResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -27,10 +27,12 @@ import org.apache.solr.request.SolrQuery
*
*/
public class XMLResponseWriter implements QueryResponseWriter {
+ @Override
public void init(NamedList n) {
/* NOOP */
}
+ @Override
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
XMLWriter w = new XMLWriter(writer, req, rsp);
try {
@@ -40,6 +42,7 @@ public class XMLResponseWriter implement
}
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return CONTENT_TYPE_XML_UTF8;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XSLTResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XSLTResponseWriter.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XSLTResponseWriter.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/XSLTResponseWriter.java Tue Jan 8 03:40:16 2013
@@ -56,6 +56,7 @@ public class XSLTResponseWriter implemen
private static final Logger log = LoggerFactory.getLogger(XSLTResponseWriter.class);
private static final XMLErrorLogger xmllog = new XMLErrorLogger(log);
+ @Override
public void init(NamedList n) {
final SolrParams p = SolrParams.toSolrParams(n);
xsltCacheLifetimeSeconds = p.getInt(XSLT_CACHE_PARAM,XSLT_CACHE_DEFAULT);
@@ -63,6 +64,7 @@ public class XSLTResponseWriter implemen
}
+ @Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
Transformer t = null;
try {
@@ -91,6 +93,7 @@ public class XSLTResponseWriter implemen
return mediaType;
}
+ @Override
public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException {
final Transformer t = getTransformer(request);
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/ExcludedMarkerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/ExcludedMarkerFactory.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/ExcludedMarkerFactory.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/ExcludedMarkerFactory.java Tue Jan 8 03:40:16 2013
@@ -49,6 +49,7 @@ class ExcludedTransformer extends BaseEd
super(name, idFieldName, ft);
}
+ @Override
protected Set<String> getIdSet() {
return (Set<String>)context.req.getContext().get(QueryElevationComponent.EXCLUDED);
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/response/transform/TransformerFactory.java Tue Jan 8 03:40:16 2013
@@ -34,6 +34,7 @@ public abstract class TransformerFactory
{
protected String defaultUserArgs = null;
+ @Override
public void init(NamedList args) {
defaultUserArgs = (String)args.get( "args" );
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSpatialFieldType.java Tue Jan 8 03:40:16 2013
@@ -17,8 +17,14 @@ package org.apache.solr.schema;
* limitations under the License.
*/
+import com.google.common.base.Throwables;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
import com.spatial4j.core.context.SpatialContext;
import com.spatial4j.core.context.SpatialContextFactory;
+import com.spatial4j.core.distance.DistanceUtils;
+import com.spatial4j.core.exception.InvalidShapeException;
+import com.spatial4j.core.io.ParseUtils;
import com.spatial4j.core.shape.Point;
import com.spatial4j.core.shape.Rectangle;
import com.spatial4j.core.shape.Shape;
@@ -39,29 +45,36 @@ import org.apache.solr.common.SolrExcept
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.response.TextResponseWriter;
import org.apache.solr.search.QParser;
+import org.apache.solr.search.SpatialOptions;
import org.apache.solr.util.MapListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
/**
* Abstract base class for Solr FieldTypes based on a Lucene 4 {@link SpatialStrategy}.
*
* @lucene.experimental
*/
-public abstract class AbstractSpatialFieldType<T extends SpatialStrategy> extends FieldType {
+public abstract class AbstractSpatialFieldType<T extends SpatialStrategy> extends FieldType implements SpatialQueryable {
/** A local-param with one of "none" (default), "distance", or "recipDistance". */
public static final String SCORE_PARAM = "score";
+ /** A local-param boolean that can be set to false to only return the
+ * FunctionQuery (score), and thus not do filtering.
+ */
+ public static final String FILTER_PARAM = "filter";
+
protected final Logger log = LoggerFactory.getLogger( getClass() );
protected SpatialContext ctx;
protected SpatialArgsParser argsParser;
- private final ConcurrentHashMap<String, T> fieldStrategyMap = new ConcurrentHashMap<String,T>();
+ private final Cache<String, T> fieldStrategyCache = CacheBuilder.newBuilder().build();
@Override
protected void init(IndexSchema schema, Map<String, String> args) {
@@ -86,20 +99,20 @@ public abstract class AbstractSpatialFie
@Override
public final Field createField(SchemaField field, Object val, float boost) {
- throw new IllegalStateException("should be calling createFields because isPolyField() is true");
+ throw new IllegalStateException("instead call createFields() because isPolyField() is true");
}
@Override
- public final Field[] createFields(SchemaField field, Object val, float boost) {
+ public Field[] createFields(SchemaField field, Object val, float boost) {
String shapeStr = null;
Shape shape = null;
if (val instanceof Shape) {
shape = ((Shape) val);
} else {
shapeStr = val.toString();
- shape = ctx.readShape(shapeStr);
+ shape = parseShape(shapeStr);
}
- if( shape == null ) {
+ if (shape == null) {
log.debug("Field {}: null shape for input: {}", field, val);
return null;
}
@@ -131,6 +144,14 @@ public abstract class AbstractSpatialFie
}
}
+ protected Shape parseShape(String shapeStr) {
+ try {
+ return ctx.readShape(shapeStr);
+ } catch (InvalidShapeException e) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
+ }
+ }
+
protected String shapeToString(Shape shape) {
return ctx.toString(shape);
}
@@ -147,12 +168,41 @@ public abstract class AbstractSpatialFie
// Query Support
//--------------------------------------------------------------
+ /**
+ * Implemented for compatibility with Solr 3 spatial geofilt & bbox query parsers:
+ * {@link SpatialQueryable}.
+ */
+ @Override
+ public Query createSpatialQuery(QParser parser, SpatialOptions options) {
+ //--WARNING: the code from here to the next marker is identical to LatLonType's impl.
+ double[] point = null;
+ try {
+ point = ParseUtils.parseLatitudeLongitude(options.pointStr);
+ } catch (InvalidShapeException e) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
+ }
+
+ // lat & lon in degrees
+ double latCenter = point[0];
+ double lonCenter = point[1];
+
+ double distDeg = DistanceUtils.dist2Degrees(options.distance, options.radius);
+ //--END-WARNING
+
+ Shape shape = ctx.makeCircle(lonCenter, latCenter, distDeg);
+ if (options.bbox)
+ shape = shape.getBoundingBox();
+
+ SpatialArgs spatialArgs = new SpatialArgs(SpatialOperation.Intersects, shape);
+ return getQueryFromSpatialArgs(parser, options.field, spatialArgs);
+ }
+
@Override
public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2, boolean minInclusive, boolean maxInclusive) {
if (!minInclusive || !maxInclusive)
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Both sides of spatial range query must be inclusive: " + field.getName());
- Shape shape1 = ctx.readShape(part1);
- Shape shape2 = ctx.readShape(part2);
+ Shape shape1 = parseShape(part1);
+ Shape shape2 = parseShape(part2);
if (!(shape1 instanceof Point) || !(shape2 instanceof Point))
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Both sides of spatial range query must be points: " + field.getName());
Point p1 = (Point) shape1;
@@ -165,14 +215,22 @@ public abstract class AbstractSpatialFie
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
//This is different from Solr 3 LatLonType's approach which uses the MultiValueSource concept to directly expose
- // the an x & y pair of FieldCache value sources.
+ // the x & y pair of FieldCache value sources.
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
"A ValueSource isn't directly available from this field. Instead try a query using the distance as the score.");
}
@Override
public Query getFieldQuery(QParser parser, SchemaField field, String externalVal) {
- return getQueryFromSpatialArgs(parser, field, argsParser.parse(externalVal, ctx));
+ return getQueryFromSpatialArgs(parser, field, parseSpatialArgs(externalVal));
+ }
+
+ protected SpatialArgs parseSpatialArgs(String externalVal) {
+ try {
+ return argsParser.parse(externalVal, ctx);
+ } catch (Exception e) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
+ }
}
private Query getQueryFromSpatialArgs(QParser parser, SchemaField field, SpatialArgs spatialArgs) {
@@ -196,9 +254,13 @@ public abstract class AbstractSpatialFie
valueSource = strategy.makeRecipDistanceValueSource(spatialArgs.getShape());
else
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "'score' local-param must be one of 'none', 'distance', or 'recipDistance'");
+ FunctionQuery functionQuery = new FunctionQuery(valueSource);
+
+ if (localParams != null && !localParams.getBool(FILTER_PARAM, true))
+ return functionQuery;
Filter filter = strategy.makeFilter(spatialArgs);
- return new FilteredQuery(new FunctionQuery(valueSource), filter);
+ return new FilteredQuery(functionQuery, filter);
}
/**
@@ -208,18 +270,16 @@ public abstract class AbstractSpatialFie
* @return Non-null.
*/
public T getStrategy(final String fieldName) {
- T strategy = fieldStrategyMap.get(fieldName);
- //double-checked locking idiom
- if (strategy == null) {
- synchronized (fieldStrategyMap) {
- strategy = fieldStrategyMap.get(fieldName);
- if (strategy == null) {
- strategy = newSpatialStrategy(fieldName);
- fieldStrategyMap.put(fieldName,strategy);
+ try {
+ return fieldStrategyCache.get(fieldName, new Callable<T>() {
+ @Override
+ public T call() throws Exception {
+ return newSpatialStrategy(fieldName);
}
- }
+ });
+ } catch (ExecutionException e) {
+ throw Throwables.propagate(e.getCause());
}
- return strategy;
}
@Override
@@ -229,7 +289,8 @@ public abstract class AbstractSpatialFie
@Override
public SortField getSortField(SchemaField field, boolean top) {
- throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Sorting not supported on SpatialField: " + field.getName());
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Sorting not supported on SpatialField: " + field.getName()+
+ ", instead try sorting by query.");
}
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java Tue Jan 8 03:40:16 2013
@@ -93,6 +93,7 @@ public abstract class AbstractSubTypeFie
return proto;
}
+ @Override
public void inform(IndexSchema schema) {
//Can't do this until here b/c the Dynamic Fields are not initialized until here.
if (subType != null) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/CurrencyField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/CurrencyField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/CurrencyField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/CurrencyField.java Tue Jan 8 03:40:16 2013
@@ -192,6 +192,7 @@ public class CurrencyField extends Field
*
* @param indexSchema The index schema.
*/
+ @Override
public void inform(IndexSchema indexSchema) {
createDynamicCurrencyField(FIELD_SUFFIX_CURRENCY, fieldTypeCurrency);
createDynamicCurrencyField(FIELD_SUFFIX_AMOUNT_RAW, fieldTypeAmountRaw);
@@ -202,6 +203,7 @@ public class CurrencyField extends Field
*
* @param resourceLoader The resource loader.
*/
+ @Override
public void inform(ResourceLoader resourceLoader) {
provider.inform(resourceLoader);
boolean reloaded = provider.reload();
@@ -275,6 +277,7 @@ public class CurrencyField extends Field
amountValues = amountField.getType().getValueSource(amountField, parser);
}
+ @Override
public FunctionValues getValues(Map context, AtomicReaderContext reader) throws IOException {
final FunctionValues amounts = amountValues.getValues(context, reader);
final FunctionValues currencies = currencyValues.getValues(context, reader);
@@ -310,6 +313,7 @@ public class CurrencyField extends Field
}
}
+ @Override
public long longVal(int doc) {
if (!initializedCache) {
for (int i = 0; i < fractionDigitCache.length; i++) {
@@ -356,22 +360,27 @@ public class CurrencyField extends Field
return CurrencyValue.convertAmount(exchangeRate, sourceFractionDigits, amount, targetFractionDigits);
}
+ @Override
public int intVal(int doc) {
return (int) longVal(doc);
}
+ @Override
public double doubleVal(int doc) {
return (double) longVal(doc);
}
+ @Override
public float floatVal(int doc) {
return (float) longVal(doc);
}
+ @Override
public String strVal(int doc) {
return Long.toString(longVal(doc));
}
+ @Override
public String toString(int doc) {
return name() + '(' + amounts.toString(doc) + ',' + currencies.toString(doc) + ')';
}
@@ -433,6 +442,7 @@ class FileExchangeRateProvider implement
* @return The exchange rate.
* @throws SolrException if the requested currency pair cannot be found
*/
+ @Override
public double getExchangeRate(String sourceCurrencyCode, String targetCurrencyCode) {
if (sourceCurrencyCode == null || targetCurrencyCode == null) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cannot get exchange rate; currency was null.");
@@ -508,6 +518,7 @@ class FileExchangeRateProvider implement
return rates != null ? rates.hashCode() : 0;
}
+ @Override
public String toString() {
return "["+this.getClass().getName()+" : " + rates.size() + " rates.]";
}
@@ -776,6 +787,7 @@ class CurrencyValue {
return new CurrencyValue(convertAmount(exchangeRates, this.getCurrencyCode(), this.getAmount(), targetCurrencyCode), targetCurrencyCode);
}
+ @Override
public String toString() {
return String.valueOf(amount) + "," + currencyCode;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/DateField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/DateField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/DateField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/DateField.java Tue Jan 8 03:40:16 2013
@@ -190,6 +190,7 @@ public class DateField extends Primitive
}
}
+ @Override
public StorableField createField(SchemaField field, Object value, float boost) {
// Convert to a string before indexing
if(value instanceof Date) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/GeoHashField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/GeoHashField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/GeoHashField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/GeoHashField.java Tue Jan 8 03:40:16 2013
@@ -58,6 +58,7 @@ public class GeoHashField extends FieldT
//QUESTION: Should we do a fast and crude one? Or actually check distances
//Fast and crude could use EdgeNGrams, but that would require a different
//encoding. Plus there are issues around the Equator/Prime Meridian
+ @Override
public Query createSpatialQuery(QParser parser, SpatialOptions options) {
double [] point = new double[0];
try {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/IndexSchema.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/IndexSchema.java Tue Jan 8 03:40:16 2013
@@ -498,7 +498,7 @@ public final class IndexSchema {
}
if (!uniqueKeyField.stored()) {
- log.error("uniqueKey is not stored - distributed search will not work");
+ log.warn("uniqueKey is not stored - distributed search and MoreLikeThis will not work");
}
if (uniqueKeyField.multiValued()) {
String msg = "uniqueKey field ("+uniqueKeyFieldName+
@@ -765,6 +765,7 @@ public final class IndexSchema {
* as this object is less than, equal to, or greater than
* the specified object.
*/
+ @Override
public int compareTo(DynamicReplacement other) {
return other.regex.length() - regex.length();
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java Tue Jan 8 03:40:16 2013
@@ -64,6 +64,7 @@ public class OpenExchangeRatesOrgProvide
* @return The exchange rate.
* @throws SolrException if the requested currency pair cannot be found
*/
+ @Override
public double getExchangeRate(String sourceCurrencyCode, String targetCurrencyCode) {
if (rates == null) {
throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Rates not initialized.");
@@ -105,6 +106,7 @@ public class OpenExchangeRatesOrgProvide
return rates != null ? rates.hashCode() : 0;
}
+ @Override
public String toString() {
return "["+this.getClass().getName()+" : " + rates.getRates().size() + " rates.]";
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PointType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PointType.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PointType.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PointType.java Tue Jan 8 03:40:16 2013
@@ -177,6 +177,7 @@ public class PointType extends Coordinat
* @param options The {@link org.apache.solr.search.SpatialOptions} for this filter.
* @return The Query representing the bounding box around the point.
*/
+ @Override
public Query createSpatialQuery(QParser parser, SpatialOptions options) {
Query result = null;
double [] point = new double[0];
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java Tue Jan 8 03:40:16 2013
@@ -212,6 +212,7 @@ public class PreAnalyzedField extends Fi
return binaryValue;
}
+ @Override
public final boolean incrementToken() {
// lazy init the iterator
if (it == null) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java Tue Jan 8 03:40:16 2013
@@ -152,6 +152,7 @@ public final class SimplePreAnalyzedPars
attr.clear();
}
+ @Override
public String toString() {
return "tok='" + token + "',attr=" + attr;
}
@@ -451,6 +452,7 @@ public final class SimplePreAnalyzedPars
return resState;
}
+ @Override
public String toFormattedString(Field f) throws IOException {
StringBuilder sb = new StringBuilder();
sb.append(VERSION + " ");
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java Tue Jan 8 03:40:16 2013
@@ -87,6 +87,7 @@ public class SortableFloatField extends
return NumberUtils.SortableStr2floatStr(indexedForm);
}
+ @Override
public CharsRef indexedToReadable(BytesRef input, CharsRef charsRef) {
// TODO: this could be more efficient, but the sortable types should be deprecated instead
UnicodeUtil.UTF8toUTF16(input, charsRef);
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableIntField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableIntField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableIntField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableIntField.java Tue Jan 8 03:40:16 2013
@@ -85,6 +85,7 @@ public class SortableIntField extends Pr
return NumberUtils.SortableStr2int(indexedForm);
}
+ @Override
public CharsRef indexedToReadable(BytesRef input, CharsRef charsRef) {
// TODO: this could be more efficient, but the sortable types should be deprecated instead
UnicodeUtil.UTF8toUTF16(input, charsRef);
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableLongField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableLongField.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableLongField.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/schema/SortableLongField.java Tue Jan 8 03:40:16 2013
@@ -76,6 +76,7 @@ public class SortableLongField extends P
return NumberUtils.SortableStr2long(indexedForm);
}
+ @Override
public CharsRef indexedToReadable(BytesRef input, CharsRef charsRef) {
// TODO: this could be more efficient, but the sortable types should be deprecated instead
UnicodeUtil.UTF8toUTF16(input, charsRef);
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BitDocSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BitDocSet.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BitDocSet.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BitDocSet.java Tue Jan 8 03:40:16 2013
@@ -86,28 +86,34 @@ public class BitDocSet extends DocSetBas
}
***/
+ @Override
public DocIterator iterator() {
return new DocIterator() {
private final OpenBitSetIterator iter = new OpenBitSetIterator(bits);
private int pos = iter.nextDoc();
+ @Override
public boolean hasNext() {
return pos != DocIdSetIterator.NO_MORE_DOCS;
}
+ @Override
public Integer next() {
return nextDoc();
}
+ @Override
public void remove() {
bits.clear(pos);
}
+ @Override
public int nextDoc() {
int old=pos;
pos=iter.nextDoc();
return old;
}
+ @Override
public float score() {
return 0.0f;
}
@@ -136,6 +142,7 @@ public class BitDocSet extends DocSetBas
size=-1; // invalidate size
}
+ @Override
public int size() {
if (size!=-1) return size;
return size=(int)bits.cardinality();
@@ -152,6 +159,7 @@ public class BitDocSet extends DocSetBas
/** Returns true of the doc exists in the set.
* Should only be called when doc < OpenBitSet.size()
*/
+ @Override
public boolean exists(int doc) {
return bits.fastGet(doc);
}
@@ -229,6 +237,7 @@ public class BitDocSet extends DocSetBas
}
+ @Override
public long memSize() {
return (bits.getBits().length << 3) + 16;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/BoostQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -40,6 +40,7 @@ public class BoostQParserPlugin extends
public static String NAME = "boost";
public static String BOOSTFUNC = "b";
+ @Override
public void init(NamedList args) {
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DisMaxQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DisMaxQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DisMaxQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DisMaxQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -112,6 +112,7 @@ import org.apache.solr.request.SolrQuery
public class DisMaxQParserPlugin extends QParserPlugin {
public static String NAME = "dismax";
+ @Override
public void init(NamedList args) {
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocList.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocList.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocList.java Tue Jan 8 03:40:16 2013
@@ -36,6 +36,7 @@ public interface DocList extends DocSet
/**
* Returns the number of ids in this list.
*/
+ @Override
public int size();
/**
@@ -76,6 +77,7 @@ public interface DocList extends DocSet
* </p>
* @see #hasScores
*/
+ @Override
public DocIterator iterator();
/** True if scores were retained */
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSetBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSetBase.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSetBase.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSetBase.java Tue Jan 8 03:40:16 2013
@@ -55,6 +55,7 @@ abstract class DocSetBase implements Doc
/**
* @throws SolrException Base implementation does not allow modifications
*/
+ @Override
public void add(int doc) {
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Unsupported Operation");
}
@@ -62,6 +63,7 @@ abstract class DocSetBase implements Doc
/**
* @throws SolrException Base implementation does not allow modifications
*/
+ @Override
public void addUnique(int doc) {
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Unsupported Operation");
}
@@ -71,6 +73,7 @@ abstract class DocSetBase implements Doc
*
* @see BitDocSet#getBits
*/
+ @Override
public OpenBitSet getBits() {
OpenBitSet bits = new OpenBitSet();
for (DocIterator iter = iterator(); iter.hasNext();) {
@@ -79,6 +82,7 @@ abstract class DocSetBase implements Doc
return bits;
};
+ @Override
public DocSet intersection(DocSet other) {
// intersection is overloaded in the smaller DocSets to be more
// efficient, so dispatch off of it instead.
@@ -92,6 +96,7 @@ abstract class DocSetBase implements Doc
return new BitDocSet(newbits);
}
+ @Override
public boolean intersects(DocSet other) {
// intersection is overloaded in the smaller DocSets to be more
// efficient, so dispatch off of it instead.
@@ -103,12 +108,14 @@ abstract class DocSetBase implements Doc
}
+ @Override
public DocSet union(DocSet other) {
OpenBitSet newbits = (OpenBitSet)(this.getBits().clone());
newbits.or(other.getBits());
return new BitDocSet(newbits);
}
+ @Override
public int intersectionSize(DocSet other) {
// intersection is overloaded in the smaller DocSets to be more
// efficient, so dispatch off of it instead.
@@ -119,20 +126,24 @@ abstract class DocSetBase implements Doc
return intersection(other).size();
}
+ @Override
public int unionSize(DocSet other) {
return this.size() + other.size() - this.intersectionSize(other);
}
+ @Override
public DocSet andNot(DocSet other) {
OpenBitSet newbits = (OpenBitSet)(this.getBits().clone());
newbits.andNot(other.getBits());
return new BitDocSet(newbits);
}
+ @Override
public int andNotSize(DocSet other) {
return this.size() - this.intersectionSize(other);
}
+ @Override
public Filter getTopFilter() {
final OpenBitSet bs = getBits();
@@ -194,6 +205,7 @@ abstract class DocSetBase implements Doc
};
}
+ @Override
public void setBitsOn(OpenBitSet target) {
DocIterator iter = iterator();
while (iter.hasNext()) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSlice.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSlice.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSlice.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/DocSlice.java Tue Jan 8 03:40:16 2013
@@ -52,6 +52,7 @@ public class DocSlice extends DocSetBase
this.maxScore=maxScore;
}
+ @Override
public DocList subset(int offset, int len) {
if (this.offset == offset && this.len==len) return this;
@@ -65,20 +66,26 @@ public class DocSlice extends DocSetBase
return new DocSlice(offset, realLen, docs, scores, matches, maxScore);
}
+ @Override
public boolean hasScores() {
return scores!=null;
}
+ @Override
public float maxScore() {
return maxScore;
}
+ @Override
public int offset() { return offset; }
+ @Override
public int size() { return len; }
+ @Override
public int matches() { return matches; }
+ @Override
public long memSize() {
return (docs.length<<2)
+ (scores==null ? 0 : (scores.length<<2))
@@ -86,6 +93,7 @@ public class DocSlice extends DocSetBase
}
+ @Override
public boolean exists(int doc) {
int end = offset+len;
for (int i=offset; i<end; i++) {
@@ -96,14 +104,17 @@ public class DocSlice extends DocSetBase
// Hmmm, maybe I could have reused the scorer interface here...
// except that it carries Similarity baggage...
+ @Override
public DocIterator iterator() {
return new DocIterator() {
int pos=offset;
final int end=offset+len;
+ @Override
public boolean hasNext() {
return pos < end;
}
+ @Override
public Integer next() {
return nextDoc();
}
@@ -111,14 +122,17 @@ public class DocSlice extends DocSetBase
/**
* The remove operation is not supported by this Iterator.
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException("The remove operation is not supported by this Iterator.");
}
+ @Override
public int nextDoc() {
return docs[pos++];
}
+ @Override
public float score() {
return scores[pos-1];
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -54,6 +54,7 @@ import org.apache.solr.util.SolrPluginUt
public class ExtendedDismaxQParserPlugin extends QParserPlugin {
public static final String NAME = "edismax";
+ @Override
public void init(NamedList args) {
}
@@ -1375,10 +1376,12 @@ class ExtendedDismaxQParser extends QPar
* as this object is less than, equal to, or greater than
* the specified object.
*/
+ @Override
public int compareTo(DynamicField other) {
return other.wildcard.length() - wildcard.length();
}
+ @Override
public String toString() {
return this.wildcard;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedQueryBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedQueryBase.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedQueryBase.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/ExtendedQueryBase.java Tue Jan 8 03:40:16 2013
@@ -49,6 +49,7 @@ public class ExtendedQueryBase extends Q
this.cost = cost;
}
+ @Override
public int getCost() {
return cost;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FastLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FastLRUCache.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FastLRUCache.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FastLRUCache.java Tue Jan 8 03:40:16 2013
@@ -51,6 +51,7 @@ public class FastLRUCache<K,V> extends S
private ConcurrentLRUCache<K,V> cache;
private int showItems = 0;
+ @Override
public Object init(Map args, Object persistence, CacheRegenerator regenerator) {
super.init(args, regenerator);
String str = (String) args.get("size");
@@ -113,27 +114,33 @@ public class FastLRUCache<K,V> extends S
return description;
}
+ @Override
public int size() {
return cache.size();
}
+ @Override
public V put(K key, V value) {
return cache.put(key, value);
}
+ @Override
public V get(K key) {
return cache.get(key);
}
+ @Override
public void clear() {
cache.clear();
}
+ @Override
public void setState(State state) {
super.setState(state);
cache.setAlive(state == State.LIVE);
}
+ @Override
public void warm(SolrIndexSearcher searcher, SolrCache old) {
if (regenerator == null) return;
long warmingStartTime = System.currentTimeMillis();
@@ -162,6 +169,7 @@ public class FastLRUCache<K,V> extends S
}
+ @Override
public void close() {
// add the stats to the cumulative stats object (the first in the statsList)
statsList.get(0).add(cache.getStats());
@@ -170,19 +178,23 @@ public class FastLRUCache<K,V> extends S
}
//////////////////////// SolrInfoMBeans methods //////////////////////
+ @Override
public String getName() {
return FastLRUCache.class.getName();
}
+ @Override
public String getDescription() {
return description;
}
+ @Override
public String getSource() {
return "$URL$";
}
+ @Override
public NamedList getStatistics() {
NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
if (cache == null) return lst;
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FieldQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -34,6 +34,7 @@ import org.apache.solr.schema.SchemaFiel
public class FieldQParserPlugin extends QParserPlugin {
public static String NAME = "field";
+ @Override
public void init(NamedList args) {
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -28,6 +28,7 @@ import org.apache.solr.request.SolrQuery
public class FunctionQParserPlugin extends QParserPlugin {
public static String NAME = "func";
+ @Override
public void init(NamedList args) {
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/FunctionRangeQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -38,6 +38,7 @@ import org.apache.solr.search.function.*
public class FunctionRangeQParserPlugin extends QParserPlugin {
public static String NAME = "frange";
+ @Override
public void init(NamedList args) {
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/Grouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/Grouping.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/Grouping.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/Grouping.java Tue Jan 8 03:40:16 2013
@@ -681,6 +681,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void prepare() throws IOException {
actualGroupsToFind = getMax(offset, numGroups, maxDoc);
}
@@ -688,6 +689,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Collector createFirstPassCollector() throws IOException {
// Ok we don't want groups, but do want a total count
if (actualGroupsToFind <= 0) {
@@ -703,6 +705,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Collector createSecondPassCollector() throws IOException {
if (actualGroupsToFind <= 0) {
allGroupsCollector = new TermAllGroupsCollector(groupBy);
@@ -747,6 +750,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void finish() throws IOException {
result = secondPass != null ? secondPass.getTopGroups(0) : null;
if (main) {
@@ -796,6 +800,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
public int getMatches() {
if (result == null && fallBackCollector == null) {
return 0;
@@ -807,6 +812,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Integer getNumberOfGroups() {
return allGroupsCollector == null ? null : allGroupsCollector.getGroupCount();
}
@@ -825,6 +831,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void prepare() throws IOException {
actualGroupsToFind = getMax(offset, numGroups, maxDoc);
}
@@ -832,6 +839,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Collector createFirstPassCollector() throws IOException {
DocSet groupFilt = searcher.getDocSet(query);
topCollector = newCollector(groupSort, needScores);
@@ -851,6 +859,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void finish() throws IOException {
TopDocsCollector topDocsCollector = (TopDocsCollector) collector.getDelegate();
TopDocs topDocs = topDocsCollector.topDocs();
@@ -866,6 +875,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
public int getMatches() {
return collector.getMatches();
}
@@ -889,6 +899,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void prepare() throws IOException {
Map context = ValueSource.newContext(searcher);
groupBy.createWeight(context, searcher);
@@ -898,6 +909,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Collector createFirstPassCollector() throws IOException {
// Ok we don't want groups, but do want a total count
if (actualGroupsToFind <= 0) {
@@ -913,6 +925,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Collector createSecondPassCollector() throws IOException {
if (actualGroupsToFind <= 0) {
allGroupsCollector = new FunctionAllGroupsCollector(groupBy, context);
@@ -954,6 +967,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected void finish() throws IOException {
result = secondPass != null ? secondPass.getTopGroups(0) : null;
if (main) {
@@ -989,6 +1003,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
public int getMatches() {
if (result == null && fallBackCollector == null) {
return 0;
@@ -1000,6 +1015,7 @@ public class Grouping {
/**
* {@inheritDoc}
*/
+ @Override
protected Integer getNumberOfGroups() {
return allGroupsCollector == null ? null : allGroupsCollector.getGroupCount();
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/HashDocSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/HashDocSet.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/HashDocSet.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/HashDocSet.java Tue Jan 8 03:40:16 2013
@@ -96,6 +96,7 @@ public final class HashDocSet extends Do
table[s]=doc;
}
+ @Override
public boolean exists(int doc) {
int s = doc & mask;
for(;;) {
@@ -108,24 +109,29 @@ public final class HashDocSet extends Do
}
+ @Override
public int size() {
return size;
}
+ @Override
public DocIterator iterator() {
return new DocIterator() {
int pos=0;
int doc;
{ goNext(); }
+ @Override
public boolean hasNext() {
return pos < table.length;
}
+ @Override
public Integer next() {
return nextDoc();
}
+ @Override
public void remove() {
}
@@ -134,6 +140,7 @@ public final class HashDocSet extends Do
}
// modify to return -1 at end of iteration?
+ @Override
public int nextDoc() {
int doc = table[pos];
pos++;
@@ -141,12 +148,14 @@ public final class HashDocSet extends Do
return doc;
}
+ @Override
public float score() {
return 0.0f;
}
};
}
+ @Override
public long memSize() {
return (table.length<<2) + 20;
}
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java Tue Jan 8 03:40:16 2013
@@ -47,11 +47,14 @@ import java.util.Set;
public class JoinQParserPlugin extends QParserPlugin {
public static String NAME = "join";
+ @Override
public void init(NamedList args) {
}
+ @Override
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
return new QParser(qstr, localParams, params, req) {
+ @Override
public Query parse() throws SyntaxError {
String fromField = getParam("from");
String fromIndex = getParam("fromIndex");
@@ -121,6 +124,7 @@ class JoinQuery extends Query {
public void extractTerms(Set terms) {
}
+ @Override
public Weight createWeight(IndexSearcher searcher) throws IOException {
return new JoinQueryWeight((SolrIndexSearcher)searcher);
}
@@ -191,6 +195,7 @@ class JoinQuery extends Query {
this.toSearcher = searcher;
}
+ @Override
public Query getQuery() {
return JoinQuery.this;
}
@@ -340,7 +345,7 @@ class JoinQuery extends Query {
if (freq < minDocFreqFrom) {
fromTermDirectCount++;
// OK to skip liveDocs, since we check for intersection with docs matching query
- fromDeState.docsEnum = fromDeState.termsEnum.docs(null, fromDeState.docsEnum, 0);
+ fromDeState.docsEnum = fromDeState.termsEnum.docs(null, fromDeState.docsEnum, DocsEnum.FLAG_NONE);
DocsEnum docsEnum = fromDeState.docsEnum;
if (docsEnum instanceof MultiDocsEnum) {
@@ -405,7 +410,7 @@ class JoinQuery extends Query {
toTermDirectCount++;
// need to use liveDocs here so we don't map to any deleted ones
- toDeState.docsEnum = toDeState.termsEnum.docs(toDeState.liveDocs, toDeState.docsEnum, 0);
+ toDeState.docsEnum = toDeState.termsEnum.docs(toDeState.liveDocs, toDeState.docsEnum, DocsEnum.FLAG_NONE);
DocsEnum docsEnum = toDeState.docsEnum;
if (docsEnum instanceof MultiDocsEnum) {
Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/LFUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/LFUCache.java?rev=1430130&r1=1430129&r2=1430130&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/LFUCache.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/search/LFUCache.java Tue Jan 8 03:40:16 2013
@@ -59,6 +59,7 @@ public class LFUCache<K, V> implements S
private int showItems = 0;
private Boolean timeDecay = true;
+ @Override
public Object init(Map args, Object persistence, CacheRegenerator regenerator) {
state = State.CREATED;
this.regenerator = regenerator;
@@ -124,36 +125,44 @@ public class LFUCache<K, V> implements S
return statsList;
}
+ @Override
public String name() {
return name;
}
+ @Override
public int size() {
return cache.size();
}
+ @Override
public V put(K key, V value) {
return cache.put(key, value);
}
+ @Override
public V get(K key) {
return cache.get(key);
}
+ @Override
public void clear() {
cache.clear();
}
+ @Override
public void setState(State state) {
this.state = state;
cache.setAlive(state == State.LIVE);
}
+ @Override
public State getState() {
return state;
}
+ @Override
public void warm(SolrIndexSearcher searcher, SolrCache old) {
if (regenerator == null) return;
long warmingStartTime = System.currentTimeMillis();
@@ -182,6 +191,7 @@ public class LFUCache<K, V> implements S
}
+ @Override
public void close() {
// add the stats to the cumulative stats object (the first in the statsList)
statsList.get(0).add(cache.getStats());
@@ -190,26 +200,32 @@ public class LFUCache<K, V> implements S
}
//////////////////////// SolrInfoMBeans methods //////////////////////
+ @Override
public String getName() {
return LFUCache.class.getName();
}
+ @Override
public String getVersion() {
return SolrCore.version;
}
+ @Override
public String getDescription() {
return description;
}
+ @Override
public Category getCategory() {
return Category.CACHE;
}
+ @Override
public String getSource() {
return "$URL$";
}
+ @Override
public URL[] getDocs() {
return null;
}
@@ -223,6 +239,7 @@ public class LFUCache<K, V> implements S
return "0." + hundredths;
}
+ @Override
public NamedList getStatistics() {
NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
if (cache == null) return lst;