Package org.apache.solr.cloud
Class AbstractFullDistribZkTestBase
- java.lang.Object
-
- org.junit.Assert
-
- org.apache.lucene.tests.util.LuceneTestCase
-
- org.apache.solr.SolrTestCase
-
- org.apache.solr.SolrTestCaseJ4
-
- org.apache.solr.BaseDistributedSearchTestCase
-
- org.apache.solr.cloud.AbstractDistribZkTestBase
-
- org.apache.solr.cloud.AbstractFullDistribZkTestBase
-
- Direct Known Subclasses:
AbstractBasicDistributedZk2TestBase,AbstractBasicDistributedZkTestBase,AbstractChaosMonkeyNothingIsSafeTestBase,AbstractChaosMonkeySafeLeaderTestBase,AbstractRestartWhileUpdatingTestBase,AbstractSyncSliceTestBase,AbstractTlogReplayBufferedWhileIndexingTestBase,AbstractUnloadDistributedZkTestBase
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 Class Summary
Nested Classes Modifier and Type Class Description static classAbstractFullDistribZkTestBase.CloudJettyRunnerstatic classAbstractFullDistribZkTestBase.CloudSolrServerClient-
Nested classes/interfaces inherited from class org.apache.solr.BaseDistributedSearchTestCase
BaseDistributedSearchTestCase.RandDate, BaseDistributedSearchTestCase.RandVal, BaseDistributedSearchTestCase.ShardsFixed, BaseDistributedSearchTestCase.ShardsRepeat, BaseDistributedSearchTestCase.ShardsRepeatRule
-
Nested classes/interfaces inherited from class org.apache.solr.SolrTestCaseJ4
SolrTestCaseJ4.BVal, SolrTestCaseJ4.Doc, SolrTestCaseJ4.Fld, SolrTestCaseJ4.FldType, SolrTestCaseJ4.FVal, SolrTestCaseJ4.IRange, SolrTestCaseJ4.IVals, SolrTestCaseJ4.IValsPercent, SolrTestCaseJ4.RandomizingCloudHttp2SolrClientBuilder, SolrTestCaseJ4.RandomizingCloudSolrClientBuilder, SolrTestCaseJ4.SuppressPointFields, SolrTestCaseJ4.SuppressSSL, SolrTestCaseJ4.SVal, SolrTestCaseJ4.Vals, SolrTestCaseJ4.XmlDoc
-
Nested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.BadApple, org.apache.lucene.tests.util.LuceneTestCase.Monster, org.apache.lucene.tests.util.LuceneTestCase.Nightly, org.apache.lucene.tests.util.LuceneTestCase.SuppressCodecs, org.apache.lucene.tests.util.LuceneTestCase.SuppressFileSystems, org.apache.lucene.tests.util.LuceneTestCase.SuppressFsync, org.apache.lucene.tests.util.LuceneTestCase.SuppressReproduceLine, org.apache.lucene.tests.util.LuceneTestCase.SuppressSysoutChecks, org.apache.lucene.tests.util.LuceneTestCase.SuppressTempFileChecks, org.apache.lucene.tests.util.LuceneTestCase.ThrowingConsumer<T extends Object>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly
-
-
Field Summary
Fields Modifier and Type Field Description protected ChaosMonkeychaosMonkeyprotected org.apache.solr.client.solrj.impl.CloudSolrClientcloudClientprotected List<AbstractFullDistribZkTestBase.CloudJettyRunner>cloudJettysprotected org.apache.solr.client.solrj.impl.CloudSolrClientcontrolClientCloudprotected List<org.apache.solr.client.solrj.SolrClient>coreClientsprotected booleanprintLayoutOnTearDownstatic StringSHARD1static StringSHARD2protected Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>>shardToJettyprotected Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner>shardToLeaderJettyprotected intsliceCountprotected Map<String,org.apache.solr.client.solrj.impl.CloudSolrClient>solrClientByCollectionprotected booleanuseJettyDataDir-
Fields inherited from class org.apache.solr.cloud.AbstractDistribZkTestBase
DEFAULT_COLLECTION, zkServer
-
Fields inherited from class org.apache.solr.BaseDistributedSearchTestCase
clients, context, controlClient, controlJetty, deadServers, executor, fieldNames, flags, FUZZY, handle, id, jettys, nThreads, ORDERED, r, randVals, rdate, rdouble, repeatRule, rfloat, rint, rlong, shards, shardsArr, SKIP, SKIPVAL, stress, testDir, UNORDERED, useExplicitNodeNames, verifyStress
-
Fields inherited from class org.apache.solr.SolrTestCaseJ4
configString, CORE_PROPERTIES_FILENAME, coreName, DEAD_HOST_1, DEAD_HOST_2, DEAD_HOST_3, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_TEST_COLLECTION_NAME, DEFAULT_TEST_CORENAME, h, hdfsDataDir, initCoreDataDir, lrf, NUMERIC_DOCVALUES_SYSPROP, NUMERIC_POINTS_SYSPROP, ONE_ONE, RANDOMIZED_NUMERIC_FIELDTYPES, schemaString, solrConfig, solrTestRules, sslConfig, SYSTEM_PROPERTY_SOLR_TESTS_MERGEPOLICYFACTORY, TEST_URL_ALLOW_LIST, testExecutor, testSolrHome, UPDATELOG_SYSPROP, USE_NUMERIC_POINTS_SYSPROP, ZERO_ONE, ZERO_TWO
-
Fields inherited from class org.apache.solr.SolrTestCase
solrClassRules
-
Fields inherited from class org.apache.lucene.tests.util.LuceneTestCase
assertsAreEnabled, classRules, DEFAULT_LINE_DOCS_FILE, INFOSTREAM, JENKINS_LARGE_LINE_DOCS_FILE, LEAVE_TEMPORARY, MAYBE_CACHE_POLICY, RANDOM_MULTIPLIER, ruleChain, suiteFailureMarker, SYSPROP_AWAITSFIX, SYSPROP_BADAPPLES, SYSPROP_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_BADAPPLES, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE
-
-
Constructor Summary
Constructors Constructor Description AbstractFullDistribZkTestBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidafterClass()protected voidassertDocCounts(boolean verbose)protected static booleanattemptCollectionDelete(org.apache.solr.client.solrj.impl.CloudSolrClient client, String collectionName)Logs a WARN if collection can't be deleted, but does not fail or throw an exceptionstatic voidbeforeClass()static voidbeforeFullSolrCloudTest()voidbeforeTest()protected voidcheckForCollection(String collectionName, List<Integer> numShardsNumReplicaList, List<String> nodesAllowedToRunShards)protected voidcheckQueries()protected voidcheckShardConsistency()protected voidcheckShardConsistency(boolean checkVsControl, boolean verbose)protected voidcheckShardConsistency(boolean checkVsControl, boolean verbose, Set<String> addFails, Set<String> deleteFails)protected voidcheckShardConsistency(String shard)Returns a non-null string if replicas within the same shard do not have a consistent number of documents.protected StringcheckShardConsistency(String shard, boolean expectFailure, boolean verbose)Returns a non-null string if replicas within the same shard do not have a consistent number of documents.protected static voidclearErrorHook()protected voidcloseRestTestHarnesses()protected voidcommit()protected org.apache.solr.client.solrj.impl.CloudSolrClientcreateCloudClient(String defaultCollection)protected org.apache.solr.client.solrj.response.CollectionAdminResponsecreateCollection(String collectionName, String configSetName, int numShards, int replicationFactor)protected voidcreateCollection(String collName, org.apache.solr.client.solrj.impl.CloudSolrClient client, int replicationFactor, int numShards)protected org.apache.solr.client.solrj.response.CollectionAdminResponsecreateCollection(Map<String,List<Integer>> collectionInfos, String collectionName, int numShards, int replicationFactor, org.apache.solr.client.solrj.SolrClient client, String createNodeSetStr, String configName)protected org.apache.solr.client.solrj.response.CollectionAdminResponsecreateCollection(Map<String,List<Integer>> collectionInfos, String collectionName, String configSetName, int numShards, int replicationFactor, org.apache.solr.client.solrj.SolrClient client, String createNodeSetStr)protected org.apache.solr.client.solrj.response.CollectionAdminResponsecreateCollection(Map<String,List<Integer>> collectionInfos, String collectionName, Map<String,Object> collectionProps, org.apache.solr.client.solrj.SolrClient client)protected org.apache.solr.client.solrj.response.CollectionAdminResponsecreateCollection(Map<String,List<Integer>> collectionInfos, String collectionName, Map<String,Object> collectionProps, org.apache.solr.client.solrj.SolrClient client, String confSetName)protected voidcreateCollectionRetry(String testCollectionName, String configSetName, int numShards, int replicationFactor)JettySolrRunnercreateJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride)JettySolrRunnercreateJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, org.apache.solr.common.cloud.Replica.Type replicaType)JettySolrRunnercreateJetty(String dataDir, String ulogDir, String shardList, String solrConfigOverride)protected List<JettySolrRunner>createJettys(int numJettys)protected org.apache.solr.client.solrj.SolrClientcreateNewSolrClient(int port)protected org.apache.solr.client.solrj.SolrClientcreateNewSolrClient(String coreName, int port)protected org.apache.solr.client.solrj.SolrClientcreateNewSolrClient(String collection, String baseUrl)JettySolrRunnercreateProxiedJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, org.apache.solr.common.cloud.Replica.Type replicaType)Creates a JettySolrRunner with a socket proxy sitting in front of the Jetty server, which gives us the ability to simulate network partitions without having to fuss with IPTables.protected voidcreateServers(int numServers)protected voiddel(String q)protected voiddestroyServers()voiddistribSetUp()voiddistribTearDown()protected voidenableAutoSoftCommit(int time)protected List<org.apache.solr.common.cloud.Replica>ensureAllReplicasAreActive(String testCollectionName, String shardId, int shards, int rf, int maxWaitSecs)protected voidforAllRestTestHarnesses(Consumer<RestTestHarness> op)protected StringgetBaseUrl(JettySolrRunner jetty)protected org.apache.solr.client.solrj.SolrClientgetClient(String nodeName)static org.apache.solr.client.solrj.impl.CloudSolrClientgetCloudSolrClient(String zkHost, String defaultCollection, boolean shardLeadersOnly, int connectionTimeoutMillis, int socketTimeoutMillis)This method may randomize unspecified aspects of the resulting SolrClient.protected org.apache.solr.client.solrj.impl.CloudSolrClientgetCommonCloudSolrClient()protected StringgetDataDir(String dataDir)static org.apache.solr.common.SolrInputDocumentgetDoc(Object... fields)protected longgetIndexVersion(org.apache.solr.common.cloud.Replica replica)protected JettySolrRunnergetJettyOnPort(int port)protected org.apache.solr.common.cloud.ZkCoreNodePropsgetLeaderUrlFromZk(String collection, String slice)protected org.apache.solr.client.solrj.cloud.SocketProxygetProxyForReplica(org.apache.solr.common.cloud.Replica replica)protected intgetPullReplicaCount()protected intgetReplicaPort(org.apache.solr.common.cloud.Replica replica)static org.apache.solr.client.solrj.response.RequestStatusStategetRequestStateAfterCompletion(String requestId, int waitForSeconds, org.apache.solr.client.solrj.SolrClient client)protected org.apache.solr.common.cloud.ReplicagetShardLeader(String testCollectionName, String shardId, int timeoutSecs)protected org.apache.solr.client.solrj.impl.CloudSolrClientgetSolrClient(String collectionName)protected intgetTotalReplicas(org.apache.solr.common.cloud.DocCollection c, String collection)Deprecated.This method is virtually useless as it does not consider the status of either the shard or replica, nor wether the node hosting each replica is alive.static StringgetUrlFromZk(org.apache.solr.common.cloud.ClusterState clusterState, String collection)protected voidindex_specific(int serverNumber, Object... fields)protected voidindex_specific(org.apache.solr.client.solrj.SolrClient client, Object... fields)protected voidindexAbunchOfDocs()protected voidindexDoc(org.apache.solr.common.SolrInputDocument doc)Indexes the document in both the control client, and a randomly selected clientprotected voidinitCloud()protected voidlogReplicationDetails(org.apache.solr.common.cloud.Replica replica, StringBuilder builder)protected voidlogReplicaTypesReplicationInfo(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader)protected StringprintClusterStateInfo()protected StringprintClusterStateInfo(String collection)org.apache.solr.client.solrj.response.QueryResponsequeryAndCompareReplicas(org.apache.solr.common.params.SolrParams params, String shard)Executes a query against each live and active replica of the specified shard and aserts that the results are identical.voidqueryAndCompareShards(org.apache.solr.common.params.SolrParams params)For each Shard, executes a query against each live and active replica of that shard and asserts that the results are identical for each replica of the same shard.protected org.apache.solr.client.solrj.response.QueryResponsequeryServer(org.apache.solr.common.params.ModifiableSolrParams params)protected voidrandomlyEnableAutoSoftCommit()protected RestTestHarnessrandomRestTestHarness()protected RestTestHarnessrandomRestTestHarness(Random random)protected booleanreloadCollection(org.apache.solr.common.cloud.Replica replica, String testCollectionName)protected intsendDocsWithRetry(String collectionName, List<org.apache.solr.common.SolrInputDocument> batch, int minRf, int maxRetries, int waitBeforeRetry)protected static intsendDocsWithRetry(org.apache.solr.client.solrj.impl.CloudSolrClient cloudClient, String collection, List<org.apache.solr.common.SolrInputDocument> batch, int minRf, int maxRetries, int waitBeforeRetry)protected voidsetDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)protected static voidsetErrorHook()protected voidsetupRestTestHarnesses()voidshowCounts()protected voidupdateMappingsFromZk(List<JettySolrRunner> jettys, List<org.apache.solr.client.solrj.SolrClient> clients)protected voidupdateMappingsFromZk(List<JettySolrRunner> jettys, List<org.apache.solr.client.solrj.SolrClient> clients, boolean allowOverSharding)protected booleanuseTlogReplicas()protected voidwaitForActiveReplicaCount(org.apache.solr.client.solrj.impl.CloudSolrClient client, String collection, int expectedNumReplicas)protected voidwaitForAllWarmingSearchers()static voidwaitForCollection(org.apache.solr.common.cloud.ZkStateReader reader, String collection, int slices)protected voidwaitForLiveNode(JettySolrRunner j)static voidwaitForNon403or404or503(org.apache.solr.client.solrj.SolrClient collectionClient, String baseUrl)voidwaitForNoShardInconsistency()protected voidwaitForRecoveriesToFinish(boolean verbose)protected voidwaitForRecoveriesToFinish(boolean verbose, long timeoutSeconds)protected voidwaitForRecoveriesToFinish(String collection, boolean verbose)protected voidwaitForReplicationFromReplicas(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader, org.apache.solr.util.TimeOut timeout)voidwaitForThingsToLevelOut()voidwaitForThingsToLevelOut(int timeout, TimeUnit unit)-
Methods inherited from class org.apache.solr.cloud.AbstractDistribZkTestBase
assertAllActive, beforeThisClass, copyConfigUp, getCloudSchemaFile, getCloudSolrConfig, printLayout, restartZk, verifyReplicaStatus, waitForCollectionToDisappear, waitForRecoveriesToFinish, waitForRecoveriesToFinish, waitForRecoveriesToFinish, waitForRecoveriesToFinish
-
Methods inherited from class org.apache.solr.BaseDistributedSearchTestCase
add, add, addFields, addRandFields, buildUrl, clearHostContext, clearSolrDisableShardsWhitelist, compare, compare, compare, compare, compare, compare, compare1, compareResponses, compareSolrResponses, createControlJetty, createJetty, createJetty, createJetty, createParams, del, delQ, fixShardCount, flags, getExtraRequestFilters, getExtraServlets, getFieldNames, getRandFields, getRandValues, getShardCount, getShardsString, getSolrHome, getSolrXml, index, indexDoc, indexDocs, indexDocs, indexr, initHostContext, initialize, query, query, query, query, queryAndCompare, queryAndCompare, seedSolrHome, setSolrDisableShardsWhitelist, setupJettySolrHome, validateControlData
-
Methods inherited from class org.apache.solr.SolrTestCaseJ4
add, addAndGetVersion, addDoc, adoc, adoc, assertExceptionThrownWithMessageContaining, assertFailedU, assertFailedU, assertFieldValues, assertJQ, assertJQ, assertNonBlockingRandomGeneratorAvailable, assertQ, assertQ, assertQEx, assertQEx, assertQEx, assertResponseValues, assertSolrInputFieldEquals, assertU, assertU, assertXmlFile, assumeWorkingMockito, buildJettyConfig, buildUrl, clearIndex, commit, compareSolrDocument, compareSolrDocumentList, compareSolrInputDocument, configset, copyMinConf, copyMinConf, copyMinConf, copyMinFullSetup, copySolrHomeToTemp, copyXmlToHome, createComparator, createComparator, createCore, createCoreContainer, createCoreContainer, createCoreContainer, createDefaultCoreContainer, createDistributedUpdateProcessor, createDoc, createSort, deleteAndGetVersion, deleteByQueryAndGetVersion, deleteCore, delI, delQ, doc, getClassName, getFile, getHttpClient, getHttpSolrClient, getHttpSolrClient, getRootCause, getSaferTestName, getSchemaFile, getSimpleClassName, getSolrConfigFile, getWrappedException, hasInitException, hasInitException, ignoreException, indexDocs, initAndGetDataDir, initClassLogLevels, initCore, initCore, initCore, initCore, initMethodLogLevels, invertField, isSSLMode, JQ, json, json, json, jsonAdd, jsonDelId, jsonDelQ, legacyExampleCollection1SolrHome, map, map, newRandomConfig, optimize, params, pickRandom, postSetUp, preTearDown, randomDate, randomSkewedDate, randomXmlUsableUnicodeString, req, req, req, resetExceptionIgnores, resetFactory, resetGlobalTracer, restoreMethodLogLevels, sdoc, sdocs, sdocWithChildren, sdocWithChildren, sdocWithChildren, setUp, setupNoCoreTest, setupTestCases, skewed, startTrackingSearchers, systemClearPropertySolrDisableUrlAllowList, systemClearPropertySolrTestsMergePolicyFactory, systemSetPropertySolrDisableUrlAllowList, systemSetPropertySolrTestsMergePolicyFactory, tearDown, teardownTestCases, TEST_COLL1_CONF, TEST_HOME, TEST_PATH, toJSON, unIgnoreException, updateJ, useFactory, waitForWarming, waitForWarming, whitespaceMockTokenizer, whitespaceMockTokenizer, writeCoreProperties, writeCoreProperties
-
Methods inherited from class org.apache.solr.SolrTestCase
assertJSONEquals, beforeSolrTestCase, checkSyspropForceBeforeAssumptionFailure, checkSyspropForceBeforeClassAssumptionFailure
-
Methods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertFieldInfosEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, assumeWorkingMMapOnWindows, atLeast, atLeast, callStackContains, callStackContains, callStackContainsAnyOf, closeAfterSuite, closeAfterTest, collate, createTempDir, createTempDir, createTempFile, createTempFile, dumpArray, dumpIterator, ensureSaneIWCOnNightly, expectThrows, expectThrows, expectThrows, expectThrowsAnyOf, expectThrowsAnyOf, getDataInputStream, getDataPath, getJvmForkArguments, getOnlyLeafReader, getTestClass, getTestName, hasWorkingMMapOnWindows, isTestThread, localeForLanguageTag, maybeChangeLiveIndexWriterConfig, maybeWrapReader, newAlcoholicMergePolicy, newAlcoholicMergePolicy, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newBytesRef, newDirectory, newDirectory, newDirectory, newDirectory, newDirectory, newField, newField, newFSDirectory, newFSDirectory, newIndexWriterConfig, newIndexWriterConfig, newIndexWriterConfig, newIOContext, newIOContext, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newLogMergePolicy, newMaybeVirusCheckingDirectory, newMaybeVirusCheckingFSDirectory, newMergePolicy, newMergePolicy, newMergePolicy, newMockDirectory, newMockDirectory, newMockDirectory, newMockFSDirectory, newMockFSDirectory, newSearcher, newSearcher, newSearcher, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, usually, usually, wrapReader
-
Methods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, 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, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
-
-
-
Field Detail
-
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 volatile org.apache.solr.client.solrj.impl.CloudSolrClient controlClientCloud
-
cloudClient
protected volatile org.apache.solr.client.solrj.impl.CloudSolrClient cloudClient
-
coreClients
protected final List<org.apache.solr.client.solrj.SolrClient> coreClients
-
cloudJettys
protected final List<AbstractFullDistribZkTestBase.CloudJettyRunner> cloudJettys
-
shardToJetty
protected final Map<String,List<AbstractFullDistribZkTestBase.CloudJettyRunner>> shardToJetty
-
chaosMonkey
protected volatile ChaosMonkey chaosMonkey
-
shardToLeaderJetty
protected Map<String,AbstractFullDistribZkTestBase.CloudJettyRunner> shardToLeaderJetty
-
solrClientByCollection
protected Map<String,org.apache.solr.client.solrj.impl.CloudSolrClient> solrClientByCollection
-
useJettyDataDir
protected volatile boolean useJettyDataDir
-
-
Method Detail
-
beforeFullSolrCloudTest
public static void beforeFullSolrCloudTest()
-
beforeTest
public void beforeTest()
-
setErrorHook
protected static void setErrorHook()
-
clearErrorHook
protected static void clearErrorHook()
-
distribSetUp
public void distribSetUp() throws Exception- Overrides:
distribSetUpin classAbstractDistribZkTestBase- Throws:
Exception
-
beforeClass
public static void beforeClass()
-
getDataDir
protected String getDataDir(String dataDir) throws IOException
- Throws:
IOException
-
useTlogReplicas
protected boolean useTlogReplicas()
-
createCloudClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient createCloudClient(String defaultCollection)
-
createServers
protected void createServers(int numServers) throws Exception- Overrides:
createServersin classAbstractDistribZkTestBase- Throws:
Exception
-
waitForCollection
public static void waitForCollection(org.apache.solr.common.cloud.ZkStateReader reader, String collection, int slices) throws Exception- Throws:
Exception
-
createJettys
protected List<JettySolrRunner> createJettys(int numJettys) throws Exception
- Throws:
Exception
-
waitForLiveNode
protected void waitForLiveNode(JettySolrRunner j) throws InterruptedException, TimeoutException
- Throws:
InterruptedExceptionTimeoutException
-
waitForActiveReplicaCount
protected void waitForActiveReplicaCount(org.apache.solr.client.solrj.impl.CloudSolrClient client, String collection, int expectedNumReplicas) throws TimeoutException, org.apache.solr.cloud.ZkController.NotInClusterStateException- Throws:
TimeoutExceptionorg.apache.solr.cloud.ZkController.NotInClusterStateException
-
getPullReplicaCount
protected int getPullReplicaCount()
-
getTotalReplicas
@Deprecated protected int getTotalReplicas(org.apache.solr.common.cloud.DocCollection c, String collection)
Deprecated.This method is virtually useless as it does not consider the status of either the shard or replica, nor wether the node hosting each replica is alive.Total number of replicas for all shards as indicated by the cluster state, regardless of status.
-
createJetty
public JettySolrRunner createJetty(String dataDir, String ulogDir, String shardList, String solrConfigOverride) throws Exception
- Throws:
Exception
-
createJetty
public final JettySolrRunner createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride) throws Exception
- Overrides:
createJettyin classBaseDistributedSearchTestCase- Throws:
Exception
-
createJetty
public JettySolrRunner createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, org.apache.solr.common.cloud.Replica.Type replicaType) throws Exception
- Throws:
Exception
-
createProxiedJetty
public JettySolrRunner createProxiedJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, org.apache.solr.common.cloud.Replica.Type replicaType) throws Exception
Creates a JettySolrRunner with a socket proxy sitting in front of the Jetty server, which gives us the ability to simulate network partitions without having to fuss with IPTables.- Throws:
Exception
-
getReplicaPort
protected int getReplicaPort(org.apache.solr.common.cloud.Replica replica)
-
getJettyOnPort
protected JettySolrRunner getJettyOnPort(int port)
-
getProxyForReplica
protected org.apache.solr.client.solrj.cloud.SocketProxy getProxyForReplica(org.apache.solr.common.cloud.Replica replica) throws Exception- Throws:
Exception
-
updateMappingsFromZk
protected void updateMappingsFromZk(List<JettySolrRunner> jettys, List<org.apache.solr.client.solrj.SolrClient> clients) throws Exception
- Throws:
Exception
-
updateMappingsFromZk
protected void updateMappingsFromZk(List<JettySolrRunner> jettys, List<org.apache.solr.client.solrj.SolrClient> clients, boolean allowOverSharding) throws Exception
- Throws:
Exception
-
setDistributedParams
protected void setDistributedParams(org.apache.solr.common.params.ModifiableSolrParams params)
- Overrides:
setDistributedParamsin classBaseDistributedSearchTestCase
-
sendDocsWithRetry
protected int sendDocsWithRetry(String collectionName, List<org.apache.solr.common.SolrInputDocument> batch, int minRf, int maxRetries, int waitBeforeRetry) throws Exception
- Throws:
Exception
-
sendDocsWithRetry
protected static int sendDocsWithRetry(org.apache.solr.client.solrj.impl.CloudSolrClient cloudClient, String collection, List<org.apache.solr.common.SolrInputDocument> batch, int minRf, int maxRetries, int waitBeforeRetry) throws Exception- Throws:
Exception
-
indexDoc
protected void indexDoc(org.apache.solr.common.SolrInputDocument doc) throws IOException, org.apache.solr.client.solrj.SolrServerExceptionDescription copied from class:BaseDistributedSearchTestCaseIndexes the document in both the control client, and a randomly selected client- Overrides:
indexDocin classBaseDistributedSearchTestCase- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
index_specific
protected void index_specific(int serverNumber, Object... fields) throws Exception- Overrides:
index_specificin classBaseDistributedSearchTestCase- Throws:
Exception
-
index_specific
protected void index_specific(org.apache.solr.client.solrj.SolrClient client, Object... fields) throws Exception- Throws:
Exception
-
getLeaderUrlFromZk
protected org.apache.solr.common.cloud.ZkCoreNodeProps getLeaderUrlFromZk(String collection, String slice) throws IOException
- Throws:
IOException
-
del
protected void del(String q) throws Exception
- Overrides:
delin classBaseDistributedSearchTestCase- 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, long timeoutSeconds) throws Exception- Throws:
Exception
-
queryAndCompareReplicas
public org.apache.solr.client.solrj.response.QueryResponse queryAndCompareReplicas(org.apache.solr.common.params.SolrParams params, String shard) throws ExceptionExecutes a query against each live and active replica of the specified shard and aserts that the results are identical.
-
queryAndCompareShards
public void queryAndCompareShards(org.apache.solr.common.params.SolrParams params) throws ExceptionFor each Shard, executes a query against each live and active replica of that shard and asserts that the results are identical for each replica of the same shard. Because results are not compared between replicas of different shards, this method should be safe for comparing the results of any query, even if it contains "distrib=false", because the replicas should all be identical.- Throws:
Exception- See Also:
queryAndCompareReplicas(SolrParams, String)
-
checkShardConsistency
protected void checkShardConsistency(String shard) throws Exception
Returns a non-null string if replicas within the same shard do not have a consistent number of documents.- Throws:
Exception
-
checkShardConsistency
protected String checkShardConsistency(String shard, boolean expectFailure, boolean verbose) throws Exception
Returns a non-null string if replicas within the same shard do not have a consistent number of documents. If expectFailure==false, the exact differences found will be logged since this would be an unexpected failure. verbose causes extra debugging into to be displayed, even if everything is consistent.- Throws:
Exception
-
showCounts
public void showCounts()
-
randomlyEnableAutoSoftCommit
protected void randomlyEnableAutoSoftCommit()
-
enableAutoSoftCommit
protected void enableAutoSoftCommit(int time)
-
checkShardConsistency
protected void checkShardConsistency(boolean checkVsControl, boolean verbose) throws Exception- Throws:
Exception
-
checkShardConsistency
protected void checkShardConsistency(boolean checkVsControl, boolean verbose, Set<String> addFails, Set<String> deleteFails) throws Exception- Throws:
Exception
-
getClient
protected org.apache.solr.client.solrj.SolrClient getClient(String nodeName)
-
queryServer
protected org.apache.solr.client.solrj.response.QueryResponse queryServer(org.apache.solr.common.params.ModifiableSolrParams params) throws org.apache.solr.client.solrj.SolrServerException, IOException- Overrides:
queryServerin classBaseDistributedSearchTestCase- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
waitForThingsToLevelOut
public void waitForThingsToLevelOut(int timeout, TimeUnit unit) throws Exception- Throws:
Exception
-
waitForNoShardInconsistency
public void waitForNoShardInconsistency() throws Exception- Throws:
Exception
-
distribTearDown
public void distribTearDown() throws Exception- Overrides:
distribTearDownin classAbstractDistribZkTestBase- Throws:
Exception
-
destroyServers
protected void destroyServers() throws Exception- Overrides:
destroyServersin classBaseDistributedSearchTestCase- Throws:
Exception
-
commit
protected void commit() throws Exception- Overrides:
commitin classBaseDistributedSearchTestCase- Throws:
Exception
-
createCollection
protected org.apache.solr.client.solrj.response.CollectionAdminResponse createCollection(String collectionName, String configSetName, int numShards, int replicationFactor) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
createCollection
protected org.apache.solr.client.solrj.response.CollectionAdminResponse createCollection(Map<String,List<Integer>> collectionInfos, String collectionName, Map<String,Object> collectionProps, org.apache.solr.client.solrj.SolrClient client) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
createCollection
protected org.apache.solr.client.solrj.response.CollectionAdminResponse createCollection(Map<String,List<Integer>> collectionInfos, String collectionName, Map<String,Object> collectionProps, org.apache.solr.client.solrj.SolrClient client, String confSetName) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
createCollection
protected org.apache.solr.client.solrj.response.CollectionAdminResponse createCollection(Map<String,List<Integer>> collectionInfos, String collectionName, String configSetName, int numShards, int replicationFactor, org.apache.solr.client.solrj.SolrClient client, String createNodeSetStr) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
createCollection
protected org.apache.solr.client.solrj.response.CollectionAdminResponse createCollection(Map<String,List<Integer>> collectionInfos, String collectionName, int numShards, int replicationFactor, org.apache.solr.client.solrj.SolrClient client, String createNodeSetStr, String configName) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
getCloudSolrClient
public static org.apache.solr.client.solrj.impl.CloudSolrClient getCloudSolrClient(String zkHost, String defaultCollection, boolean shardLeadersOnly, int connectionTimeoutMillis, int socketTimeoutMillis)
This method may randomize unspecified aspects of the resulting SolrClient. Tests that do not wish to have any randomized behavior should use theCloudSolrClient.Builderclass directly
-
createNewSolrClient
protected org.apache.solr.client.solrj.SolrClient createNewSolrClient(int port)
- Overrides:
createNewSolrClientin classBaseDistributedSearchTestCase
-
createNewSolrClient
protected org.apache.solr.client.solrj.SolrClient createNewSolrClient(String coreName, int port)
-
createNewSolrClient
protected org.apache.solr.client.solrj.SolrClient createNewSolrClient(String collection, String baseUrl)
-
getBaseUrl
protected String getBaseUrl(JettySolrRunner jetty)
-
getDoc
public static 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
-
getCommonCloudSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient getCommonCloudSolrClient()
-
getSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient getSolrClient(String collectionName)
-
getUrlFromZk
public static String getUrlFromZk(org.apache.solr.common.cloud.ClusterState clusterState, String collection)
-
waitForNon403or404or503
public static void waitForNon403or404or503(org.apache.solr.client.solrj.SolrClient collectionClient, String baseUrl) throws Exception- Throws:
Exception
-
createCollection
protected void createCollection(String collName, org.apache.solr.client.solrj.impl.CloudSolrClient client, int replicationFactor, int numShards) throws Exception
- Throws:
Exception
-
createCollectionRetry
protected void createCollectionRetry(String testCollectionName, String configSetName, int numShards, int replicationFactor) throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOExceptionInterruptedExceptionTimeoutException
-
getShardLeader
protected org.apache.solr.common.cloud.Replica getShardLeader(String testCollectionName, String shardId, int timeoutSecs) throws Exception
- Throws:
Exception
-
ensureAllReplicasAreActive
protected List<org.apache.solr.common.cloud.Replica> ensureAllReplicasAreActive(String testCollectionName, String shardId, int shards, int rf, int maxWaitSecs) throws Exception
- Throws:
Exception
-
printClusterStateInfo
protected String printClusterStateInfo(String collection) throws Exception
- Throws:
Exception
-
reloadCollection
protected boolean reloadCollection(org.apache.solr.common.cloud.Replica replica, String testCollectionName) throws Exception- Throws:
Exception
-
logReplicaTypesReplicationInfo
protected void logReplicaTypesReplicationInfo(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader) throws org.apache.zookeeper.KeeperException, InterruptedException, IOException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedExceptionIOException
-
waitForReplicationFromReplicas
protected void waitForReplicationFromReplicas(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader, org.apache.solr.util.TimeOut timeout) throws org.apache.zookeeper.KeeperException, InterruptedException, IOException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedExceptionIOException
-
waitForAllWarmingSearchers
protected void waitForAllWarmingSearchers() throws InterruptedException- Throws:
InterruptedException
-
getIndexVersion
protected long getIndexVersion(org.apache.solr.common.cloud.Replica replica) throws IOException- Throws:
IOException
-
attemptCollectionDelete
protected static boolean attemptCollectionDelete(org.apache.solr.client.solrj.impl.CloudSolrClient client, String collectionName)Logs a WARN if collection can't be deleted, but does not fail or throw an exception- Returns:
- true if success, else false
-
logReplicationDetails
protected void logReplicationDetails(org.apache.solr.common.cloud.Replica replica, StringBuilder builder) throws IOException- Throws:
IOException
-
getRequestStateAfterCompletion
public static org.apache.solr.client.solrj.response.RequestStatusState getRequestStateAfterCompletion(String requestId, int waitForSeconds, org.apache.solr.client.solrj.SolrClient client) throws IOException, org.apache.solr.client.solrj.SolrServerException
- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
setupRestTestHarnesses
protected void setupRestTestHarnesses()
-
closeRestTestHarnesses
protected void closeRestTestHarnesses() throws IOException- Throws:
IOException
-
randomRestTestHarness
protected RestTestHarness randomRestTestHarness()
-
randomRestTestHarness
protected RestTestHarness randomRestTestHarness(Random random)
-
forAllRestTestHarnesses
protected void forAllRestTestHarnesses(Consumer<RestTestHarness> op)
-
-