You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2021/02/15 17:06:33 UTC

[lucene-solr] 02/03: Merge branch 'jira/solr-15131' into jira/solr-15130

This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-15130
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 2726b5790205e47bf69a4dfca923fbfc269afe89
Merge: 51aa6c3 76c7057
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Wed Feb 10 16:32:31 2021 +0100

    Merge branch 'jira/solr-15131' into jira/solr-15130

 .../apache/lucene/missingdoclet/MissingDoclet.java |  13 +-
 lucene/CHANGES.txt                                 |   4 +-
 .../lucene/analysis/hunspell/Dictionary.java       | 143 ++++---
 .../analysis/hunspell/GeneratingSuggester.java     | 469 +++++++++++++++++++++
 .../analysis/hunspell/ModifyingSuggester.java      |  57 ++-
 .../lucene/analysis/hunspell/SpellChecker.java     | 106 +++--
 .../apache/lucene/analysis/hunspell/Stemmer.java   | 117 +++--
 .../lucene/analysis/hunspell/SpellCheckerTest.java |  12 +
 .../analysis/hunspell/TestAllDictionaries.java     |   4 +
 .../lucene/analysis/hunspell/TestDictionary.java   |   2 +-
 .../apache/lucene/analysis/hunspell/allcaps.sug    |   3 +
 .../apache/lucene/analysis/hunspell/base_utf.sug   |  13 +
 .../lucene/analysis/hunspell/checksharps.sug       |   1 +
 .../lucene/analysis/hunspell/forgivable-errors.aff |   8 +-
 .../lucene/analysis/hunspell/forgivable-errors.dic |   2 +
 .../org/apache/lucene/analysis/hunspell/i58202.aff |   4 +
 .../org/apache/lucene/analysis/hunspell/i58202.dic |   5 +
 .../apache/lucene/analysis/hunspell/i58202.good    |  10 +
 .../org/apache/lucene/analysis/hunspell/i58202.sug |  13 +
 .../apache/lucene/analysis/hunspell/i58202.wrong   |  13 +
 .../apache/lucene/analysis/hunspell/keepcase.sug   |   8 +
 .../org/apache/lucene/analysis/hunspell/oconv.aff  |  20 +
 .../org/apache/lucene/analysis/hunspell/oconv.dic  |   4 +
 .../org/apache/lucene/analysis/hunspell/oconv.good |   2 +
 .../org/apache/lucene/analysis/hunspell/oconv.sug  |   3 +
 .../apache/lucene/analysis/hunspell/oconv.wrong    |   3 +
 .../apache/lucene/analysis/hunspell/wordpair.aff   |   4 +
 .../apache/lucene/analysis/hunspell/wordpair.dic   |   4 +
 .../apache/lucene/analysis/hunspell/wordpair.good  |   3 +
 .../apache/lucene/analysis/hunspell/wordpair.wrong |   1 +
 .../lucene50/Lucene50CompoundFormat.java           |  56 +--
 .../lucene50/Lucene50CompoundReader.java           |   2 +-
 .../backward_codecs/lucene70/Lucene70Codec.java    |   4 +-
 .../backward_codecs/lucene80/Lucene80Codec.java    |   2 +-
 .../backward_codecs/lucene84/Lucene84Codec.java    |   4 +-
 .../backward_codecs/lucene86/Lucene86Codec.java    |   4 +-
 .../backward_codecs/lucene87/Lucene87Codec.java    |   4 +-
 .../backward_codecs/Lucene87/Lucene87RWCodec.java} |  16 +-
 .../lucene50/Lucene50RWCompoundFormat.java}        |   6 +-
 .../lucene50/TestLucene50CompoundFormat.java       |   8 +-
 .../backward_codecs/lucene70/Lucene70RWCodec.java  |   7 +
 .../backward_codecs/lucene84/Lucene84RWCodec.java  |   7 +
 .../backward_codecs/lucene86/Lucene86RWCodec.java  |   7 +
 .../lucene/codecs/lucene90/Lucene90Codec.java      |   3 +-
 .../Lucene90CompoundFormat.java}                   |  14 +-
 .../Lucene90CompoundReader.java}                   |  22 +-
 .../lucene/codecs/lucene90/package-info.java       |   2 +-
 .../TestLucene90CompoundFormat.java}               |   4 +-
 .../TestLucene90FieldInfosFormat.java}             |  10 +-
 .../apache/lucene/queries/intervals/Intervals.java |  10 +
 .../MinimumShouldMatchIntervalsSource.java         |   1 +
 .../queries/intervals/NoMatchIntervalsSource.java  |  75 ++++
 .../lucene/queries/intervals/TestIntervals.java    |  21 +
 .../queries/intervals/TestSimplifications.java     |   9 +
 solr/CHANGES.txt                                   |   4 +-
 .../solr/cloud/api/collections/BackupCmd.java      |   5 +
 .../cloud/api/collections/CreateCollectionCmd.java |   1 +
 .../org/apache/solr/cluster/SolrCollection.java    |   2 +-
 .../impl/SimpleClusterAbstractionsImpl.java        |  36 +-
 .../placement/plugins/AffinityPlacementConfig.java |  30 +-
 .../plugins/AffinityPlacementFactory.java          |  51 +--
 .../java/org/apache/solr/core/CoreContainer.java   |   4 +-
 .../repository/LocalFileSystemRepository.java      |  12 +
 .../java/org/apache/solr/handler/CatStream.java    |  11 +-
 .../java/org/apache/solr/handler/ClusterAPI.java   |  14 +-
 .../org/apache/solr/handler/CollectionsAPI.java    | 177 +++++++-
 .../solr/handler/admin/CollectionsHandler.java     |   3 +-
 .../org/apache/solr/servlet/QueryRateLimiter.java  |   8 +-
 .../cloud/api/collections/TestCollectionAPI.java   |   7 +-
 .../impl/PlacementPluginIntegrationTest.java       |   8 +-
 .../plugins/AffinityPlacementFactoryTest.java      |   5 +-
 .../solr/handler/TestIncrementalCoreBackup.java    |   2 +
 .../solr/handler/admin/TestCollectionAPIs.java     |   4 +-
 .../handler/admin/V2CollectionsAPIMappingTest.java | 293 +++++++++++++
 .../src/replica-placement-plugins.adoc             |  44 +-
 .../solrj/request/CollectionAdminRequest.java      |  51 +--
 .../client/solrj/request/CollectionApiMapping.java |  74 +---
 ...onfigInfo.java => BackupCollectionPayload.java} |  40 +-
 ...lusterPropInfo.java => ClusterPropPayload.java} |  10 +-
 .../solrj/request/beans/CreateAliasPayload.java    |  79 ++++
 ...ateConfigInfo.java => CreateConfigPayload.java} |   2 +-
 .../{ClusterPropInfo.java => CreatePayload.java}   |  54 ++-
 ...eateConfigInfo.java => DeleteAliasPayload.java} |  14 +-
 ...ateLimiterMeta.java => RateLimiterPayload.java} |  10 +-
 ...nfigInfo.java => RestoreCollectionPayload.java} |  39 +-
 ...onfigInfo.java => SetAliasPropertyPayload.java} |  19 +-
 .../client/solrj/request/beans/V2ApiConstants.java |  55 +++
 .../solr/common/params/CollectionAdminParams.java  |   5 +
 .../resources/apispec/collections.Commands.json    | 298 -------------
 .../solrj/io/stream/StreamExpressionTest.java      |  38 +-
 .../client/solrj/request/TestV1toV2ApiMapper.java  |  26 +-
 .../apache/solr/common/util/JsonValidatorTest.java |  52 +--
 92 files changed, 2008 insertions(+), 928 deletions(-)

