Class SplitShardCmd

    • Method Detail

      • split

        public boolean split​( clusterState,
                             org.apache.solr.common.util.NamedList<Object> results)
                      throws Exception
        Shard splits start here and make additional requests to the host of the parent shard. The sequence of requests is as follows:
        • 1. Verify that there is enough disk space to create sub-shards.
        • 2. If splitByPrefix is true, make request to get prefix ranges.
        • 3. If this split was attempted previously and there are lingering sub-shards, delete them.
        • 4. Create sub-shards in CONSTRUCTION state.
        • 5. Add an initial replica to each sub-shard.
        • 6. Request that parent shard wait for children to become ACTIVE.
        • 7. Execute split: either LINK or REWRITE.
        • 8. Apply buffered updates to the sub-shards so they are up-to-date with parent.
        • 9. Determine node placement for additional replicas (but do not create yet).
        • 10. If replicationFactor is more than 1, set shard state for sub-shards to RECOVERY; else mark ACTIVE.
        • 11. Create additional replicas of sub-shards.

        There is a shard split doc (dev-docs/shard-split/shard-split.adoc) on how shard split works; illustrated with diagrams.

      • checkDiskSpace

        public static void checkDiskSpace​(String collection,
                                          String shard,
                                          SolrIndexSplitter.SplitMethod method,
                                   throws org.apache.solr.common.SolrException,
      • getParentSlice

        public static getParentSlice​( clusterState,
                                                                        String collectionName,
                                                                        AtomicReference<String> slice,
                                                                        String splitKey)
      • fillRanges

        public static String fillRanges​( cloudManager,
                                        List<> subRanges,
                                        List<String> subSlices,
                                        List<String> subShardNames,
                                        boolean firstReplicaNrt)
      • lockForSplit

        public static boolean lockForSplit​( cloudManager,
                                           String collection,
                                           String shard)
                                    throws Exception
      • unlockForSplit

        public static void unlockForSplit​( cloudManager,
                                          String collection,
                                          String shard)
                                   throws Exception