org.apache.solr.cloud
Class AbstractFullDistribZkTestBase
java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.apache.solr.SolrTestCaseJ4
org.apache.solr.BaseDistributedSearchTestCase
org.apache.solr.cloud.AbstractDistribZkTestBase
org.apache.solr.cloud.AbstractFullDistribZkTestBase
@LuceneTestCase.Slow
public abstract class AbstractFullDistribZkTestBase
- extends AbstractDistribZkTestBase
TODO: we should still test this works as a custom update chain as well as
what we test now - the default update chain
Nested classes/interfaces inherited from class org.apache.lucene.util.LuceneTestCase |
org.apache.lucene.util.LuceneTestCase.AwaitsFix, org.apache.lucene.util.LuceneTestCase.BadApple, org.apache.lucene.util.LuceneTestCase.Nightly, org.apache.lucene.util.LuceneTestCase.Slow, org.apache.lucene.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.util.LuceneTestCase.Weekly |
Fields inherited from class org.apache.solr.BaseDistributedSearchTestCase |
clients, context, controlClient, controlJetty, deadServers, fieldNames, fixShardCount, flags, handle, id, jettys, nThreads, ORDERED, r, randVals, rdate, rdouble, rfloat, rint, rlong, shardCount, shards, shardsArr, SKIP, SKIPVAL, stress, testDir, UNORDERED, useExplicitNodeNames, verifyStress |
Fields inherited from class org.apache.solr.SolrTestCaseJ4 |
configString, dataDir, DEFAULT_CONNECTION_TIMEOUT, formatter, h, lrf, ONE_ONE, schemaString, solrClassRules, solrConfig, solrTestRules, testSolrHome, ZERO_ONE, ZERO_TWO |
Fields inherited from class org.apache.lucene.util.LuceneTestCase |
classRules, DEFAULT_LINE_DOCS_FILE, doesntSupportOffsets, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, PREFLEX_IMPERSONATION_IS_ACTIVE, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_NIGHTLY, SYSPROP_SLOW, SYSPROP_WEEKLY, TEMP_DIR, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_SLOW, TEST_THROTTLING, TEST_VERSION_CURRENT, TEST_WEEKLY, VERBOSE |
Method Summary |
static void |
afterClass()
|
protected void |
assertDocCounts(boolean verbose)
|
static void |
beforeClass()
|
static void |
beforeFullSolrCloudTest()
|
protected void |
checkForCollection(String collectionName,
List<Integer> numShardsNumReplicaList,
List<String> nodesAllowedToRunShards)
|
protected void |
checkQueries()
|
protected void |
checkShardConsistency()
|
protected void |
checkShardConsistency(boolean checkVsControl,
boolean verbose)
|
protected void |
checkShardConsistency(String shard)
|
protected String |
checkShardConsistency(String shard,
boolean expectFailure,
boolean verbose)
|
protected void |
commit()
|
protected org.apache.solr.client.solrj.impl.CloudSolrServer |
createCloudClient(String defaultCollection)
|
protected void |
createCollection(Map<String,List<Integer>> collectionInfos,
String collectionName,
int numShards,
int numReplicas,
int maxShardsPerNode,
org.apache.solr.client.solrj.SolrServer client,
String createNodeSetStr)
|
protected void |
createCollection(String collectionName,
int numShards,
int numReplicas,
int maxShardsPerNode)
|
protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> |
createJettys(int numJettys)
|
protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> |
createJettys(int numJettys,
boolean checkCreatedVsState)
|
protected org.apache.solr.client.solrj.SolrServer |
createNewSolrServer(int port)
|
protected org.apache.solr.client.solrj.SolrServer |
createNewSolrServer(String collection,
String baseUrl)
|
protected void |
createServers(int numServers)
|
protected void |
del(String q)
|
protected void |
destroyServers()
|
protected String |
getBaseUrl(org.apache.solr.client.solrj.impl.HttpSolrServer client)
|
protected org.apache.solr.client.solrj.SolrServer |
getClient(String nodeName)
|
protected org.apache.solr.client.solrj.impl.CloudSolrServer |
getCommonCloudSolrServer()
|
protected org.apache.solr.common.SolrInputDocument |
getDoc(Object... fields)
|
protected int |
getTotalReplicas(String collection)
|
protected void |
index_specific(int serverNumber,
Object... fields)
|
protected void |
index_specific(org.apache.solr.client.solrj.SolrServer client,
Object... fields)
|
protected void |
indexAbunchOfDocs()
|
protected void |
indexDoc(org.apache.solr.common.SolrInputDocument doc)
|
protected void |
initCloud()
|
protected org.apache.solr.client.solrj.response.QueryResponse |
queryServer(org.apache.solr.common.params.ModifiableSolrParams params)
|
protected void |
setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)
|
void |
setUp()
|
protected org.apache.solr.client.solrj.SolrServer |
startCloudJetty(String collection,
String shard)
|
void |
tearDown()
|
protected void |
updateMappingsFromZk(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys,
List<org.apache.solr.client.solrj.SolrServer> clients)
|
protected void |
waitForCollection(org.apache.solr.common.cloud.ZkStateReader reader,
String collection,
int slices)
|
protected void |
waitForRecoveriesToFinish(boolean verbose)
|
protected void |
waitForRecoveriesToFinish(boolean verbose,
int timeoutSeconds)
|
protected void |
waitForRecoveriesToFinish(String collection,
boolean verbose)
|
void |
waitForThingsToLevelOut(int waitForRecTimeSeconds)
|
Methods inherited from class org.apache.solr.BaseDistributedSearchTestCase |
add, addFields, addRandFields, clearHostContext, compare, compare, compare, compare, compare, compare, compare1, compareResponses, createJetty, createJetty, createJetty, createJetty, del, delQ, doTest, eq, flags, getFieldNames, getRandFields, getRandValues, getShardsString, getSolrHome, getSolrXml, index, indexr, initHostContext, initialize, query, query, queryAndCompare, setupJettySolrHome, testDistribSearch, validateControlData |
Methods inherited from class org.apache.solr.SolrTestCaseJ4 |
add, addAndGetVersion, adoc, adoc, assertFailedU, assertFailedU, assertJQ, assertJQ, assertQ, assertQ, assertQEx, assertQEx, assertU, assertU, clearIndex, commit, createComparator, createComparator, createCore, createDoc, createSort, createTempDir, deleteAndGetVersion, deleteByQueryAndGetVersion, deleteCore, delI, delQ, doc, endTrackingSearchers, endTrackingZkClients, getClassName, getFile, getRootCause, getSchemaFile, getSimpleClassName, getSolrConfigFile, ignoreException, indexDocs, initCore, initCore, initCore, initCore, JQ, json, jsonAdd, jsonDelId, jsonDelQ, map, optimize, params, postSetUp, preTearDown, recurseDelete, req, req, req, resetExceptionIgnores, resetFactory, sdoc, setLoggingLevel, setupLogging, startTrackingSearchers, startTrackingZkClients, TEST_HOME, toJSON, unIgnoreException, updateJ, useFactory |
Methods inherited from class org.apache.lucene.util.LuceneTestCase |
assertSaneFieldCaches, asSet, assumeFalse, assumeNoException, assumeTrue, atLeast, atLeast, closeAfterSuite, closeAfterTest, defaultCodecSupportsDocValues, defaultCodecSupportsSortedSet, dumpArray, dumpIterator, getDataFile, getOnlySegmentReader, getTestClass, getTestName, isTestThread, localeForName, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMockDirectory, newMockDirectory, newMockFSDirectory, newSearcher, newSearcher, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, random, randomLocale, randomTimeZone, rarely, rarely, usually, usually |
Methods inherited from class org.junit.Assert |
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHARD1
public static final String SHARD1
- See Also:
- Constant Field Values
SHARD2
public static final String SHARD2
- See Also:
- Constant Field Values
printLayoutOnTearDown
protected boolean printLayoutOnTearDown
sliceCount
protected int sliceCount
controlClientCloud
protected org.apache.solr.client.solrj.impl.CloudSolrServer controlClientCloud
cloudClient
protected volatile org.apache.solr.client.solrj.impl.CloudSolrServer cloudClient
cloudJettys
protected List<AbstractFullDistribZkTestBase.CloudJettyRunner> cloudJettys
shardToJetty
protected Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>> shardToJetty
chaosMonkey
protected ChaosMonkey chaosMonkey
shardToLeaderJetty
protected Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner> shardToLeaderJetty
checkCreatedVsState
protected boolean checkCreatedVsState
AbstractFullDistribZkTestBase
public AbstractFullDistribZkTestBase()
beforeFullSolrCloudTest
public static void beforeFullSolrCloudTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class AbstractDistribZkTestBase
- Throws:
Exception
beforeClass
public static void beforeClass()
afterClass
public static void afterClass()
initCloud
protected void initCloud()
throws Exception
- Throws:
Exception
createCloudClient
protected org.apache.solr.client.solrj.impl.CloudSolrServer createCloudClient(String defaultCollection)
throws MalformedURLException
- Throws:
MalformedURLException
createServers
protected void createServers(int numServers)
throws Exception
- Overrides:
createServers
in class AbstractDistribZkTestBase
- Throws:
Exception
waitForCollection
protected void waitForCollection(org.apache.solr.common.cloud.ZkStateReader reader,
String collection,
int slices)
throws Exception
- Throws:
Exception
createJettys
protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> createJettys(int numJettys)
throws Exception
- Throws:
Exception
createJettys
protected List<org.apache.solr.client.solrj.embedded.JettySolrRunner> createJettys(int numJettys,
boolean checkCreatedVsState)
throws Exception
- Parameters:
checkCreatedVsState
- if true, make sure the number created (numJettys) matches the
number in the cluster state - if you add more jetties this may not
be the case
- Throws:
Exception
startCloudJetty
protected org.apache.solr.client.solrj.SolrServer startCloudJetty(String collection,
String shard)
throws Exception
- Throws:
Exception
getTotalReplicas
protected int getTotalReplicas(String collection)
updateMappingsFromZk
protected void updateMappingsFromZk(List<org.apache.solr.client.solrj.embedded.JettySolrRunner> jettys,
List<org.apache.solr.client.solrj.SolrServer> clients)
throws Exception
- Throws:
Exception
setDistributedParams
protected void setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)
- Overrides:
setDistributedParams
in class BaseDistributedSearchTestCase
indexDoc
protected void indexDoc(org.apache.solr.common.SolrInputDocument doc)
throws IOException,
org.apache.solr.client.solrj.SolrServerException
- Overrides:
indexDoc
in class BaseDistributedSearchTestCase
- Throws:
IOException
org.apache.solr.client.solrj.SolrServerException
index_specific
protected void index_specific(int serverNumber,
Object... fields)
throws Exception
- Overrides:
index_specific
in class BaseDistributedSearchTestCase
- Throws:
Exception
index_specific
protected void index_specific(org.apache.solr.client.solrj.SolrServer client,
Object... fields)
throws Exception
- Throws:
Exception
del
protected void del(String q)
throws Exception
- Overrides:
del
in class BaseDistributedSearchTestCase
- Throws:
Exception
waitForRecoveriesToFinish
protected void waitForRecoveriesToFinish(boolean verbose)
throws Exception
- Throws:
Exception
waitForRecoveriesToFinish
protected void waitForRecoveriesToFinish(String collection,
boolean verbose)
throws Exception
- Throws:
Exception
waitForRecoveriesToFinish
protected void waitForRecoveriesToFinish(boolean verbose,
int timeoutSeconds)
throws Exception
- Throws:
Exception
checkQueries
protected void checkQueries()
throws Exception
- Throws:
Exception
indexAbunchOfDocs
protected void indexAbunchOfDocs()
throws Exception
- Throws:
Exception
checkShardConsistency
protected void checkShardConsistency(String shard)
throws Exception
- Throws:
Exception
checkShardConsistency
protected String checkShardConsistency(String shard,
boolean expectFailure,
boolean verbose)
throws Exception
- Throws:
Exception
checkShardConsistency
protected void checkShardConsistency()
throws Exception
- Throws:
Exception
checkShardConsistency
protected void checkShardConsistency(boolean checkVsControl,
boolean verbose)
throws Exception
- Throws:
Exception
getClient
protected org.apache.solr.client.solrj.SolrServer getClient(String nodeName)
assertDocCounts
protected void assertDocCounts(boolean verbose)
throws Exception
- Throws:
Exception
queryServer
protected org.apache.solr.client.solrj.response.QueryResponse queryServer(org.apache.solr.common.params.ModifiableSolrParams params)
throws org.apache.solr.client.solrj.SolrServerException
- Overrides:
queryServer
in class BaseDistributedSearchTestCase
- Throws:
org.apache.solr.client.solrj.SolrServerException
waitForThingsToLevelOut
public void waitForThingsToLevelOut(int waitForRecTimeSeconds)
throws Exception
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Overrides:
tearDown
in class AbstractDistribZkTestBase
- Throws:
Exception
commit
protected void commit()
throws Exception
- Overrides:
commit
in class BaseDistributedSearchTestCase
- Throws:
Exception
destroyServers
protected void destroyServers()
throws Exception
- Overrides:
destroyServers
in class BaseDistributedSearchTestCase
- Throws:
Exception
createCollection
protected void createCollection(String collectionName,
int numShards,
int numReplicas,
int maxShardsPerNode)
throws org.apache.solr.client.solrj.SolrServerException,
IOException
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
createCollection
protected void createCollection(Map<String,List<Integer>> collectionInfos,
String collectionName,
int numShards,
int numReplicas,
int maxShardsPerNode,
org.apache.solr.client.solrj.SolrServer client,
String createNodeSetStr)
throws org.apache.solr.client.solrj.SolrServerException,
IOException
- Throws:
org.apache.solr.client.solrj.SolrServerException
IOException
createNewSolrServer
protected org.apache.solr.client.solrj.SolrServer createNewSolrServer(int port)
- Overrides:
createNewSolrServer
in class BaseDistributedSearchTestCase
createNewSolrServer
protected org.apache.solr.client.solrj.SolrServer createNewSolrServer(String collection,
String baseUrl)
getBaseUrl
protected String getBaseUrl(org.apache.solr.client.solrj.impl.HttpSolrServer client)
getDoc
protected org.apache.solr.common.SolrInputDocument getDoc(Object... fields)
throws Exception
- Throws:
Exception
checkForCollection
protected void checkForCollection(String collectionName,
List<Integer> numShardsNumReplicaList,
List<String> nodesAllowedToRunShards)
throws Exception
- Throws:
Exception
getCommonCloudSolrServer
protected org.apache.solr.client.solrj.impl.CloudSolrServer getCommonCloudSolrServer()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.