diff --cc solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
index 062750a,bc660ea..eefd3f2
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementConfig.java
@@@ -29,7 -25,7 +25,8 @@@ import org.apache.solr.common.annotatio
   */
  public class AffinityPlacementConfig implements PlacementPluginConfig {
  
-   public static final String COLLECTION_NODE_TYPE_PROPERTY = CollectionAdminParams.PROPERTY_PREFIX + "placement.affinity.node_type";
++  public static final String COLLECTION_NODE_TYPE_PROPERTY = "placement.affinity.node_type";
+   public static final String WITH_COLLECTION_PROPERTY = "placement.affinity.withCollection";
  
    public static final long DEFAULT_MINIMAL_FREE_DISK_GB = 20L;
    public static final long DEFAULT_PRIORITIZED_FREE_DISK_GB = 100L;
diff --cc solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
index 64aa9d5,d129b5b..96ef754
--- a/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
@@@ -641,10 -623,10 +632,10 @@@ public class AffinityPlacementFactory i
        }
      }
  
 -    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, Set<Node> initialNodes) throws PlacementException {
 +    private Set<Node> filterNodesWithCollection(Cluster cluster, PlacementRequest request, AttributeValues attributeValues, Set<Node> initialNodes) throws PlacementException {
        // if there's a `withCollection` constraint for this collection then remove nodes
        // that are not eligible
-       String withCollectionName = withCollections.get(request.getCollection().getName());
+       String withCollectionName = request.getCollection().getCustomProperty(AffinityPlacementConfig.WITH_COLLECTION_PROPERTY);
        if (withCollectionName == null) {
          return initialNodes;
        }