You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/05/07 13:21:14 UTC
svn commit: r1479862 [38/38] - in /lucene/dev/branches/lucene4258: ./
dev-tools/ dev-tools/idea/.idea/ dev-tools/idea/.idea/libraries/
dev-tools/maven/ dev-tools/maven/solr/ dev-tools/maven/solr/core/src/java/
dev-tools/maven/solr/solrj/src/java/ dev-t...
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java Tue May 7 11:20:55 2013
@@ -28,7 +28,7 @@ public interface CollectionParams
public enum CollectionAction {
- CREATE, DELETE, RELOAD, SYNCSHARD, CREATEALIAS, DELETEALIAS;
+ CREATE, DELETE, RELOAD, SYNCSHARD, CREATEALIAS, DELETEALIAS, SPLITSHARD;
public static CollectionAction get( String p )
{
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java Tue May 7 11:20:55 2013
@@ -74,6 +74,16 @@ public interface CoreAdminParams
/** The shard id in solr cloud */
public final static String SHARD = "shard";
+ /** The shard range in solr cloud */
+ public final static String SHARD_RANGE = "shard.range";
+
+ /** The shard range in solr cloud */
+ public final static String SHARD_STATE = "shard.state";
+
+ /** The target core to which a split index should be written to
+ * Multiple targetCores can be specified by multiple targetCore parameters */
+ public final static String TARGET_CORE = "targetCore";
+
public static final String ROLES = "roles";
public static final String CORE_NODE_NAME = "coreNodeName";
@@ -88,6 +98,9 @@ public interface CoreAdminParams
public static final String DELETE_INSTANCE_DIR = "deleteInstanceDir";
+ public static final String LOAD_ON_STARTUP = "loadOnStartup";
+
+ public static final String TRANSIENT = "transient";
public enum CoreAdminAction {
STATUS,
@@ -104,7 +117,10 @@ public interface CoreAdminParams
REQUESTRECOVERY,
REQUESTSYNCSHARD,
CREATEALIAS,
- DELETEALIAS;
+ DELETEALIAS,
+ REQUESTAPPLYUPDATES,
+ LOAD_ON_STARTUP,
+ TRANSIENT;
public static CoreAdminAction get( String p )
{
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/HighlightParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/HighlightParams.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/HighlightParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/HighlightParams.java Tue May 7 11:20:55 2013
@@ -41,9 +41,13 @@ public interface HighlightParams {
public static final String BS_TYPE = HIGHLIGHT+".bs.type";
public static final String BS_LANGUAGE = HIGHLIGHT+".bs.language";
public static final String BS_COUNTRY = HIGHLIGHT+".bs.country";
+ public static final String BS_VARIANT = HIGHLIGHT+".bs.variant";
public static final String FIELD_MATCH = HIGHLIGHT+".requireFieldMatch";
+ public static final String DEFAULT_SUMMARY = HIGHLIGHT + ".defaultSummary";
public static final String ALTERNATE_FIELD = HIGHLIGHT+".alternateField";
public static final String ALTERNATE_FIELD_LENGTH = HIGHLIGHT+".maxAlternateFieldLength";
+ public static final String MAX_MULTIVALUED_TO_EXAMINE = HIGHLIGHT + ".maxMultiValuedToExamine";
+ public static final String MAX_MULTIVALUED_TO_MATCH = HIGHLIGHT + ".maxMultiValuedToMatch";
public static final String USE_PHRASE_HIGHLIGHTER = HIGHLIGHT+".usePhraseHighlighter";
public static final String HIGHLIGHT_MULTI_TERM = HIGHLIGHT+".highlightMultiTerm";
@@ -53,6 +57,7 @@ public interface HighlightParams {
public static final String USE_FVH = HIGHLIGHT + ".useFastVectorHighlighter";
public static final String TAG_PRE = HIGHLIGHT + ".tag.pre";
public static final String TAG_POST = HIGHLIGHT + ".tag.post";
+ public static final String TAG_ELLIPSIS = HIGHLIGHT + ".tag.ellipsis";
public static final String PHRASE_LIMIT = HIGHLIGHT + ".phraseLimit";
public static final String MULTI_VALUED_SEPARATOR = HIGHLIGHT + ".multiValuedSeparatorChar";
@@ -66,4 +71,10 @@ public interface HighlightParams {
public static final String SLOP = HIGHLIGHT+"."+REGEX+".slop";
public static final String PATTERN = HIGHLIGHT+"."+REGEX+".pattern";
public static final String MAX_RE_CHARS = HIGHLIGHT+"."+REGEX+".maxAnalyzedChars";
+
+ // Scoring parameters
+ public static final String SCORE = "score";
+ public static final String SCORE_K1 = HIGHLIGHT +"."+SCORE+".k1";
+ public static final String SCORE_B = HIGHLIGHT +"."+SCORE+".b";
+ public static final String SCORE_PIVOT = HIGHLIGHT +"."+SCORE+".pivot";
}
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/SpellingParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/SpellingParams.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/SpellingParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/SpellingParams.java Tue May 7 11:20:55 2013
@@ -129,13 +129,32 @@ public interface SpellingParams {
* </p>
*/
public static final String SPELLCHECK_MAX_COLLATION_EVALUATIONS = SPELLCHECK_PREFIX + "maxCollationEvaluations";
-
+ /**
+ * <p>
+ * For use with {@link SpellingParams#SPELLCHECK_MAX_COLLATION_TRIES} and
+ * {@link SpellingParams#SPELLCHECK_COLLATE_EXTENDED_RESULTS}.
+ * A performance optimization in cases where the exact number of hits a collation would return is not needed.
+ * Specify "0" to return the exact # of hits, otherwise give the maximum documents Lucene should collect
+ * with which to base an estimate. The higher the value the more likely the estimates will be accurate
+ * (at expense of performance).
+ * </p>
+ *
+ * <p>
+ * The default is 0 (report exact hit-counts) when {@link SpellingParams#SPELLCHECK_COLLATE_EXTENDED_RESULTS} is TRUE.
+ * When {@link SpellingParams#SPELLCHECK_COLLATE_EXTENDED_RESULTS} is FALSE, this optimization is always performed.
+ * </p>
+ */
+ public static final String SPELLCHECK_COLLATE_MAX_COLLECT_DOCS = SPELLCHECK_PREFIX + "collateMaxCollectDocs";
/**
* <p>
* Whether to use the Extended Results Format for collations.
* Includes "before>after" pairs to easily allow clients to generate messages like "no results for PORK. did you mean POLK?"
* Also indicates the # of hits each collation will return on re-query. Default=false, which retains 1.4-compatible output.
* </p>
+ * <p>
+ * Note: that if {@link SpellingParams#SPELLCHECK_COLLATE_MAX_COLLECT_DOCS} is set to a value greater than 0,
+ * then the hit counts returned by this will be estimated.
+ * </p>
*/
public static final String SPELLCHECK_COLLATE_EXTENDED_RESULTS = SPELLCHECK_PREFIX + "collateExtendedResults";
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/sampleDateFacetResponse.xml Tue May 7 11:20:55 2013
@@ -74,7 +74,8 @@
<date name="end">2008-02-13T15:26:37Z</date>
<int name="before">90</int>
<int name="after">1</int>
+ <int name="between">11</int>
</lst>
</lst>
</lst>
-</response>
\ No newline at end of file
+</response>
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/shared/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/shared/solr.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/shared/solr.xml (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/shared/solr.xml Tue May 7 11:20:55 2013
@@ -30,7 +30,7 @@
adminPath: RequestHandler path to manage cores.
If 'null' (or absent), cores will not be manageable via REST
-->
- <cores adminPath="/admin/cores" defaultCoreName="core0" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:}" zkClientTimeout="8000">
+ <cores adminPath="/admin/cores" defaultCoreName="core0" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000">
<core name="collection1" instanceDir="." />
<core name="core0" instanceDir="${theInstanceDir:./}" dataDir="${dataDir1}" collection="${collection:acollection}">
<property name="version" value="3.5"/>
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/solr.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/solr.xml (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test-files/solrj/solr/solr.xml Tue May 7 11:20:55 2013
@@ -28,7 +28,7 @@
adminPath: RequestHandler path to manage cores.
If 'null' (or absent), cores will not be manageable via request handler
-->
- <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:}" zkClientTimeout="8000" numShards="${numShards:3}">
+ <cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}" hostContext="${hostContext:solr}" zkClientTimeout="8000" numShards="${numShards:3}">
<core name="collection1" instanceDir="collection1" shard="${shard:}" collection="${collection:collection1}" config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}"/>
</cores>
</solr>
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/MergeIndexesExampleTestBase.java Tue May 7 11:20:55 2013
@@ -19,6 +19,7 @@ package org.apache.solr.client.solrj;
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
@@ -26,6 +27,8 @@ import org.apache.solr.client.solrj.requ
import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
import org.apache.solr.util.ExternalPaths;
@@ -190,4 +193,14 @@ public abstract class MergeIndexesExampl
assertEquals(1,
getSolrCore0().query(new SolrQuery("id:BBB")).getResults().size());
}
+
+ public void testMergeMultipleRequest() throws Exception {
+ CoreAdminRequest.MergeIndexes req = new CoreAdminRequest.MergeIndexes();
+ req.setCoreName("core0");
+ req.setIndexDirs(Arrays.asList("/path/1", "/path/2"));
+ req.setSrcCores(Arrays.asList("core1", "core2"));
+ SolrParams params = req.getParams();
+ assertEquals(2, params.getParams(CoreAdminParams.SRC_CORE).length);
+ assertEquals(2, params.getParams(CoreAdminParams.INDEX_DIR).length);
+ }
}
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java Tue May 7 11:20:55 2013
@@ -41,11 +41,12 @@ public class SolrExampleBinaryTest exten
{
try {
// setup the server...
- String url = jetty.getBaseUrl().toString();
+ String url = jetty.getBaseUrl().toString() + "/collection1";
HttpSolrServer s = new HttpSolrServer( url );
s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
s.setDefaultMaxConnectionsPerHost(100);
s.setMaxTotalConnections(100);
+ s.setUseMultiPartPost(random().nextBoolean());
// where the magic happens
s.setParser(new BinaryResponseParser());
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java Tue May 7 11:20:55 2013
@@ -36,8 +36,9 @@ public class SolrExampleXMLTest extends
@Override
public SolrServer createNewSolrServer() {
try {
- String url = jetty.getBaseUrl().toString();
+ String url = jetty.getBaseUrl().toString() + "/collection1";
HttpSolrServer s = new HttpSolrServer(url);
+ s.setUseMultiPartPost(random().nextBoolean());
s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
s.setDefaultMaxConnectionsPerHost(100);
s.setMaxTotalConnections(100);
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java Tue May 7 11:20:55 2013
@@ -55,7 +55,7 @@ public class SolrExampleStreamingTest ex
{
try {
// setup the server...
- String url = jetty.getBaseUrl().toString();
+ String url = jetty.getBaseUrl().toString() + "/collection1";
// smaller queue size hits locks more often
ConcurrentUpdateSolrServer s = new ConcurrentUpdateSolrServer( url, 2, 5 ) {
@@ -80,7 +80,7 @@ public class SolrExampleStreamingTest ex
// SOLR-3903
final List<Throwable> failures = new ArrayList<Throwable>();
ConcurrentUpdateSolrServer s = new ConcurrentUpdateSolrServer
- (jetty.getBaseUrl().toString(), 2, 2) {
+ (jetty.getBaseUrl().toString() + "/collection1", 2, 2) {
@Override
public void handleError(Throwable ex) {
failures.add(ex);
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java Tue May 7 11:20:55 2013
@@ -194,8 +194,8 @@ public class TestSolrProperties extends
exists("/solr/cores[@hostPort='${hostPort:8983}']", document));
assertTrue("\"/solr/cores[@zkClientTimeout='8000']\" doesn't match in:\n" + solrPersistXml,
exists("/solr/cores[@zkClientTimeout='8000']", document));
- assertTrue("\"/solr/cores[@hostContext='solr']\" doesn't match in:\n" + solrPersistXml,
- exists("/solr/cores[@hostContext='solr']", document));
+ assertTrue("\"/solr/cores[@hostContext='${hostContext:solr}']\" doesn't match in:\n" + solrPersistXml,
+ exists("/solr/cores[@hostContext='${hostContext:solr}']", document));
} finally {
fis.close();
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java Tue May 7 11:20:55 2013
@@ -43,6 +43,8 @@ import org.apache.solr.client.solrj.requ
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.util.ExternalPaths;
@@ -55,7 +57,7 @@ public class BasicHttpSolrServerTest ext
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
- resp.sendRedirect("/solr/select?" + req.getQueryString());
+ resp.sendRedirect("/solr/collection1/select?" + req.getQueryString());
}
}
@@ -74,12 +76,19 @@ public class BasicHttpSolrServerTest ext
lastMethod = null;
headers = null;
parameters = null;
+ errorCode = null;
}
+ public static Integer errorCode = null;
public static String lastMethod = null;
public static HashMap<String,String> headers = null;
public static Map<String,String[]> parameters = null;
+ public static void setErrorCode(Integer code) {
+ errorCode = code;
+ }
+
+
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
@@ -110,6 +119,13 @@ public class BasicHttpSolrServerTest ext
private void recordRequest(HttpServletRequest req, HttpServletResponse resp) {
setHeaders(req);
setParameters(req);
+ if (null != errorCode) {
+ try {
+ resp.sendError(errorCode);
+ } catch (IOException e) {
+ throw new RuntimeException("sendError IO fail in DebugServlet", e);
+ }
+ }
}
}
@@ -160,6 +176,34 @@ public class BasicHttpSolrServerTest ext
server.shutdown();
}
+ /**
+ * test that SolrExceptions thrown by HttpSolrServer can
+ * correctly encapsulate http status codes even when not on the list of
+ * ErrorCodes solr may return.
+ */
+ public void testSolrExceptionCodeNotFromSolr() throws IOException, SolrServerException {
+ final int status = 527;
+ assertEquals(status + " didn't generate an UNKNOWN error code, someone modified the list of valid ErrorCode's w/o changing this test to work a different way",
+ ErrorCode.UNKNOWN, ErrorCode.getErrorCode(status));
+
+ HttpSolrServer server = new HttpSolrServer(jetty.getBaseUrl().toString() +
+ "/debug/foo");
+ try {
+ DebugServlet.setErrorCode(status);
+ try {
+ SolrQuery q = new SolrQuery("foo");
+ server.query(q, METHOD.GET);
+ fail("Didn't get excepted exception from oversided request");
+ } catch (SolrException e) {
+ System.out.println(e);
+ assertEquals("Unexpected exception status code", status, e.code());
+ }
+ } finally {
+ server.shutdown();
+ DebugServlet.clear();
+ }
+ }
+
@Test
public void testQuery(){
DebugServlet.clear();
@@ -395,7 +439,7 @@ public class BasicHttpSolrServerTest ext
assertNull(DebugServlet.headers.get("Accept-Encoding"));
// verify server compresses output
- HttpGet get = new HttpGet(jetty.getBaseUrl().toString() +
+ HttpGet get = new HttpGet(jetty.getBaseUrl().toString() + "/collection1" +
"/select?q=foo&wt=xml");
get.setHeader("Accept-Encoding", "gzip");
HttpClient client = HttpClientUtil.createClient(null);
@@ -414,7 +458,7 @@ public class BasicHttpSolrServerTest ext
}
// verify compressed response can be handled
- server = new HttpSolrServer(jetty.getBaseUrl().toString());
+ server = new HttpSolrServer(jetty.getBaseUrl().toString() + "/collection1");
server.setAllowCompression(true);
q = new SolrQuery("foo");
QueryResponse response = server.query(q);
@@ -441,7 +485,7 @@ public class BasicHttpSolrServerTest ext
@Test
public void testGetRawStream() throws SolrServerException, IOException{
HttpClient client = HttpClientUtil.createClient(null);
- HttpSolrServer server = new HttpSolrServer(jetty.getBaseUrl().toString(),
+ HttpSolrServer server = new HttpSolrServer(jetty.getBaseUrl().toString() + "/collection1",
client, null);
QueryRequest req = new QueryRequest();
NamedList response = server.request(req);
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java Tue May 7 11:20:55 2013
@@ -83,13 +83,29 @@ public class TestCoreAdmin extends Abstr
req.setInstanceDir(newCoreInstanceDir.getAbsolutePath() + File.separator + "newcore");
req.setDataDir(dataDir.getAbsolutePath());
req.setUlogDir(new File(dataDir, "ulog").getAbsolutePath());
+
+ // These should be the inverse of defaults.
+ req.setIsLoadOnStartup(false);
+ req.setIsTransient(true);
req.process(server);
-
+
+ // Show that the newly-created core has values for load on startup and transient different than defaults due to the
+ // above.
+
+ SolrCore coreProveIt = cores.getCore("collection1");
SolrCore core = cores.getCore("newcore");
+
+ assertTrue(core.getCoreDescriptor().isTransient());
+ assertFalse(coreProveIt.getCoreDescriptor().isTransient());
+
+ assertFalse(core.getCoreDescriptor().isLoadOnStartup());
+ assertTrue(coreProveIt.getCoreDescriptor().isLoadOnStartup());
+
File logDir;
try {
logDir = core.getUpdateHandler().getUpdateLog().getLogDir();
} finally {
+ coreProveIt.close();
core.close();
}
assertEquals(new File(dataDir, "ulog" + File.separator + "tlog").getAbsolutePath(), logDir.getAbsolutePath());
Modified: lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/test/org/apache/solr/client/solrj/response/QueryResponseTest.java Tue May 7 11:20:55 2013
@@ -114,6 +114,7 @@ public class QueryResponseTest extends L
assertEquals(0, manufacturedateDt.getCounts().get(2).getCount());
assertEquals(90, manufacturedateDt.getBefore());
assertEquals(1, manufacturedateDt.getAfter());
+ assertEquals(11, manufacturedateDt.getBetween());
}
@Test
Modified: lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/ivy.xml Tue May 7 11:20:55 2013
@@ -32,8 +32,8 @@
<dependency org="org.apache.ant" name="ant" rev="1.8.2" transitive="false" />
<dependency org="junit" name="junit" rev="4.10" transitive="false" conf="default->*;junit4-stdalone->*" />
- <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.0.8" transitive="false" conf="default->*;junit4-stdalone->*" />
- <dependency org="com.carrotsearch.randomizedtesting" name="randomizedtesting-runner" rev="2.0.8" transitive="false" conf="default->*;junit4-stdalone->*" />
+ <dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.0.9" transitive="false" conf="default->*;junit4-stdalone->*" />
+ <dependency org="com.carrotsearch.randomizedtesting" name="randomizedtesting-runner" rev="2.0.9" transitive="false" conf="default->*;junit4-stdalone->*" />
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java Tue May 7 11:20:55 2013
@@ -29,6 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
+import java.util.SortedMap;
import java.util.concurrent.atomic.AtomicInteger;
import junit.framework.Assert;
@@ -52,6 +53,7 @@ import org.apache.solr.common.params.Sol
import org.apache.solr.common.util.NamedList;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.util.AbstractSolrTestCase;
+import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.junit.Test;
@@ -363,7 +365,9 @@ public abstract class BaseDistributedSea
public JettySolrRunner createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, boolean explicitCoreNodeName) throws Exception {
- JettySolrRunner jetty = new JettySolrRunner(solrHome.getAbsolutePath(), context, 0, solrConfigOverride, schemaOverride);
+ boolean stopAtShutdown = true;
+ JettySolrRunner jetty = new JettySolrRunner
+ (solrHome.getAbsolutePath(), context, 0, solrConfigOverride, schemaOverride, stopAtShutdown, getExtraServlets());
jetty.setShards(shardList);
jetty.setDataDir(dataDir);
if (explicitCoreNodeName) {
@@ -374,12 +378,17 @@ public abstract class BaseDistributedSea
return jetty;
}
+ /** Override this method to insert extra servlets into the JettySolrRunners that are created using createJetty() */
+ public SortedMap<ServletHolder,String> getExtraServlets() {
+ return null;
+ }
+
protected SolrServer createNewSolrServer(int port) {
try {
// setup the server...
String url = "http://127.0.0.1:" + port + context;
HttpSolrServer s = new HttpSolrServer(url);
- s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);;
+ s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
s.setSoTimeout(60000);
s.setDefaultMaxConnectionsPerHost(100);
s.setMaxTotalConnections(100);
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java Tue May 7 11:20:55 2013
@@ -17,25 +17,19 @@ package org.apache.solr;
* limitations under the License.
*/
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedMap;
+
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.util.ExternalPaths;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.solr.util.RESTfulServerProvider;
-import org.apache.solr.util.RestTestHarness;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.restlet.ext.servlet.ServerServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -159,7 +153,7 @@ abstract public class SolrJettyTestBase
if (jetty != null) {
try {
// setup the server...
- String url = jetty.getBaseUrl().toString();
+ String url = jetty.getBaseUrl().toString() + "/" + "collection1";
HttpSolrServer s = new HttpSolrServer( url );
s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT);
s.setDefaultMaxConnectionsPerHost(100);
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Tue May 7 11:20:55 2013
@@ -23,6 +23,7 @@ import java.util.logging.*;
import javax.xml.xpath.XPathExpressionException;
+import org.apache.commons.io.FileUtils;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.QuickPatchThreadsFilter;
@@ -1442,4 +1443,30 @@ public abstract class SolrTestCaseJ4 ext
}
return result;
}
+
+ public void assertXmlFile(final File file, String... xpath)
+ throws IOException, SAXException {
+
+ try {
+ String xml = FileUtils.readFileToString(file, "UTF-8");
+ String results = h.validateXPath(xml, xpath);
+ if (null != results) {
+ String msg = "File XPath failure: file=" + file.getPath() + " xpath="
+ + results + "\n\nxml was: " + xml;
+ fail(msg);
+ }
+ } catch (XPathExpressionException e2) {
+ throw new RuntimeException("XPath is invalid", e2);
+ }
+ }
+ // Creates a mininmal conf dir.
+ public void copyMinConf(File dstRoot) throws IOException {
+
+ File subHome = new File(dstRoot, "conf");
+ assertTrue("Failed to make subdirectory ", dstRoot.mkdirs());
+ String top = SolrTestCaseJ4.TEST_HOME() + "/collection1/conf";
+ FileUtils.copyFile(new File(top, "schema-tiny.xml"), new File(subHome, "schema-tiny.xml"));
+ FileUtils.copyFile(new File(top, "solrconfig-minimal.xml"), new File(subHome, "solrconfig-minimal.xml"));
+ }
+
}
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockCharFilterFactory.java Tue May 7 11:20:55 2013
@@ -27,16 +27,15 @@ import org.apache.lucene.analysis.util.C
* Factory for {@link MockCharFilter} for testing purposes.
*/
public class MockCharFilterFactory extends CharFilterFactory {
- int remainder;
+ final int remainder;
- @Override
- public void init(Map<String,String> args) {
- super.init(args);
- String sval = args.get("remainder");
- if (sval == null) {
- throw new IllegalArgumentException("remainder is mandatory");
+ /** Creates a new MockCharFilterFactory */
+ public MockCharFilterFactory(Map<String,String> args) {
+ super(args);
+ remainder = requireInt(args, "remainder");
+ if (!args.isEmpty()) {
+ throw new IllegalArgumentException("Unknown parameters: " + args);
}
- remainder = Integer.parseInt(sval);
}
@Override
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockTokenizerFactory.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockTokenizerFactory.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/MockTokenizerFactory.java Tue May 7 11:20:55 2013
@@ -18,6 +18,7 @@ package org.apache.solr.analysis;
*/
import java.io.Reader;
+import java.util.Arrays;
import java.util.Map;
import org.apache.lucene.analysis.MockTokenizer;
@@ -29,28 +30,25 @@ import org.apache.lucene.util.automaton.
* Factory for {@link MockTokenizer} for testing purposes.
*/
public class MockTokenizerFactory extends TokenizerFactory {
- CharacterRunAutomaton pattern;
- boolean enableChecks;
+ final CharacterRunAutomaton pattern;
+ final boolean enableChecks;
- @Override
- public void init(Map<String,String> args) {
- super.init(args);
- String patternArg = args.get("pattern");
- if (patternArg == null) {
- patternArg = "whitespace";
- }
-
- if ("whitespace".equalsIgnoreCase(patternArg)) {
- pattern = MockTokenizer.WHITESPACE;
- } else if ("keyword".equalsIgnoreCase(patternArg)) {
+ /** Creates a new MockTokenizerFactory */
+ public MockTokenizerFactory(Map<String,String> args) {
+ super(args);
+ String patternArg = get(args, "pattern", Arrays.asList("keyword", "simple", "whitespace"));
+ if ("keyword".equalsIgnoreCase(patternArg)) {
pattern = MockTokenizer.KEYWORD;
} else if ("simple".equalsIgnoreCase(patternArg)) {
pattern = MockTokenizer.SIMPLE;
} else {
- throw new RuntimeException("invalid pattern!");
+ pattern = MockTokenizer.WHITESPACE;
}
- enableChecks = getBoolean("enableChecks", true);
+ enableChecks = getBoolean(args, "enableChecks", true);
+ if (!args.isEmpty()) {
+ throw new IllegalArgumentException("Unknown parameters: " + args);
+ }
}
@Override
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/StringMockSolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/StringMockSolrResourceLoader.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/StringMockSolrResourceLoader.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/analysis/StringMockSolrResourceLoader.java Tue May 7 11:20:55 2013
@@ -20,8 +20,6 @@ package org.apache.solr.analysis;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Arrays;
-import java.util.List;
import org.apache.lucene.analysis.util.ResourceLoader;
@@ -33,8 +31,22 @@ class StringMockSolrResourceLoader imple
}
@Override
+ public <T> Class<? extends T> findClass(String cname, Class<T> expectedType) {
+ try {
+ return Class.forName(cname).asSubclass(expectedType);
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot load class: " + cname, e);
+ }
+ }
+
+ @Override
public <T> T newInstance(String cname, Class<T> expectedType) {
- return null;
+ Class<? extends T> clazz = findClass(cname, expectedType);
+ try {
+ return clazz.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot create instance: " + cname, e);
+ }
}
@Override
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java Tue May 7 11:20:55 2013
@@ -108,7 +108,9 @@ abstract public class RestTestBase exten
query = request.substring(queryStartPos + 1);
path = request.substring(0, queryStartPos);
}
- query = setParam(query, "wt", "xml");
+ if ( ! query.matches(".*wt=schema\\.xml.*")) { // don't overwrite wt=schema.xml
+ query = setParam(query, "wt", "xml");
+ }
request = path + '?' + setParam(query, "indent", "on");
String response = restTestHarness.query(request);
@@ -227,7 +229,170 @@ abstract public class RestTestBase exten
for (String test : tests) {
if (null == test || 0 == test.length()) continue;
- String testJSON = test.replace('\'', '"');
+ String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
+ testJSON = testJSON.replaceAll("\\\\\'", "'");
+
+ try {
+ failed = true;
+ String err = JSONTestUtil.match(response, testJSON, delta);
+ failed = false;
+ if (err != null) {
+ log.error("query failed JSON validation. error=" + err +
+ "\n expected =" + testJSON +
+ "\n response = " + response +
+ "\n request = " + request + "\n"
+ );
+ throw new RuntimeException(err);
+ }
+ } finally {
+ if (failed) {
+ log.error("JSON query validation threw an exception." +
+ "\n expected =" + testJSON +
+ "\n response = " + response +
+ "\n request = " + request + "\n"
+ );
+ }
+ }
+ }
+ }
+
+
+
+ /**
+ * Validates the response from a PUT request matches some JSON test expressions
+ *
+ * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA
+ * @see #assertJQ(String,double,String...)
+ */
+ public static void assertJPut(String request, String content, String... tests) throws Exception {
+ assertJPut(request, content, JSONTestUtil.DEFAULT_DELTA, tests);
+ }
+
+
+ /**
+ * Validates the response from a PUT request matches some JSON test expressions
+ * and closes the query. The text expression is of the form path==JSON.
+ * To facilitate easy embedding in Java strings, the JSON can have double
+ * quotes replaced with single quotes.
+ * <p>
+ * Please use this with care: this makes it easy to match complete
+ * structures, but doing so can result in fragile tests if you are
+ * matching more than what you want to test.
+ * </p>
+ * @param request a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"
+ * @param content The content to include with the PUT request
+ * @param delta tolerance allowed in comparing float/double values
+ * @param tests JSON path expression + '==' + expected value
+ */
+ public static void assertJPut(String request, String content, double delta, String... tests) throws Exception {
+ int queryStartPos = request.indexOf('?');
+ String query;
+ String path;
+ if (-1 == queryStartPos) {
+ query = "";
+ path = request;
+ } else {
+ query = request.substring(queryStartPos + 1);
+ path = request.substring(0, queryStartPos);
+ }
+ query = setParam(query, "wt", "json");
+ request = path + '?' + setParam(query, "indent", "on");
+
+ String response;
+ boolean failed = true;
+ try {
+ response = restTestHarness.put(request, content);
+ failed = false;
+ } finally {
+ if (failed) {
+ log.error("REQUEST FAILED: " + request);
+ }
+ }
+
+ for (String test : tests) {
+ if (null == test || 0 == test.length()) continue;
+ String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
+ testJSON = testJSON.replaceAll("\\\\\'", "'");
+
+ try {
+ failed = true;
+ String err = JSONTestUtil.match(response, testJSON, delta);
+ failed = false;
+ if (err != null) {
+ log.error("query failed JSON validation. error=" + err +
+ "\n expected =" + testJSON +
+ "\n response = " + response +
+ "\n request = " + request + "\n"
+ );
+ throw new RuntimeException(err);
+ }
+ } finally {
+ if (failed) {
+ log.error("JSON query validation threw an exception." +
+ "\n expected =" + testJSON +
+ "\n response = " + response +
+ "\n request = " + request + "\n"
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * Validates the response from a POST request matches some JSON test expressions
+ *
+ * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA
+ * @see #assertJQ(String,double,String...)
+ */
+ public static void assertJPost(String request, String content, String... tests) throws Exception {
+ assertJPost(request, content, JSONTestUtil.DEFAULT_DELTA, tests);
+ }
+
+
+ /**
+ * Validates the response from a PUT request matches some JSON test expressions
+ * and closes the query. The text expression is of the form path==JSON.
+ * To facilitate easy embedding in Java strings, the JSON can have double
+ * quotes replaced with single quotes.
+ * <p>
+ * Please use this with care: this makes it easy to match complete
+ * structures, but doing so can result in fragile tests if you are
+ * matching more than what you want to test.
+ * </p>
+ * @param request a URL path with optional query params, e.g. "/schema/fields?fl=id,_version_"
+ * @param content The content to include with the PUT request
+ * @param delta tolerance allowed in comparing float/double values
+ * @param tests JSON path expression + '==' + expected value
+ */
+ public static void assertJPost(String request, String content, double delta, String... tests) throws Exception {
+ int queryStartPos = request.indexOf('?');
+ String query;
+ String path;
+ if (-1 == queryStartPos) {
+ query = "";
+ path = request;
+ } else {
+ query = request.substring(queryStartPos + 1);
+ path = request.substring(0, queryStartPos);
+ }
+ query = setParam(query, "wt", "json");
+ request = path + '?' + setParam(query, "indent", "on");
+
+ String response;
+ boolean failed = true;
+ try {
+ response = restTestHarness.post(request, content);
+ failed = false;
+ } finally {
+ if (failed) {
+ log.error("REQUEST FAILED: " + request);
+ }
+ }
+
+ for (String test : tests) {
+ if (null == test || 0 == test.length()) continue;
+ String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
+ testJSON = testJSON.replaceAll("\\\\\'", "'");
try {
failed = true;
@@ -253,6 +418,8 @@ abstract public class RestTestBase exten
}
}
+
+
/**
* Insures that the given param is included in the query with the given value.
*
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java Tue May 7 11:20:55 2013
@@ -17,12 +17,12 @@ package org.apache.solr.util;
*/
import org.apache.commons.io.IOUtils;
-import org.eclipse.jetty.util.IO;
import javax.xml.xpath.XPathExpressionException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.net.HttpURLConnection;
import java.net.URL;
@@ -43,20 +43,37 @@ public class RestTestHarness extends Bas
}
/**
- * Validates a "query" response against an array of XPath test strings
+ * Validates an XML "query" response against an array of XPath test strings
*
* @param request the Query to process
* @return null if all good, otherwise the first test that fails.
* @exception Exception any exception in the response.
* @exception java.io.IOException if there is a problem writing the XML
*/
- public String validateQuery(String request, String... tests)
- throws Exception {
+ public String validateQuery(String request, String... tests) throws Exception {
String res = query(request);
return validateXPath(res, tests);
}
+
+ /**
+ * Validates an XML PUT response against an array of XPath test strings
+ *
+ * @param request the PUT request to process
+ * @param content the content to send with the PUT request
+ * @param tests the validating XPath tests
+ * @return null if all good, otherwise the first test that fails.
+ * @exception Exception any exception in the response.
+ * @exception java.io.IOException if there is a problem writing the XML
+ */
+ public String validatePut(String request, String content, String... tests) throws Exception {
+
+ String res = put(request, content);
+ return validateXPath(res, tests);
+ }
+
+
/**
* Processes a "query" using a URL path (with no context path) + optional query params,
* e.g. "/schema/fields?indent=on"
@@ -84,7 +101,74 @@ public class RestTestHarness extends Bas
return strWriter.toString();
}
- public String checkQueryStatus(String xml, String code) throws Exception {
+ /**
+ * Processes a PUT request using a URL path (with no context path) + optional query params,
+ * e.g. "/schema/fields/newfield", PUTs the given content, and returns the response content.
+ *
+ * @param request The URL path and optional query params
+ * @param content The content to include with the PUT request
+ * @return The response to the PUT request
+ */
+ public String put(String request, String content) throws IOException {
+ URL url = new URL(getBaseURL() + request);
+ HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+ connection.setDoOutput(true);
+ connection.setRequestMethod("PUT");
+ OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+ out.write(content);
+ out.close();
+ InputStream inputStream = null;
+ StringWriter stringWriter;
+ try {
+ try {
+ inputStream = connection.getInputStream();
+ } catch (IOException e) {
+ inputStream = connection.getErrorStream();
+ }
+ stringWriter = new StringWriter();
+ IOUtils.copy(new InputStreamReader(inputStream, "UTF-8"), stringWriter);
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ return stringWriter.toString();
+ }
+
+ /**
+ * Processes a POST request using a URL path (with no context path) + optional query params,
+ * e.g. "/schema/fields/newfield", PUTs the given content, and returns the response content.
+ *
+ * @param request The URL path and optional query params
+ * @param content The content to include with the POST request
+ * @return The response to the PUT request
+ */
+ public String post(String request, String content) throws IOException {
+ URL url = new URL(getBaseURL() + request);
+ HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+ connection.setDoOutput(true);
+ connection.setRequestMethod("POST");
+ connection.setRequestProperty("Content-Type", "application/json; charset=utf-8");
+
+ OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+ out.write(content);
+ out.close();
+ InputStream inputStream = null;
+ StringWriter stringWriter;
+ try {
+ try {
+ inputStream = connection.getInputStream();
+ } catch (IOException e) {
+ inputStream = connection.getErrorStream();
+ }
+ stringWriter = new StringWriter();
+ IOUtils.copy(new InputStreamReader(inputStream, "UTF-8"), stringWriter);
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ return stringWriter.toString();
+ }
+
+
+ public String checkResponseStatus(String xml, String code) throws Exception {
try {
String response = query(xml);
String valid = validateXPath(response, "//int[@name='status']="+code );
@@ -94,9 +178,10 @@ public class RestTestHarness extends Bas
}
}
+
@Override
public void reload() throws Exception {
- String xml = checkQueryStatus("/admin/cores?action=RELOAD", "0");
+ String xml = checkResponseStatus("/admin/cores?action=RELOAD", "0");
if (null != xml) {
throw new RuntimeException("RELOAD failed:\n" + xml);
}
@@ -112,7 +197,7 @@ public class RestTestHarness extends Bas
@Override
public String update(String xml) {
try {
- return query("/update?stream.base=" + URLEncoder.encode(xml, "UTF-8"));
+ return query("/update?stream.body=" + URLEncoder.encode(xml, "UTF-8"));
} catch (Exception e) {
throw new RuntimeException(e);
}
Modified: lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java (original)
+++ lucene/dev/branches/lucene4258/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java Tue May 7 11:20:55 2013
@@ -20,6 +20,8 @@ package org.apache.solr.util;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
+import org.apache.solr.core.Config;
+import org.apache.solr.core.ConfigSolrXmlOld;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.CoreContainer;
@@ -36,15 +38,21 @@ import org.apache.solr.request.SolrReque
import org.apache.solr.response.QueryResponseWriter;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.IndexSchema;
+import org.apache.solr.schema.IndexSchemaFactory;
import org.apache.solr.servlet.DirectSolrConnection;
import org.apache.solr.common.util.NamedList.NamedListEntry;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
+
/**
* This class provides a simple harness that may be useful when
@@ -97,7 +105,7 @@ public class TestHarness extends BaseTes
String dataDirectory,
SolrConfig solrConfig,
String schemaFile) {
- this( coreName, dataDirectory, solrConfig, new IndexSchema(solrConfig, schemaFile, null));
+ this( coreName, dataDirectory, solrConfig, IndexSchemaFactory.buildIndexSchema(schemaFile, solrConfig));
}
/**
* @param coreName to initialize
@@ -119,7 +127,7 @@ public class TestHarness extends BaseTes
public TestHarness( String dataDirectory,
SolrConfig solrConfig,
String schemaFile) {
- this( dataDirectory, solrConfig, new IndexSchema(solrConfig, schemaFile, null));
+ this( dataDirectory, solrConfig, IndexSchemaFactory.buildIndexSchema(schemaFile, solrConfig));
}
/**
* @param dataDirectory path for index data, will not be cleaned up
@@ -170,17 +178,30 @@ public class TestHarness extends BaseTes
}
@Override
public CoreContainer initialize() {
- CoreContainer container = new CoreContainer(new SolrResourceLoader(SolrResourceLoader.locateSolrHome())) {
- {
- hostPort = System.getProperty("hostPort");
- hostContext = "solr";
- defaultCoreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
- initShardHandler();
- initZooKeeper(System.getProperty("zkHost"), 10000);
- }
- };
+ CoreContainer container;
+ try {
+ String solrHome = SolrResourceLoader.locateSolrHome();
+ container = new CoreContainer(new SolrResourceLoader(solrHome)) {
+ {
+ String hostPort = System.getProperty("hostPort");
+ String hostContext = "solr";
+ defaultCoreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
+ initShardHandler();
+ zkSys.initZooKeeper(this, solrHome, System.getProperty("zkHost"), 30000, hostPort, hostContext, null, "30000", 30000, 30000);
+ ByteArrayInputStream is = new ByteArrayInputStream(ConfigSolrXmlOld.DEF_SOLR_XML.getBytes("UTF-8"));
+ Config config = new Config(loader, null, new InputSource(is), null, false);
+ cfg = new ConfigSolrXmlOld(config, this);
+ }
+ };
+ } catch (ParserConfigurationException e) {
+ throw new RuntimeException(e);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } catch (SAXException e) {
+ throw new RuntimeException(e);
+ }
LogWatcher<?> logging = new JulWatcher("test");
- logging.registerListener(new ListenerConfig(), container);
+ logging.registerListener(new ListenerConfig());
container.setLogging(logging);
CoreDescriptor dcore = new CoreDescriptor(container, coreName, solrConfig.getResourceLoader().getInstanceDir());
Modified: lucene/dev/branches/lucene4258/solr/webapp/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/build.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/build.xml (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/build.xml Tue May 7 11:20:55 2013
@@ -20,7 +20,7 @@
<import file="../common-build.xml"/>
- <property name="exclude.from.war" value="" />
+ <property name="exclude.from.war" value="*slf4j*,log4j-*" />
<property name="solr.war.suffix" value="" />
<target name="test" depends="compile-test-solr-core">
@@ -42,7 +42,7 @@
depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr">
<build-manifest title="Apache Solr Search Server"
implementation.title="org.apache.solr"
- spec.version="${solr.spec.version}"/>
+ spec.version="${spec.version}"/>
<ant dir="${common-solr.dir}" inheritall="false" target="contribs-add-to-war"/>
<war destfile="${dist}/solr-${version}${solr.war.suffix}.war"
webxml="web/WEB-INF/web.xml"
@@ -50,6 +50,8 @@
<lib dir="${common-solr.dir}/core/lib" excludes="${exclude.from.war},${common.classpath.excludes}">
<exclude name="*servlet-api*.jar" />
<exclude name="easymock-*.jar" />
+ <exclude name="cglib-nodep-*.jar" />
+ <exclude name="objenesis-*.jar" />
</lib>
<lib dir="${common-solr.dir}/solrj/lib" excludes="${exclude.from.war},${common.classpath.excludes}"/>
<lib dir="${lucene-libs}" excludes="${exclude.from.war},${common.classpath.excludes}" />
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/WEB-INF/web.xml?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/WEB-INF/web.xml (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/WEB-INF/web.xml Tue May 7 11:20:55 2013
@@ -127,11 +127,11 @@
</servlet>
<servlet>
- <servlet-name>SchemaRestApi</servlet-name>
+ <servlet-name>SolrRestApi</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
<init-param>
<param-name>org.restlet.application</param-name>
- <param-value>org.apache.solr.rest.SchemaRestApi</param-value>
+ <param-value>org.apache.solr.rest.SolrRestApi</param-value>
</init-param>
</servlet>
@@ -164,7 +164,7 @@
</servlet-mapping>
<servlet-mapping>
- <servlet-name>SchemaRestApi</servlet-name>
+ <servlet-name>SolrRestApi</servlet-name>
<url-pattern>/schema/*</url-pattern>
</servlet-mapping>
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/logging.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/logging.css?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/logging.css (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/logging.css Tue May 7 11:20:55 2013
@@ -84,8 +84,13 @@
}
#content #logging #viewer tbody .level-info .level span { background-color: #ebf5eb; }
-#content #logging #viewer tbody .level-warning span { background-color: #d5dd00; }
-#content #logging #viewer tbody .level-severe span { background-color: #c43c35; color: #fff; }
+#content #logging #viewer tbody .level-warning span { background-color: #FFD930; }
+#content #logging #viewer tbody .level-severe span { background-color: #c43c35; color: #fff; }
+
+#content #logging #viewer tbody .level-debug span { background-color: #ebf5eb; }
+#content #logging #viewer tbody .level-warn span { background-color: #FFD930; }
+#content #logging #viewer tbody .level-error span { background-color: #FF6130; }
+#content #logging #viewer tbody .level-fatal span { background-color: #c43c35; }
#content #logging #viewer tbody .has-trace a
{
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/replication.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/replication.css?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/replication.css (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/css/styles/replication.css Tue May 7 11:20:55 2013
@@ -283,6 +283,7 @@
#content #replication #details table
{
+ margin-left: 20px;
border-collapse: collapse;
}
@@ -339,6 +340,7 @@
{
padding-right: 10px;
text-align: right;
+ white-space: nowrap;
}
#content #replication #details table tbody .size
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/dashboard.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/dashboard.js?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/dashboard.js (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/dashboard.js Tue May 7 11:20:55 2013
@@ -48,27 +48,26 @@ sammy.get
content_element
.removeClass( 'single' );
- var core_menu = this.active_core.closest( 'ul' );
- if( !core_menu.data( 'admin-extra-loaded' ) )
+ if( !app.core_menu.data( 'admin-extra-loaded' ) )
{
- core_menu.data( 'admin-extra-loaded', new Date() );
+ app.core_menu.data( 'admin-extra-loaded', new Date() );
$.get
(
- core_basepath + '/admin/file/?file=admin-extra.menu-top.html',
+ core_basepath + '/admin/file/?file=admin-extra.menu-top.html&contentType=text/html;charset=utf-8',
function( menu_extra )
{
- core_menu
+ app.core_menu
.prepend( menu_extra );
}
);
-
+
$.get
(
- core_basepath + '/admin/file/?file=admin-extra.menu-bottom.html',
+ core_basepath + '/admin/file/?file=admin-extra.menu-bottom.html&contentType=text/html;charset=utf-8',
function( menu_extra )
{
- core_menu
+ app.core_menu
.append( menu_extra );
}
);
@@ -257,7 +256,8 @@ sammy.get
var is_slave = 'undefined' !== typeof( data.slave );
var headline = $( 'h2 span', this );
var details_element = $( '#details', this );
- var current_type_element = $( ( is_slave ? '.slave' : '.master' ), this );
+ var current_type_element = $( ( is_slave ? '.slave' : '.masterSearch' ), this );
+ var master_data = is_slave ? data.slave.masterDetails : data;
if( is_slave )
{
@@ -276,6 +276,7 @@ sammy.get
.html( headline.html() + ' (Master)' );
}
+ // the currently searchable commit regardless of type
$( '.version div', current_type_element )
.html( data.indexVersion );
$( '.generation div', current_type_element )
@@ -283,9 +284,18 @@ sammy.get
$( '.size div', current_type_element )
.html( data.indexSize );
+ // what's replicable on the master
+ var master_element = $( '.master', details_element );
+ $( '.version div', master_element )
+ .html( master_data.master.replicableVersion || '-' );
+ $( '.generation div', master_element )
+ .html( master_data.master.replicableGeneration || '-' );
+ $( '.size div', master_element )
+ .html( "-" );
+
if( is_slave )
{
- var master_element = $( '.master', details_element );
+ var master_element = $( '.masterSearch', details_element );
$( '.version div', master_element )
.html( data.slave.masterDetails.indexVersion );
$( '.generation div', master_element )
@@ -293,7 +303,8 @@ sammy.get
$( '.size div', master_element )
.html( data.slave.masterDetails.indexSize );
- if( data.indexVersion !== data.slave.masterDetails.indexVersion )
+ // warnings if slave version|gen doesn't match what's replicable
+ if( data.indexVersion !== master_data.master.replicableVersion )
{
$( '.version', details_element )
.addClass( 'diff' );
@@ -304,7 +315,7 @@ sammy.get
.removeClass( 'diff' );
}
- if( data.generation !== data.slave.masterDetails.generation )
+ if( data.generation !== master_data.master.replicableGeneration )
{
$( '.generation', details_element )
.addClass( 'diff' );
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/replication.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/replication.js?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/replication.js (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/js/scripts/replication.js Tue May 7 11:20:55 2013
@@ -246,26 +246,39 @@ var replication_fetch_status = function(
}
var details_element = $( '#details', replication_element );
- var current_type_element = $( ( is_slave ? '.slave' : '.master' ), details_element );
+ var current_type_element = $( ( is_slave ? '.slave' : '.masterSearch' ), details_element );
+ var master_data = is_slave ? data.slave.masterDetails : data;
+ // the currently searchable commit regardless of type
$( '.version div', current_type_element )
.html( data.indexVersion );
$( '.generation div', current_type_element )
.html( data.generation );
$( '.size div', current_type_element )
.html( data.indexSize );
+
+ // what's replicable on the master
+ var master_element = $( '.master', details_element );
+ $( '.version div', master_element )
+ .html( master_data.master.replicableVersion || '-' );
+ $( '.generation div', master_element )
+ .html( master_data.master.replicableGeneration || '-' );
+ $( '.size div', master_element )
+ .html( "-" );
if( is_slave )
{
- var master_element = $( '.master', details_element );
- $( '.version div', master_element )
- .html( data.slave.masterDetails.indexVersion );
- $( '.generation div', master_element )
- .html( data.slave.masterDetails.generation );
- $( '.size div', master_element )
- .html( data.slave.masterDetails.indexSize );
-
- if( data.indexVersion !== data.slave.masterDetails.indexVersion )
+ // what's searchable on the master
+ var master_searchable = $( '.masterSearch', details_element );
+ $( '.version div', master_searchable )
+ .html( master_data.indexVersion );
+ $( '.generation div', master_searchable )
+ .html( master_data.generation );
+ $( '.size div', master_searchable )
+ .html( master_data.indexSize );
+
+ // warnings if slave version|gen doesn't match what's replicable
+ if( data.indexVersion !== master_data.master.replicableVersion )
{
$( '.version', details_element )
.addClass( 'diff' );
@@ -276,7 +289,7 @@ var replication_fetch_status = function(
.removeClass( 'diff' );
}
- if( data.generation !== data.slave.masterDetails.generation )
+ if( data.generation !== master_data.master.replicableGeneration )
{
$( '.generation', details_element )
.addClass( 'diff' );
@@ -511,4 +524,4 @@ sammy.get
}
);
}
-);
\ No newline at end of file
+);
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/tpl/dashboard.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/tpl/dashboard.html?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/tpl/dashboard.html (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/tpl/dashboard.html Tue May 7 11:20:55 2013
@@ -103,9 +103,18 @@ limitations under the License.
</thead>
<tbody>
+ <tr class="masterSearch">
+
+ <th>Master (Searching)</th>
+ <td class="version"><div>x</div></td>
+ <td class="generation"><div>y</div></td>
+ <td class="size"><div>z</div></td>
+
+ </tr>
+
<tr class="master">
- <th>Master:</th>
+ <th>Master (Replicable)</th>
<td class="version"><div>x</div></td>
<td class="generation"><div>y</div></td>
<td class="size"><div>z</div></td>
@@ -114,7 +123,7 @@ limitations under the License.
<tr class="slave slaveOnly">
- <th>Slave:</th>
+ <th>Slave (Searching)</th>
<td class="version"><div>a</div></td>
<td class="generation"><div>c</div></td>
<td class="size"><div>c</div></td>
Modified: lucene/dev/branches/lucene4258/solr/webapp/web/tpl/replication.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/webapp/web/tpl/replication.html?rev=1479862&r1=1479861&r2=1479862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/webapp/web/tpl/replication.html (original)
+++ lucene/dev/branches/lucene4258/solr/webapp/web/tpl/replication.html Tue May 7 11:20:55 2013
@@ -116,9 +116,18 @@ limitations under the License.
</thead>
<tbody>
+ <tr class="masterSearch">
+
+ <th>Master (Searching)</th>
+ <td class="version"><div></div></td>
+ <td class="generation"><div></div></td>
+ <td class="size"><div></div></td>
+
+ </tr>
+
<tr class="master">
- <th>Master:</th>
+ <th>Master (Replicable)</th>
<td class="version"><div></div></td>
<td class="generation"><div></div></td>
<td class="size"><div></div></td>
@@ -127,7 +136,7 @@ limitations under the License.
<tr class="slave slaveOnly">
- <th>Slave:</th>
+ <th>Slave (Searching)</th>
<td class="version"><div></div></td>
<td class="generation"><div></div></td>
<td class="size"><div></div></td>
@@ -204,4 +213,4 @@ limitations under the License.
</div>
-</div>
\ No newline at end of file
+</div>