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.AbstractFullDistribZkTestBase
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 ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class org.apache.solr.BaseDistributedSearchTestCase
BaseDistributedSearchTestCase.RandDate, BaseDistributedSearchTestCase.RandVal, BaseDistributedSearchTestCase.ShardsFixed, BaseDistributedSearchTestCase.ShardsRepeat, BaseDistributedSearchTestCase.ShardsRepeatRuleNested 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.XmlDocNested classes/interfaces inherited from class org.apache.lucene.tests.util.LuceneTestCase
org.apache.lucene.tests.util.LuceneTestCase.AwaitsFix, org.apache.lucene.tests.util.LuceneTestCase.Concurrency, 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>, org.apache.lucene.tests.util.LuceneTestCase.ThrowingRunnable, org.apache.lucene.tests.util.LuceneTestCase.Weekly -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChaosMonkeyprotected org.apache.solr.client.solrj.impl.CloudSolrClientprotected final List<AbstractFullDistribZkTestBase.CloudJettyRunner> protected org.apache.solr.client.solrj.impl.CloudSolrClientprotected final List<org.apache.solr.client.solrj.SolrClient> protected static final Stringprotected booleanstatic final Stringstatic final Stringprotected final Map<String, List<AbstractFullDistribZkTestBase.CloudJettyRunner>> protected intprotected booleanprotected ZkTestServerFields inherited from class org.apache.solr.BaseDistributedSearchTestCase
clients, 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, verifyStressFields 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, 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_TWOFields inherited from class org.apache.solr.SolrTestCase
methodRules, solrClassRulesFields 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_FAILFAST, SYSPROP_MAXFAILURES, SYSPROP_MONSTER, SYSPROP_NIGHTLY, SYSPROP_WEEKLY, TEST_ASSERTS_ENABLED, TEST_AWAITSFIX, TEST_CODEC, TEST_DIRECTORY, TEST_DOCVALUESFORMAT, TEST_LINE_DOCS_FILE, TEST_MONSTER, TEST_NIGHTLY, TEST_POSTINGSFORMAT, TEST_THROTTLING, TEST_WEEKLY, VERBOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected static voidassertAllActive(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader) 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 voidstatic voidvoidstatic voidprotected voidcheckForCollection(String collectionName, List<Integer> numShardsNumReplicaList) protected voidprotected voidprotected 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 voidprotected voidprotected voidcommit()static voidcopyConfigUp(Path configSetDir, String srcConfigSet, String dstConfigName, String zkAddr) 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) createJetty(String dataDir, String ulogDir, String shardList, String solrConfigOverride) final JettySolrRunnercreateJetty(Path solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride) createJetty(Path solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride, org.apache.solr.common.cloud.Replica.Type replicaType) 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) createProxiedJetty(Path 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.createReplicaProps(int numNrtReplicas, int numTlogReplicas, int numPullReplicas, int numShards) protected voidcreateServers(int numServers) protected voidprotected voidvoidvoidprotected voidenableAutoSoftCommit(int time) protected List<org.apache.solr.common.cloud.Replica> ensureAllReplicasAreActive(String testCollectionName, String shardId, int shards, int rf, int maxWaitSecs) protected voidprotected StringgetBaseUrl(JettySolrRunner jetty) static StringgetBaseUrlFromZk(org.apache.solr.common.cloud.ClusterState clusterState, String collection) Returns the base URL of a live Solr node hosting the specified collectionprotected org.apache.solr.client.solrj.SolrClientprotected Stringstatic 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 Stringprotected org.apache.solr.client.solrj.impl.CloudSolrClientprotected StringgetDataDir(String dataDir) static org.apache.solr.common.SolrInputDocumentprotected longgetIndexVersion(org.apache.solr.common.cloud.Replica replica) protected JettySolrRunnergetJettyOnPort(int port) protected org.apache.solr.common.cloud.ReplicagetLeaderFromZk(String collection, String slice) protected SocketProxygetProxyForReplica(org.apache.solr.common.cloud.Replica replica) protected intprotected 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.protected voidindex_specific(int serverNumber, Object... fields) protected voidindex_specific(org.apache.solr.client.solrj.SolrClient client, Object... fields) protected voidprotected voidindexDoc(org.apache.solr.common.SolrInputDocument doc) Indexes the document in both the control client, and a randomly selected clientprotected voidprotected voidlogReplicationDetails(org.apache.solr.common.cloud.Replica replica, StringBuilder builder) protected voidlogReplicaTypesReplicationInfo(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader) protected Stringprotected StringprintClusterStateInfo(String collection) protected voidorg.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.QueryResponsequeryRandomShard(org.apache.solr.common.params.ModifiableSolrParams params) Queries a random shard; nothing more.protected voidprotected RestTestHarnessprotected RestTestHarnessrandomRestTestHarness(Random random) protected booleanreloadCollection(org.apache.solr.common.cloud.Replica replica, String testCollectionName) protected voidrestartZk(int pauseMillis) 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 voidprotected voidvoidprotected 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 booleanstatic voidverifyReplicaStatus(org.apache.solr.common.cloud.ZkStateReader reader, String collection, String shard, String coreNodeName, org.apache.solr.common.cloud.Replica.State expectedState) protected voidwaitForActiveReplicaCount(org.apache.solr.client.solrj.impl.CloudSolrClient client, String collection, int expectedNumReplicas) protected voidstatic voidwaitForCollection(org.apache.solr.common.cloud.ZkStateReader reader, String collection, int slices) static voidwaitForCollectionToDisappear(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean failOnTimeout, int timeoutSeconds) protected voidstatic voidwaitForNon403or404or503(org.apache.solr.client.solrj.SolrClient collectionClient, String baseUrl) voidprotected voidwaitForRecoveriesToFinish(boolean verbose) protected voidwaitForRecoveriesToFinish(boolean verbose, long timeoutSeconds) protected voidwaitForRecoveriesToFinish(String collection, boolean verbose) protected voidwaitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose) protected voidwaitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout) static voidwaitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout, long timeoutSeconds) static voidwaitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout, long timeout, TimeUnit unit) protected voidwaitForReplicationFromReplicas(String collectionName, org.apache.solr.common.cloud.ZkStateReader zkStateReader, org.apache.solr.util.TimeOut timeout) voidvoidwaitForThingsToLevelOut(int timeout, TimeUnit unit) Methods inherited from class org.apache.solr.BaseDistributedSearchTestCase
add, add, addFields, addRandFields, clearSolrEnableUrlUrlAllowList, 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, initialize, query, query, query, query, queryAndCompare, queryAndCompare, seedSolrHome, setSolrEnableUrlUrlAllowList, setupJettySolrHome, validateControlDataMethods 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, assertThatJQ, assertThatJQ, assertU, assertU, assertXmlFile, assumeWorkingMockito, 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, getHttpSolrClient, getRootCause, getSaferTestName, getSchemaFile, getSimpleClassName, getSolrConfigFile, getWrappedException, hasInitException, hasInitException, ignoreException, indexDocs, initAndGetDataDir, initCore, initCore, initCore, initCore, 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, sdoc, sdocs, sdocWithChildren, sdocWithChildren, sdocWithChildren, setUp, setupNoCoreTest, setupTestCases, skewed, startTrackingSearchers, systemClearPropertySolrEnableUrlAllowList, systemClearPropertySolrTestsMergePolicyFactory, systemSetPropertyEnableUrlAllowList, systemSetPropertySolrTestsMergePolicyFactory, tearDown, teardownTestCases, TEST_COLL1_CONF, TEST_HOME, TEST_PATH, toJSON, unIgnoreException, updateJ, useFactory, waitForWarming, waitForWarming, whitespaceMockTokenizer, whitespaceMockTokenizer, writeCoreProperties, writeCorePropertiesMethods inherited from class org.apache.solr.SolrTestCase
afterClassShutdownLogging, assertJSONEquals, assertThat, assertThat, beforeSolrTestCase, checkSyspropForceBeforeAssumptionFailure, checkSyspropForceBeforeClassAssumptionFailureMethods inherited from class org.apache.lucene.tests.util.LuceneTestCase
addVirusChecker, assertDeletedDocsEquals, assertDocsAndPositionsEnumEquals, assertDocsEnumEquals, assertDocsSkippingEquals, assertDocValuesEquals, assertDocValuesEquals, assertDoubleUlpEquals, assertFieldInfosEquals, assertFloatUlpEquals, assertNormsEquals, assertPointsEquals, assertPositionsSkippingEquals, assertReaderEquals, assertReaderStatisticsEquals, assertStoredFieldEquals, assertStoredFieldsEquals, assertTermsEnumEquals, assertTermsEquals, assertTermsEquals, assertTermsStatisticsEquals, assertTermStatsEquals, assertTermVectorsEquals, asSet, assumeFalse, assumeNoException, assumeTrue, 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, 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, newSearcher, newSnapshotIndexWriterConfig, newStringField, newStringField, newStringField, newStringField, newTextField, newTextField, newTieredMergePolicy, newTieredMergePolicy, overrideDefaultQueryCache, overrideTestDefaultQueryCache, random, randomLocale, randomTimeZone, randomVectorFormat, rarely, rarely, replaceMaxFailureRule, resetDefaultQueryCache, restoreCPUCoreCount, restoreIndexWriterMaxDocs, runWithRestrictedPermissions, setIndexWriterMaxDocs, setupCPUCoreCount, setUpExecutorService, shutdownExecutorService, slowFileExists, usually, usually, wrapReaderMethods 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, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
DEFAULT_COLLECTION
- See Also:
-
zkServer
-
SHARD1
- See Also:
-
SHARD2
- See Also:
-
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
-
cloudJettys
-
shardToJetty
-
chaosMonkey
-
shardToLeaderJetty
-
solrClientByCollection
-
useJettyDataDir
protected volatile boolean useJettyDataDir
-
-
Constructor Details
-
AbstractFullDistribZkTestBase
public AbstractFullDistribZkTestBase()
-
-
Method Details
-
beforeThisClass
- Throws:
Exception
-
beforeFullSolrCloudTest
public static void beforeFullSolrCloudTest() -
beforeTest
public void beforeTest() -
setErrorHook
protected static void setErrorHook() -
clearErrorHook
protected static void clearErrorHook() -
distribSetUp
- Overrides:
distribSetUpin classBaseDistributedSearchTestCase- Throws:
Exception
-
getCloudSolrConfig
-
getCloudSchemaFile
-
beforeClass
public static void beforeClass() -
afterClass
- Throws:
Exception
-
getDataDir
- Throws:
IOException
-
initCloud
- Throws:
Exception
-
useTlogReplicas
protected boolean useTlogReplicas() -
createCloudClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient createCloudClient(String defaultCollection) -
createServers
- Overrides:
createServersin classBaseDistributedSearchTestCase- Throws:
Exception
-
waitForCollection
public static void waitForCollection(org.apache.solr.common.cloud.ZkStateReader reader, String collection, int slices) throws Exception - Throws:
Exception
-
createJettys
- Throws:
Exception
-
waitForLiveNode
- 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(Path solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride) throws Exception - Overrides:
createJettyin classBaseDistributedSearchTestCase- Throws:
Exception
-
createJetty
public JettySolrRunner createJetty(Path 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(Path 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
-
getProxyForReplica
protected 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.SolrServerException Description 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
- 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
-
getLeaderFromZk
-
del
- Overrides:
delin classBaseDistributedSearchTestCase- Throws:
Exception
-
waitForRecoveriesToFinish
- Throws:
Exception
-
waitForRecoveriesToFinish
- Throws:
Exception
-
waitForRecoveriesToFinish
- Throws:
Exception
-
waitForRecoveriesToFinish
protected void waitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose) throws Exception - Throws:
Exception
-
waitForRecoveriesToFinish
protected void waitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout) throws Exception - Throws:
Exception
-
waitForRecoveriesToFinish
public static void waitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout, long timeoutSeconds) throws Exception - Throws:
Exception
-
waitForRecoveriesToFinish
public static void waitForRecoveriesToFinish(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout, long timeout, TimeUnit unit) throws Exception - Throws:
Exception
-
waitForCollectionToDisappear
public static void waitForCollectionToDisappear(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean failOnTimeout, int timeoutSeconds) throws Exception - Throws:
Exception
-
verifyReplicaStatus
public static void verifyReplicaStatus(org.apache.solr.common.cloud.ZkStateReader reader, String collection, String shard, String coreNodeName, org.apache.solr.common.cloud.Replica.State expectedState) throws InterruptedException, TimeoutException - Throws:
InterruptedExceptionTimeoutException
-
assertAllActive
protected static void assertAllActive(String collection, org.apache.solr.common.cloud.ZkStateReader zkStateReader) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
checkQueries
- Throws:
Exception
-
indexAbunchOfDocs
- Throws:
Exception
-
queryAndCompareReplicas
public org.apache.solr.client.solrj.response.QueryResponse queryAndCompareReplicas(org.apache.solr.common.params.SolrParams params, String shard) throws Exception Executes a query against each live and active replica of the specified shard and aserts that the results are identical.- Throws:
Exception- See Also:
-
queryAndCompareShards
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. 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:
-
checkShardConsistency
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
- Throws:
Exception
-
checkShardConsistency
- Throws:
Exception
-
checkShardConsistency
protected void checkShardConsistency(boolean checkVsControl, boolean verbose, Set<String> addFails, Set<String> deleteFails) throws Exception - Throws:
Exception
-
getClient
-
assertDocCounts
- Throws:
Exception
-
queryRandomShard
protected org.apache.solr.client.solrj.response.QueryResponse queryRandomShard(org.apache.solr.common.params.ModifiableSolrParams params) throws org.apache.solr.client.solrj.SolrServerException, IOException Description copied from class:BaseDistributedSearchTestCaseQueries a random shard; nothing more.WARNING: tests should generally not call this as it doesn't compare to the control client
- Overrides:
queryRandomShardin classBaseDistributedSearchTestCase- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
waitForThingsToLevelOut
- Throws:
Exception
-
waitForThingsToLevelOut
- Throws:
Exception
-
waitForNoShardInconsistency
- Throws:
Exception
-
distribTearDown
- Overrides:
distribTearDownin classBaseDistributedSearchTestCase- Throws:
Exception
-
printLayout
- Throws:
Exception
-
restartZk
- Throws:
Exception
-
copyConfigUp
public static void copyConfigUp(Path configSetDir, String srcConfigSet, String dstConfigName, String zkAddr) throws Exception - Throws:
Exception
-
destroyServers
- Overrides:
destroyServersin classBaseDistributedSearchTestCase- Throws:
Exception
-
commit
- 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, throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutExceptionObject> collectionProps, org.apache.solr.client.solrj.SolrClient client) - 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, throws org.apache.solr.client.solrj.SolrServerException, IOException, InterruptedException, TimeoutExceptionObject> collectionProps, org.apache.solr.client.solrj.SolrClient client, String confSetName) - 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
-
createNewSolrClient
-
getBaseUrl
-
getDoc
- Throws:
Exception
-
checkForCollection
protected void checkForCollection(String collectionName, List<Integer> numShardsNumReplicaList) throws Exception - Throws:
Exception
-
getCommonCloudSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient getCommonCloudSolrClient() -
getSolrClient
-
getBaseUrlFromZk
public static String getBaseUrlFromZk(org.apache.solr.common.cloud.ClusterState clusterState, String collection) Returns the base URL of a live Solr node hosting the specified collectionNote that the returned URL does not contain the collection name itself.
- Parameters:
clusterState- used to identify which live nodes host the collectioncollection- the name of the collection to search for
-
waitForNon403or404or503
public static void waitForNon403or404or503(org.apache.solr.client.solrj.SolrClient collectionClient, String baseUrl) throws Exception - Throws:
Exception
-
createReplicaProps
-
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
- Throws:
Exception
-
printClusterStateInfo
- 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
- Throws:
InterruptedException
-
getIndexVersion
- 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
- Throws:
IOException
-
randomRestTestHarness
-
randomRestTestHarness
-
forAllRestTestHarnesses
-