Apache Solr open-source search software
Merge branch 'master' into feature/autoscaling
Shalin Shekhar Mangar6a8768e3959e
diff --cc solr/CHANGES.txtindex 1ca238ddb84,5343bc547f5..ed2feacbd03--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@@ -71,23 -98,36 +98,46 @@@ New Feature* SOLR-9835: Create another replication mode for SolrCloud- * SOLR-10292: Adds CartesianProductStream which turns a single tuple with a multi-valued field into N- tuples, one for each value in the multi-valued field. (Dennis Gove)+ * SOLR-10356: Adds basic math Streaming Evaluators (Dennis Gove)++ * SOLR-10393: Adds UUID Streaming Evaluator (Dennis Gove)++ * SOLR-10046: Add UninvertDocValuesMergePolicyFactory class. (Keith Laban, Christine Poerschke)++ * SOLR-10547: JSON Facet API: Implement support for single-valued string fields for min/max aggregations.+ (yonik)++ * SOLR-10262: Add support for configurable metrics implementations. (ab)++ * SOLR-10431: Make it possible to invoke v2 api calls using SolrJ (Cao Manh Dat, Noble Paul, shalin)++ * SOLR-10233: Add support for different replica types, that can handle updates differently:- - NRT: Writes updates to transaction log and indexes locally. Replicas of type “NRT” support NRT- (soft commits) and RTG. Any NRT replica can become a leader. This was the only type supported++ - NRT: Writes updates to transaction log and indexes locally. Replicas of type “NRT” support NRT++ (soft commits) and RTG. Any NRT replica can become a leader. This was the only type supported+ in SolrCloud until now and it’s the default type.- - TLOG: Writes to transaction log, but not to index, uses replication to copy segment files from the- shard leader. Any TLOG replica can become leader (by first applying all local transaction log++ - TLOG: Writes to transaction log, but not to index, uses replication to copy segment files from the++ shard leader. Any TLOG replica can become leader (by first applying all local transaction log+ elements). If a replica is of type TLOG but is also the leader, it will behave as a NRT. This+ is exactly what was added in SOLR-9835 (non-realtime replicas), just the API and naming changes.- - PULL: Doesn’t index or writes to transaction log, just replicates from the shard leader. PULL replicas- can’t become shard leaders (i.e., if there are only PULL replicas in the collection at some point,- updates will fail same as if there is no leaders, queries continue to work), so they don’t even++ - PULL: Doesn’t index or writes to transaction log, just replicates from the shard leader. PULL replicas++ can’t become shard leaders (i.e., if there are only PULL replicas in the collection at some point,++ updates will fail same as if there is no leaders, queries continue to work), so they don’t even+ participate in elections.+ (Tomás Fernández Löbbe)++ * SOLR-10278: A new DSL to set cluster-wide preferences and policies on how to allocate replicas to nodes+ (noble, shalin)+* SOLR-10339: New set-trigger and remove-trigger APIs for autoscaling. (shalin)++* SOLR-10340: New set-listener and remove-listener API for autoscaling. (shalin)++* SOLR-10358: New suspend-trigger and resume-trigger APIs for autoscaling. (shalin)+- * SOLR-10356: Adds basic math Streaming Evaluators (Dennis Gove)-- * SOLR-10393: Adds UUID Streaming Evaluator (Dennis Gove)-+* SOLR-10376: Implement autoscaling trigger for nodeAdded event. (shalin)++* SOLR-10396: Implement trigger support for nodeLost event type (Cao Manh Dat, shalin)+* SOLR-10373: Implement read API for autoscaling configuration at /admin/autoscaling or/cluster/autoscaling paths. (shalin)@@@ -102,13 -142,20 +152,27 @@@ Bug Fixe* SOLR-9837: Fix 55% performance regression of FieldCache uninvert time ofnumeric fields. (yonik)+ * SOLR-10408: v2 API introspect should return useful message for non-existent command (Cao Manh Dat)++ * SOLR-10411: v2 Collection API "modify" command specification's replicationFactor property is incorrectly typed as string,+ should be integer (Cao Manh Dat)++ * SOLR-10405: v2 API introspect response contains multiple copies of the experimental format WARNING (Cao Manh Dat)++ * SOLR-10412: v2 API: many API command specification properties are typed "number" but should instead be typed "integer"+ (Steve Rowe, Cao Manh Dat)++ * SOLR-10413: v2 API: parsed JSON type should be coerced to expected type (Cao Manh Dat, Noble Paul)++ * SOLR-10223: Allow running examples as root on Linux with -force option (janhoy)++* SOLR-10602: Triggers should be able to restore state from old instances when taking over. (shalin)++* SOLR-10714: OverseerTriggerThread does not start triggers on overseer start until autoscaling+ config watcher is fired. (shalin)++* SOLR-10738: TriggerAction is initialised even if the trigger is never scheduled. (shalin)+Optimizations----------------------@@@ -140,12 -191,195 +208,197 @@@ Other ChangeAdd support for selecting specific properties from any compound metric using 'property' parameter to/admin/metrics handler. (ab)+ * SOLR-10557: Make "compact" format default for /admin/metrics. (ab)++ * SOLR-10310: By default, stop splitting on whitespace prior to analysis+ in edismax and standard/"lucene" query parsers. (Steve Rowe)++ * SOLR-10647: Move the V1 <-> V2 API mapping to SolrJ (noble)++ * SOLR-10584: We'll now always throw an exception if defaultOperator is found in schema. This config has+ been deprecated since 3.6, and enforced for new configs since 6.6 (janhoy)++ * SOLR-10585: We'll now always throw an exception if defaultSearchField is found in schema. This config has+ been deprecated since 3.6, and enforced for new configs since 6.6 (janhoy, David Smiley)++ * SOLR-10414: RecoveryStrategy is now a Runnable instead of a Thread. (Tomás Fernández Löbbe)++ * SOLR-10042: Delete old deprecated Admin UI, leaving the AngularJS UI the only one supported (janhoy)++ * SOLR-10378: Clicking Solr logo on AdminUI shows blank page (Takumi Yoshida via janhoy)++ * SOLR-10700: Deprecated and converted the PostingsSolrHighlighter to extend UnifiedSolrHighlighter and thus no+ longer use the PostingsHighlighter. It should behave mostly the same. (David Smiley)++ * SOLR-10710: Fix LTR failing tests. (Diego Ceccarelli via Tomás Fernández Löbbe)++ * SOLR-10755: delete/refactor many solrj deprecations (hossman)++ * SOLR-10752: replicationFactor (nrtReplicas) default is 0 if tlogReplicas is specified when creating a collection+ (Tomás Fernández Löbbe)++ * SOLR-10757: delete/refactor/cleanup CollectionAdminRequest deprecations (hossman)++ * SOLR-10793: BlobHandler should have a well-known permission name (noble)++ * SOLR-10744: Update noggit to newer version (0.8) (noble)++ * SOLR-10792: Deprecate and remove implicit registration of "lucenePlusSort" aka OldLuceneQParser (hossman)++ * SOLR-10791: Remove deprecated options in SSLTestConfig (hossman)++ * LUCENE-7852: Correct copyright year(s) in solr/LICENSE.txt file.+ (Christine Poerschke, Steve Rowe)++ * SOLR-8668: In solrconfig.xml remove <mergePolicy> (and related <mergeFactor> and <maxMergeDocs>)+ support in favor of the <mergePolicyFactory> element introduced by SOLR-8621 in Solr 5.5.0.+ (Christine Poerschke, hossman)++ * SOLR-10799: Extracted functionality to collect eligible replicas from HttpShardHandler.prepDistributed()+ to a new method (Domenico Fabio Marino via Tomás Fernández Löbbe)++ * SOLR-10801: Remove several deprecated methods that were exposed to plugin writers (hossman)++ * SOLR-10671: Add abstract doInit method to the SolrMetricReporter base class.+ (Christine Poerschke, Anshum Gupta)++ * SOLR-10713: Ignore .pid and .out files in solr working directory (Jason Gerlowski via Mike Drob)++* SOLR-10643: Throttling strategy for triggers and policy executions. (shalin)+* SOLR-10764: AutoScalingHandler should validate policy and preferences before updating zookeeper. (shalin)+ * SOLR-10782: Improve error handling and tests for Snitch and subclasses and general cleanups. (Noble Paul, shalin)++ * SOLR-10419: All collection APIs should use the new Policy framework for replica placement. (Noble Paul, shalin)++ ================== 6.7.0 ==================++ Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.++ Versions of Major Components+ ---------------------+ Apache Tika 1.13+ Carrot2 3.15.0+ Velocity 1.7 and Velocity Tools 2.0+ Apache UIMA 2.3.1+ Apache ZooKeeper 3.4.10+ Jetty 9.3.14.v20161028++ Detailed Change List----------------------+ Upgrade Notes+ ----------------------++ * SOLR-10307: If starting Jetty without the Solr start script, you must now pass keystore and truststore+ passwords via the env variables SOLR_SSL_KEY_STORE_PASSWORD and SOLR_SSL_TRUST_STORE_PASSWORD rather+ than system properties.++ * SOLR-10379: ManagedSynonymFilterFactory has been deprecated in favor of ManagedSynonymGraphFilterFactory.++ New Features+ ----------------------++ * SOLR-10307: Allow Passing SSL passwords through environment variables. (Mano Kovacs via Mark Miller)++ * SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading+ (Erick Erickson)-+++ * SOLR-10379: Add ManagedSynonymGraphFilterFactory, deprecate ManagedSynonymFilterFactory. (Steve Rowe)++ * SOLR-10479: Adds support for HttpShardHandlerFactory.loadBalancerRequests(MinimumAbsolute|MaximumFraction)+ configuration. (Ramsey Haddad, Daniel Collins, Christine Poerschke)++ * SOLR-3702: concat(...) function query (Andrey Kudryavtsev via Mikhail Khludnev)++ * SOLR-10767: Add movingAvg Stream Evaluator (Joel Bernstein)++ * SOLR-10813: Add arraySort Stream Evaluator (Joel Bernstein)++ * SOLR-10696: Add cumulative probability function (Joel Bernstein)++ * SOLR-10765: Add anova Stream Evaluator (Joel Bernstein)++ * SOLR-10754: Add hist Stream Evaluator (Joel Bernstein)++ * SOLR-10753: Add array Stream Evaluator (Joel Bernstein)++ * SOLR-10747: Allow /stream handler to execute Stream Evaluators directly (Joel Bernstein)++ * SOLR-10743: Add sequence StreamEvaluator (Joel Bernstein)++ * SOLR-10684: Add finddelay Stream Evaluator (Joel Bernstein)++ * SOLR-10731: Add knn Streaming Expression (Joel Bernstein)++ * SOLR-10724: Add describe Stream Evaluator (Joel Bernstein)++ * SOLR-10693: Add copyOfRange Stream Evaluator (Joel Bernstein)++ * SOLR-10623: Add sql Streaming Expression (Joel Bernstein)++ * SOLR-10661: Add copyOf Stream Evaluator (Joel Bernstein)++ * SOLR-10663: Add distance Stream Evaluator (Joel Bernstein)++ * SOLR-10664: Add scale Stream Evaluator (Joel Bernstein)++ * SOLR-10666: Add rank transformation Stream Evaluator (Joel Bernstein)++ * SOLR-10662: Add length Stream Evaluator (Joel Bernstein)++ * SOLR-10660: Add reverse Stream Evaluator (Joel Bernstein)++ Bug Fixes+ ----------------------+ * SOLR-10723 JSON Facet API: resize() implemented incorrectly for CountSlotAcc, HllAgg.NumericAcc+ resulting in exceptions when using a hashing faceting method and sorting by hll(numeric_field).+ (yonik)++ * SOLR-10719: Creating a core.properties fails if the parent of core.properties is a symlinked dierctory+ (Erick Erickson)++ * SOLR-10360: Solr HDFS snapshot export fails due to FileNotFoundException error when using MR1 instead of+ yarn. (Hrishikesh via Mark Miller)++ * SOLR-10137: Ensure that ConfigSets created via API are mutable. (Hrishikesh via Mark Miller)++ Optimizations+ ----------------------+ * SOLR-10634: JSON Facet API: When a field/terms facet will retrieve all buckets (i.e. limit:-1)+ and there are no nested facets, aggregations are computed in the first collection phase+ so that the second phase which would normally involve calculating the domain for the bucket+ can be skipped entirely, leading to large performance improvements. (yonik)++ Other Changes+ ----------------------++ * SOLR-10617: JDBCStream accepts columns of type TIME, DATE & TIMESTAMP as well as CLOBs and decimal+ numeric types (James Dyer)++ * SOLR-10400: Replace (instanceof TrieFooField || instanceof FooPointField) constructs with+ FieldType.getNumberType() or SchemaField.getSortField() where appropriate. (hossman, Steve Rowe)--* SOLR-10438: Assign explicit useDocValuesAsStored values to all points field types in++++* SOLR-10438: Assign explicit useDocValuesAsStored values to all points field types in+ schema-point.xml/TestPointFields. (hossman, Steve Rowe)-+++ * LUCENE-7705: Allow CharTokenizer-derived tokenizers and KeywordTokenizer to configure the max token length.+ (Amrit Sarkar via Erick Erickson)++ * SOLR-10659: Remove ResponseBuilder.getSortSpec use in SearchGroupShardResponseProcessor.+ (Judith Silverman via Christine Poerschke)++ * SOLR-10741: Factor out createSliceShardsStr method from HttpShardHandler.prepDistributed.+ (Domenico Fabio Marino via Christine Poerschke)++ * SOLR-10790: Fix warnings in Assign.java and ReplicaAssigner.java classes.+ (Christine Poerschke)++ * SOLR-8437: Improve RAMDirectory details in sample solrconfig files (Mark Miller, Varun Thacker)++ * SOLR-8762: return child docs in DIH debug (Gopikannan Venugopalsamy via Mikhail Khludnev)+================== 6.6.0 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.@@@ -202,6 -439,61 +458,61 @@@ New FeatureExample: json.facet={x:"stddev(field1)", y:"variance(field2)"}(Rustam Hashimov, yonik)+ * SOLR-10505: Add multi-field support to TermsComponent when requesting terms' statistics. (Shai Erera)++ * SOLR-10537: SolrJ: Added SolrParams.toLocalParamsString() and ClientUtils.encodeLocalParamVal. (David Smiley)++ * SOLR-10507: Core Admin status command to emit collection details of each core (noble)+-* SOLR-10521: introducing sort=childfield(field) asc for searching by {!parent} (Mikhail Khludnev)++* SOLR-10521: introducing sort=childfield(field) asc for searching by {!parent} (Mikhail Khludnev)++ * SOLR-9596: Add Solr support for SimpleTextCodec, via <codecFactory class="solr.SimpleTextCodecFactory"/>+ in solrconfig.xml (per-field specification in the schema is not possible). (Steve Rowe)++ * SOLR-1485: Add payload support with payload() value source and {!payload_score} and {!payload_check}+ query parsers. (Erik Hatcher)++ * SOLR-10430: Add ls command to ZkCLI for listing only sub-directories. (Peter Szantai-Kis via Mark Miller)++ * SOLR-10583: JSON Faceting now supports a query time 'join' domain change option (hossman)++ * SOLR-9530: An Update Processor to convert normal update operation to an atomic operations such as+ add, set,inc, remove ,set, removeregex (Amrit Sarkar, noble)++ * SOLR-10303: Add date/time Stream Evaluators (Gethin James, Dennis Gove, Joel Bernstein)++ * SOLR-10351: Add analyze Stream Evaluator to support streaming NLP (Joel Bernstein)++ * SOLR-10426: Add shuffle Streaming Expression (Joel Bernstein)++ * SOLR-10274: The search Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)++ * SOLR-10504: Add echo Streaming Expression (Joel Bernstein)++ * SOLR-10516: Add eval Streaming Expression (Joel Bernstein)++ * SOLR-10566: Add timeseries Streaming Expression (Joel Bernstein)++ * SOLR-10559: Add let, get and tuple Streaming Expressions (Dennis Gove, Joel Bernstein)++ * SOLR-10582: Add Correlation Stream Evaluator (Joel Bernstein)++ * SOLR-10536: stats Streaming Expression should work in non-SolrCloud mode (Joel Bernstein)++ * SOLR-10622: Add regress and predict Stream Evaluators (Joel Bernstein)++ * SOLR-10626: Add covariance Stream Evaluator (Joel Bernstein)++ * SOLR-10625: Add convolution Stream Evaluator (Joel Bernstein)++ * SOLR-10638: Add normalize Stream Evaluator (Joel Bernstein)++ * SOLR-8440: Support for enabling basic authentication using bin/solr|bin/solr.cmd. (Ishan Chattopadhyaya, janhoy,+ Noble Paul, Hrishikesh Gadre)++ * SOLR-10292: Adds CartesianProductStream which turns a single tuple with a multi-valued field into N+ tuples, one for each value in the multi-valued field. (Dennis Gove)+Optimizations----------------------@@@ -209,6 -501,19 +520,19 @@@instance if it already is modifiable, otherwise creates a new ModifiableSolrParams instance.(Jörg Rathlev via Koji)+ * SOLR-10499: facet.heatmap is now significantly faster when the docset (base query) matches everything and there are no+ deleted docs. It's also faster when the docset matches a small fraction of the index or none. (David Smiley)+-* SOLR-9217: Reduced heap consumption for filter({!join ... score=...})++* SOLR-9217: Reduced heap consumption for filter({!join ... score=...})+ (Andrey Kudryavtsev, Gopikannan Venugopalsamy via Mikhail Khludnev)++ * SOLR-10548: JSON Facet API now uses hyper-log-log++ for determining the number of buckets+ when merging requests from a multi-shard distributed request. (yonik)++ * SOLR-10524: Better ZkStateWriter batching (Cao Manh Dat, Noble Paul, shalin, Scott Blum)++ * SOLR-10619: Optimize using cache for DistributedQueue in case of single-consumer (Cao Manh Dat, Scott Blum)+Bug Fixes----------------------* SOLR-10281: ADMIN_PATHS is duplicated in two places and inconsistent. This can cause automatic@@@ -220,7 -525,7 +544,7 @@@* SOLR-10369: bin\solr.cmd delete and healthcheck now works again; fixed continuation chars ^ (Luis Goes via janhoy)--* SOLR-10387: zkTransfer normalizes destination path incorrectly if source is a windows directory++* SOLR-10387: zkTransfer normalizes destination path incorrectly if source is a windows directory(gopikannan venugopalsamy, Erick Erickson)* SOLR-10323: fix to SpellingQueryConverter to properly strip out colons in field-specific queries.@@@ -228,8 -533,8 +552,8 @@@* SOLR-10264: Fixes multi-term synonym parsing in ManagedSynonymFilterFactory.(Jörg Rathlev, Steve Rowe, Christine Poerschke)----* SOLR-8807: fix Spellcheck "collateMaxCollectDocs" parameter to work with queries that have the++++* SOLR-8807: fix Spellcheck "collateMaxCollectDocs" parameter to work with queries that have theCollpasingQParserPlugin applied. (James Dyer)* SOLR-10474: TestPointFields.testPointFieldReturn() depends on order of unsorted hits. (Steve Rowe)@@@ -245,6 -550,51 +569,51 @@@* SOLR-5127: Multiple highlight fields and wildcards are now supported e.g. hl.fl=title,text_*(Sven-S. Porst, Daniel Debray, Simon Endele, Christine Poerschke)+ * SOLR-10493: Investigate SolrCloudExampleTest failures. (Erick Erickson)++ * SOLR-10552: JSON Facet API numBuckets was not consistent between distributed and non-distributed requests+ when there was a mincount > 1. This has been corrected by changing numBuckets cardinality processing to+ ignore mincount > 1 for non-distributed requests. (yonik)+-* SOLR-10520: child.facet.field doubled counts at least when rows>0. (Dr. Oleg Savrasov via Mikhail Khludnev)++* SOLR-10520: child.facet.field doubled counts at least when rows>0. (Dr. Oleg Savrasov via Mikhail Khludnev)++ * SOLR-10480: Full pagination in JSON Facet API using offset does not work. (yonik)++ * SOLR-10526: facet.heatmap didn't honor facet exclusions ('ex') for distributed search. (David Smiley)+-* SOLR-10500: nested child docs are adopted by neighbour when several parents come in update/json/docs++* SOLR-10500: nested child docs are adopted by neighbour when several parents come in update/json/docs+ (Alexey Suprun,noble via Mikhail Khludnev)++ * SOLR-10316: Unloading a core can remove a ZK SolrCore registration entry for the wrong SolrCore. (Mark Miller)++ * SOLR-10588: Prevent redundant core reload on config update (Mikhail Khludnev)++ * SOLR-10549: The new 'large' attribute had been forgotten in /schema/fieldtypes?showDefaults=true (David Smiley)++ * SOLR-10615: requests are suspended until SolrDispatchFilter initialization is completed.+ After core container shutdown or severe initialization problem Solr responds with+ http stauts 404 Not Found instead of 500 as it was before (Mikhail Khludnev)++ * SOLR-8149: Admin UI - Plugins / Stats - active item is now highlighted (Labuzov Dmitriy via janhoy)++ * SOLR-10630: HttpSolrCall.getAuthCtx().new AuthorizationContext() {...}.getParams()+ sometimes throws java.lang.NullPointerException (hu xiaodong via shalin)++ * SOLR-9527: Improve distribution of replicas when restoring a collection+ (Hrishikesh Gadre, Stephen Lewis, Rohit, Varun Thacker)++ * LUCENE-7821: The classic and flexible query parsers, as well as Solr's+ "lucene"/standard query parser, should require " TO " in range queries,+ and accept "TO" as endpoints in range queries. (hossman, Steve Rowe)++ * SOLR-10735: Windows script (solr.cmd) didn't work properly with directory containing spaces. Adding quotations- to fix (Uwe Schindler, janhoy, Tomas Fernandez-Lobbe, Ishan Chattopadhyaya)++ to fix (Uwe Schindler, janhoy, Tomas Fernandez-Lobbe, Ishan Chattopadhyaya)++ Ref Guide+ ----------------------++ * SOLR-10758: Modernize the Solr ref guide's Chinese language analysis coverage. (Steve Rowe)+Other Changes----------------------@@@ -257,7 -607,7 +626,7 @@@* SOLR-10352: bin/solr script now prints warning when available system entropy is lower than 300 (Esther Quansah viaIshan Chattopadhyaya)--++* SOLR-10344: Update Solr default/example and test configs to use WordDelimiterGraphFilterFactory. (Steve Rowe)* SOLR-10343: Update Solr default/example and test configs to use SynonymGraphFilterFactory. (Steve Rowe)@@@ -265,8 -615,9 +634,9 @@@* SOLR-10365: Handle a SolrCoreInitializationException while publishing core state during SolrCore creation(Ishan Chattopadhyaya)--* SOLR-10357: Enable edismax and standard query parsers to handle the option combination++* SOLR-10357: Enable edismax and standard query parsers to handle the option combinationsow=false / autoGeneratePhraseQueries="true" by setting QueryBuilder.autoGenerateMultiTermSynonymsQuery.+ (Steve Rowe)* SOLR-10147: Admin UI -> Cloud -> Graph: Impossible to see shard state (Amrit Sarkar, janhoy)@@@ -311,7 -688,7 +707,7 @@@ Bug Fixe* SOLR-10404: The fetch() streaming expression wouldn't work if a value included query syntax chars (like :+-).Fixed, and enhanced the generated query to not pollute the queryCache. (David Smiley)--++* SOLR-10423: Disable graph query production via schema configuration <fieldtype ... enableGraphQueries="false">.This fixes broken queries for ShingleFilter-containing query-time analyzers when request param sow=false.(Steve Rowe)diff --cc solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingHandler.javaindex bf1cc510cf9,5946bf450cf..ff101f33531--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingHandler.java+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingHandler.java@@@ -21,15 -21,9 +21,13 @@@ import java.io.IOExceptionimport java.lang.invoke.MethodHandles;import java.util.ArrayList;import java.util.Collection;+import java.util.Collections;+import java.util.Date;import java.util.HashMap;- import java.util.HashSet;import java.util.List;- import java.util.Locale;import java.util.Map;+import java.util.Set;+import java.util.concurrent.TimeUnit;import com.google.common.collect.ImmutableSet;import org.apache.solr.api.Api;@@@ -49,8 -44,6 +48,7 @@@ import org.apache.solr.request.SolrRequimport org.apache.solr.response.SolrQueryResponse;import org.apache.solr.security.AuthorizationContext;import org.apache.solr.security.PermissionNameProvider;- import org.apache.solr.util.CommandOperation;+import org.apache.solr.util.TimeSource;import org.apache.zookeeper.KeeperException;import org.apache.zookeeper.data.Stat;import org.slf4j.Logger;diff --cc solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.javaindex c0ceddb8d5f,6d70435612f..da9f70bc789--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java@@@ -68,9 -73,9 +73,10 @@@ import org.apache.solr.schema.FieldTypeimport org.apache.solr.schema.IndexSchema;import org.apache.solr.schema.SchemaField;import org.apache.solr.search.DocList;+import org.apache.solr.search.SolrDocumentFetcher;import org.apache.solr.search.QParser;import org.apache.solr.search.ReturnFields;+ import org.apache.solr.search.SolrDocumentFetcher;import org.apache.solr.search.SolrIndexSearcher;import org.apache.solr.search.SolrReturnFields;import org.apache.solr.search.SyntaxError;diff --cc solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.javaindex 9ad15d0168d,222377b3c1b..78931a2197a--- a/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java+++ b/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java@@@ -56,19 -61,30 +61,41 @@@ public abstract class SolrMetricReporte}}validate();+ if (!enabled) {+ log.info("Reporter disabled for registry " + registryName);+ return;+ }+ log.debug("Initializing for registry " + registryName);+ doInit();+ }++ /**+ * Reporter initialization implementation.+ */+ protected abstract void doInit();++ /**+ * Enable reporting, defaults to true. {@link #init(PluginInfo)} checks+ * this flag before calling {@link #doInit()} to initialize reporting.+ * @param enabled - whether or not reporting is to be enabled+ */+ public void setEnabled(Boolean enabled) {+ if (enabled != null) {+ this.enabled = enabled;+ }}+ /**+ * Enable reporting, defaults to true. Implementations should check this flag in+ * {@link #validate()} and accordingly enable or disable reporting.+ * @param enabled enable, defaults to true when null or not set.+ */+ public void setEnabled(Boolean enabled) {+ if (enabled != null) {+ this.enabled = enabled;+ }+ }+/*** Get the effective {@link PluginInfo} instance that was used for* initialization of this plugin.diff --cc solr/core/src/java/org/apache/solr/metrics/reporters/SolrGangliaReporter.javaindex 142ddd884e6,4dfdbeb11c0..0eec3a05cc4--- a/solr/core/src/java/org/apache/solr/metrics/reporters/SolrGangliaReporter.java+++ b/solr/core/src/java/org/apache/solr/metrics/reporters/SolrGangliaReporter.java@@@ -109,12 -109,15 +109,19 @@@ public class SolrGangliaReporter extendthis.ganglia = ganglia;}+ @Override+ protected void doInit() {+ if (!testing) {+ start();+ }+ }+@Overrideprotected void validate() throws IllegalStateException {+ if (!enabled) {+ log.info("Reporter disabled for registry " + registryName);+ return;+ }if (host == null) {throw new IllegalStateException("Init argument 'host' must be set to a valid Ganglia server name.");}diff --cc solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.javaindex 39dea1786e8,7bf461667b5..2f02df9f170--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java@@@ -67,317 -60,8 +60,314 @@@ public class AutoScalingHandlerTest extpublic void beforeTest() throws Exception {// clear any persisted auto scaling configurationzkClient().setData(SOLR_AUTOSCALING_CONF_PATH, Utils.toJSON(new ZkNodeProps()), true);- // todo nocommit -- add testing for the v2 path- // String path = random().nextBoolean() ? "/admin/autoscaling" : "/v2/cluster/autoscaling";- this.path = "/admin/autoscaling";}+ @Test+ public void testSuspendTrigger() throws Exception {+ CloudSolrClient solrClient = cluster.getSolrClient();+ String suspendEachCommand = "{\n" ++ "\t\"suspend-trigger\" : {\n" ++ "\t\t\"name\" : \"" + Policy.EACH + "\"\n" ++ "\t}\n" ++ "}";+ String resumeEachCommand = "{\n" ++ "\t\"resume-trigger\" : {\n" ++ "\t\t\"name\" : \"" + Policy.EACH + "\"\n" ++ "\t}\n" ++ "}";+ // these should be no-ops because there are no triggers, and it should succeed+ SolrRequest req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, suspendEachCommand);+ NamedList<Object> response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ assertEquals(response.get("changed").toString(), "[]");+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, resumeEachCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ assertEquals(response.get("changed").toString(), "[]");++ String setTriggerCommand = "{" ++ "'set-trigger' : {" ++ "'name' : 'node_lost_trigger'," ++ "'event' : 'nodeLost'," ++ "'waitFor' : '10m'," ++ "'enabled' : true}}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");++ setTriggerCommand = "{" ++ "'set-trigger' : {" ++ "'name' : 'node_added_trigger'," ++ "'event' : 'nodeAdded'," ++ "'waitFor' : '10m'," ++ "'enabled' : true" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");++ String suspendTriggerCommand = "{\n" ++ "\t\"suspend-trigger\" : {\n" ++ "\t\t\"name\" : \"node_lost_trigger\"\n" ++ "\t}\n" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, suspendTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ assertEquals(response.get("changed").toString(), "[node_lost_trigger]");++ byte[] data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ ZkNodeProps loaded = ZkNodeProps.load(data);+ Map<String, Object> triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(2, triggers.size());+ assertTrue(triggers.containsKey("node_lost_trigger"));+ assertTrue(triggers.containsKey("node_added_trigger"));+ Map<String, Object> nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ assertEquals("false", nodeLostTrigger.get("enabled").toString());+ Map<String, Object> nodeAddedTrigger = (Map<String, Object>) triggers.get("node_added_trigger");+ assertEquals(4, nodeAddedTrigger.size());+ assertEquals("true", nodeAddedTrigger.get("enabled").toString());++ suspendTriggerCommand = "{" ++ "'suspend-trigger' : {" ++ "'name' : '" + Policy.EACH + "'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, suspendTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ List<String> changed = (List<String>)response.get("changed");+ assertEquals(1, changed.size());+ assertTrue(changed.contains("node_added_trigger"));+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(2, triggers.size());+ nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ assertEquals("false", nodeLostTrigger.get("enabled").toString());+ nodeAddedTrigger = (Map<String, Object>) triggers.get("node_added_trigger");+ assertEquals(4, nodeAddedTrigger.size());+ assertEquals("false", nodeAddedTrigger.get("enabled").toString());++ String resumeTriggerCommand = "{" ++ "'resume-trigger' : {" ++ "'name' : 'node_added_trigger'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, resumeTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ changed = (List<String>)response.get("changed");+ assertEquals(1, changed.size());+ assertTrue(changed.contains("node_added_trigger"));+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(2, triggers.size());+ nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ assertEquals("false", nodeLostTrigger.get("enabled").toString());+ nodeAddedTrigger = (Map<String, Object>) triggers.get("node_added_trigger");+ assertEquals(4, nodeAddedTrigger.size());+ assertEquals("true", nodeAddedTrigger.get("enabled").toString());++ resumeTriggerCommand = "{" ++ "'resume-trigger' : {" ++ "'name' : '" + Policy.EACH + "'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, resumeTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ changed = (List<String>)response.get("changed");+ assertEquals(1, changed.size());+ assertTrue(changed.contains("node_lost_trigger"));+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(2, triggers.size());+ nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ assertEquals("true", nodeLostTrigger.get("enabled").toString());+ nodeAddedTrigger = (Map<String, Object>) triggers.get("node_added_trigger");+ assertEquals(4, nodeAddedTrigger.size());+ assertEquals("true", nodeAddedTrigger.get("enabled").toString());++ suspendTriggerCommand = "{" ++ "'suspend-trigger' : {" ++ "'name' : 'node_lost_trigger'," ++ "'timeout' : '1h'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, suspendTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ changed = (List<String>)response.get("changed");+ assertEquals(1, changed.size());+ assertTrue(changed.contains("node_lost_trigger"));+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(2, triggers.size());+ nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(5, nodeLostTrigger.size());+ assertEquals("false", nodeLostTrigger.get("enabled").toString());+ assertTrue(nodeLostTrigger.containsKey("resumeAt"));+ }++ @Test+ public void test() throws Exception {+ CloudSolrClient solrClient = cluster.getSolrClient();+ String setTriggerCommand = "{" ++ "'set-trigger' : {" ++ "'name' : 'node_lost_trigger'," ++ "'event' : 'nodeLost'," ++ "'waitFor' : '10m'," ++ "'enabled' : true," ++ "'actions' : [" ++ "{" ++ "'name' : 'compute_plan'," ++ "'class' : 'solr.ComputePlanAction'" ++ "}," ++ "{" ++ "'name' : 'log_plan'," ++ "'class' : 'solr.LogPlanAction'," ++ "'collection' : '.system'" ++ "}]}}";+ SolrRequest req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setTriggerCommand);++ NamedList<Object> response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");++ byte[] data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ ZkNodeProps loaded = ZkNodeProps.load(data);+ Map<String, Object> triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(1, triggers.size());+ assertTrue(triggers.containsKey("node_lost_trigger"));+ Map<String, Object> nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ List<Map<String, String>> actions = (List<Map<String, String>>) nodeLostTrigger.get("actions");+ assertNotNull(actions);+ assertEquals(2, actions.size());+ assertEquals("600", nodeLostTrigger.get("waitFor").toString());++ setTriggerCommand = "{" ++ "'set-trigger' : {" ++ "'name' : 'node_lost_trigger'," ++ "'event' : 'nodeLost'," ++ "'waitFor' : '20m'," ++ "'enabled' : false" ++ "}}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(1, triggers.size());+ assertTrue(triggers.containsKey("node_lost_trigger"));+ nodeLostTrigger = (Map<String, Object>) triggers.get("node_lost_trigger");+ assertEquals(4, nodeLostTrigger.size());+ assertEquals("1200", nodeLostTrigger.get("waitFor").toString());+ assertEquals("false", nodeLostTrigger.get("enabled").toString());+ actions = (List<Map<String, String>>) nodeLostTrigger.get("actions");+ assertNotNull(actions);+ assertEquals(3, actions.size());++ String setListenerCommand = "{" ++ "'set-listener' : " ++ "{" ++ "'name' : 'xyz'," ++ "'trigger' : 'node_lost_trigger'," ++ "'stage' : ['STARTED','ABORTED','SUCCEEDED']," ++ "'beforeAction' : 'execute_plan'," ++ "'class' : 'org.apache.solr.cloud.autoscaling.AutoScaling$HttpCallbackListener'," ++ "'url' : 'http://xyz.com/on_node_lost?node={$LOST_NODE_NAME}'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setListenerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ Map<String, Object> listeners = (Map<String, Object>) loaded.get("listeners");+ assertNotNull(listeners);+ assertEquals(1, listeners.size());+ assertTrue(listeners.containsKey("xyz"));+ Map<String, Object> xyzListener = (Map<String, Object>) listeners.get("xyz");+ assertEquals(5, xyzListener.size());+ assertEquals("org.apache.solr.cloud.autoscaling.AutoScaling$HttpCallbackListener", xyzListener.get("class").toString());++ String removeTriggerCommand = "{" ++ "'remove-trigger' : {" ++ "'name' : 'node_lost_trigger'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, removeTriggerCommand);+ try {+ response = solrClient.request(req);+ fail("Trying to remove trigger which has listeners registered should have failed");+ } catch (HttpSolrClient.RemoteSolrException e) {+ // expected+ }++ String removeListenerCommand = "{\n" ++ "\t\"remove-listener\" : {\n" ++ "\t\t\"name\" : \"xyz\"\n" ++ "\t}\n" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, removeListenerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ listeners = (Map<String, Object>) loaded.get("listeners");+ assertNotNull(listeners);+ assertEquals(0, listeners.size());++ removeTriggerCommand = "{" ++ "'remove-trigger' : {" ++ "'name' : 'node_lost_trigger'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, removeTriggerCommand);+ response = solrClient.request(req);+ assertEquals(response.get("result").toString(), "success");+ data = zkClient().getData(SOLR_AUTOSCALING_CONF_PATH, null, null, true);+ loaded = ZkNodeProps.load(data);+ triggers = (Map<String, Object>) loaded.get("triggers");+ assertNotNull(triggers);+ assertEquals(0, triggers.size());++ setListenerCommand = "{" ++ "'set-listener' : {" ++ "'name' : 'xyz'," ++ "'trigger' : 'node_lost_trigger'," ++ "'stage' : ['STARTED','ABORTED','SUCCEEDED']," ++ "'beforeAction' : 'execute_plan'," ++ "'class' : 'org.apache.solr.cloud.autoscaling.AutoScaling$HttpCallbackListener'," ++ "'url' : 'http://xyz.com/on_node_lost?node={$LOST_NODE_NAME}'" ++ "}" ++ "}";+ req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setListenerCommand);+ try {+ response = solrClient.request(req);+ fail("Adding a listener on a non-existent trigger should have failed");+ } catch (HttpSolrClient.RemoteSolrException e) {+ // expected+ }+ }+@Testpublic void testPolicyAndPreferences() throws Exception {CloudSolrClient solrClient = cluster.getSolrClient();@@@ -516,8 -198,8 +515,8 @@@" {'nodeRole':'overseer', 'replica':0}" +" ]" +"}";- req = new AutoScalingRequest(SolrRequest.METHOD.POST, path, setClusterPolicyCommand);- SolrRequest req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand);- NamedList<Object> response = solrClient.request(req);++ req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand);+ response = solrClient.request(req);assertEquals(response.get("result").toString(), "success");String setPreferencesCommand = "{" +@@@ -544,20 -226,9 +543,19 @@@response = solrClient.request(req);assertEquals(response.get("result").toString(), "success");- SolrQuery query = new SolrQuery().setParam(CommonParams.QT, path);- QueryResponse queryResponse = solrClient.query(query);- response = queryResponse.getResponse();+ req = createAutoScalingRequest(SolrRequest.METHOD.GET, null);+ response = solrClient.request(req);+ Map triggers = (Map) response.get("triggers");+ assertNotNull(triggers);+ assertEquals(1, triggers.size());+ assertTrue(triggers.containsKey("node_added_trigger1"));+ Map node_added_trigger1 = (Map) triggers.get("node_added_trigger1");+ assertEquals(4, node_added_trigger1.size());+ assertEquals(0L, node_added_trigger1.get("waitFor"));+ assertEquals(true, node_added_trigger1.get("enabled"));+ assertEquals(3, ((List)node_added_trigger1.get("actions")).size());+List<Map> clusterPrefs = (List<Map>) response.get("cluster-preferences");assertNotNull(clusterPrefs);assertEquals(4, clusterPrefs.size());diff --cc solr/solr-ref-guide/src/fonts/Noto_Sans/LICENSE.txtindex 00000000000,75b52484ea4..d6456956733mode 000000,100755..100755--- a/solr/solr-ref-guide/src/fonts/Noto_Sans/LICENSE.txt+++ b/solr/solr-ref-guide/src/fonts/Noto_Sans/LICENSE.txt@@@ -1,0 -1,202 +1,202 @@@-- Apache License- Version 2.0, January 2004- http://www.apache.org/licenses/-- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION-- 1. Definitions.-- "License" shall mean the terms and conditions for use, reproduction,- and distribution as defined by Sections 1 through 9 of this document.-- "Licensor" shall mean the copyright owner or entity authorized by- the copyright owner that is granting the License.-- "Legal Entity" shall mean the union of the acting entity and all- other entities that control, are controlled by, or are under common- control with that entity. For the purposes of this definition,- "control" means (i) the power, direct or indirect, to cause the- direction or management of such entity, whether by contract or- otherwise, or (ii) ownership of fifty percent (50%) or more of the- outstanding shares, or (iii) beneficial ownership of such entity.-- "You" (or "Your") shall mean an individual or Legal Entity- exercising permissions granted by this License.-- "Source" form shall mean the preferred form for making modifications,- including but not limited to software source code, documentation- source, and configuration files.-- "Object" form shall mean any form resulting from mechanical- transformation or translation of a Source form, including but- not limited to compiled object code, generated documentation,- and conversions to other media types.-- "Work" shall mean the work of authorship, whether in Source or- Object form, made available under the License, as indicated by a- copyright notice that is included in or attached to the work- (an example is provided in the Appendix below).-- "Derivative Works" shall mean any work, whether in Source or Object- form, that is based on (or derived from) the Work and for which the- editorial revisions, annotations, elaborations, or other modifications- represent, as a whole, an original work of authorship. For the purposes- of this License, Derivative Works shall not include works that remain- separable from, or merely link (or bind by name) to the interfaces of,- the Work and Derivative Works thereof.-- "Contribution" shall mean any work of authorship, including- the original version of the Work and any modifications or additions- to that Work or Derivative Works thereof, that is intentionally- submitted to Licensor for inclusion in the Work by the copyright owner- or by an individual or Legal Entity authorized to submit on behalf of- the copyright owner. For the purposes of this definition, "submitted"- means any form of electronic, verbal, or written communication sent- to the Licensor or its representatives, including but not limited to- communication on electronic mailing lists, source code control systems,- and issue tracking systems that are managed by, or on behalf of, the- Licensor for the purpose of discussing and improving the Work, but- excluding communication that is conspicuously marked or otherwise- designated in writing by the copyright owner as "Not a Contribution."-- "Contributor" shall mean Licensor and any individual or Legal Entity- on behalf of whom a Contribution has been received by Licensor and- subsequently incorporated within the Work.-- 2. Grant of Copyright License. Subject to the terms and conditions of- this License, each Contributor hereby grants to You a perpetual,- worldwide, non-exclusive, no-charge, royalty-free, irrevocable- copyright license to reproduce, prepare Derivative Works of,- publicly display, publicly perform, sublicense, and distribute the- Work and such Derivative Works in Source or Object form.-- 3. Grant of Patent License. Subject to the terms and conditions of- this License, each Contributor hereby grants to You a perpetual,- worldwide, non-exclusive, no-charge, royalty-free, irrevocable- (except as stated in this section) patent license to make, have made,- use, offer to sell, sell, import, and otherwise transfer the Work,- where such license applies only to those patent claims licensable- by such Contributor that are necessarily infringed by their- Contribution(s) alone or by combination of their Contribution(s)- with the Work to which such Contribution(s) was submitted. If You- institute patent litigation against any entity (including a- cross-claim or counterclaim in a lawsuit) alleging that the Work- or a Contribution incorporated within the Work constitutes direct- or contributory patent infringement, then any patent licenses- granted to You under this License for that Work shall terminate- as of the date such litigation is filed.-- 4. Redistribution. You may reproduce and distribute copies of the- Work or Derivative Works thereof in any medium, with or without- modifications, and in Source or Object form, provided that You- meet the following conditions:-- (a) You must give any other recipients of the Work or- Derivative Works a copy of this License; and-- (b) You must cause any modified files to carry prominent notices- stating that You changed the files; and-- (c) You must retain, in the Source form of any Derivative Works- that You distribute, all copyright, patent, trademark, and- attribution notices from the Source form of the Work,- excluding those notices that do not pertain to any part of- the Derivative Works; and-- (d) If the Work includes a "NOTICE" text file as part of its- distribution, then any Derivative Works that You distribute must- include a readable copy of the attribution notices contained- within such NOTICE file, excluding those notices that do not- pertain to any part of the Derivative Works, in at least one- of the following places: within a NOTICE text file distributed- as part of the Derivative Works; within the Source form or- documentation, if provided along with the Derivative Works; or,- within a display generated by the Derivative Works, if and- wherever such third-party notices normally appear. The contents- of the NOTICE file are for informational purposes only and- do not modify the License. You may add Your own attribution- notices within Derivative Works that You distribute, alongside- or as an addendum to the NOTICE text from the Work, provided- that such additional attribution notices cannot be construed- as modifying the License.-- You may add Your own copyright statement to Your modifications and- may provide additional or different license terms and conditions- for use, reproduction, or distribution of Your modifications, or- for any such Derivative Works as a whole, provided Your use,- reproduction, and distribution of the Work otherwise complies with- the conditions stated in this License.-- 5. Submission of Contributions. Unless You explicitly state otherwise,- any Contribution intentionally submitted for inclusion in the Work- by You to the Licensor shall be under the terms and conditions of- this License, without any additional terms or conditions.- Notwithstanding the above, nothing herein shall supersede or modify- the terms of any separate license agreement you may have executed- with Licensor regarding such Contributions.-- 6. Trademarks. This License does not grant permission to use the trade- names, trademarks, service marks, or product names of the Licensor,- except as required for reasonable and customary use in describing the- origin of the Work and reproducing the content of the NOTICE file.-- 7. Disclaimer of Warranty. Unless required by applicable law or- agreed to in writing, Licensor provides the Work (and each- Contributor provides its Contributions) on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or- implied, including, without limitation, any warranties or conditions- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A- PARTICULAR PURPOSE. You are solely responsible for determining the- appropriateness of using or redistributing the Work and assume any- risks associated with Your exercise of permissions under this License.-- 8. Limitation of Liability. In no event and under no legal theory,- whether in tort (including negligence), contract, or otherwise,- unless required by applicable law (such as deliberate and grossly- negligent acts) or agreed to in writing, shall any Contributor be- liable to You for damages, including any direct, indirect, special,- incidental, or consequential damages of any character arising as a- result of this License or out of the use or inability to use the- Work (including but not limited to damages for loss of goodwill,- work stoppage, computer failure or malfunction, or any and all- other commercial damages or losses), even if such Contributor- has been advised of the possibility of such damages.-- 9. Accepting Warranty or Additional Liability. While redistributing- the Work or Derivative Works thereof, You may choose to offer,- and charge a fee for, acceptance of support, warranty, indemnity,- or other liability obligations and/or rights consistent with this- License. However, in accepting such obligations, You may act only- on Your own behalf and on Your sole responsibility, not on behalf- of any other Contributor, and only if You agree to indemnify,- defend, and hold each Contributor harmless for any liability- incurred by, or claims asserted against, such Contributor by reason- of your accepting any such warranty or additional liability.-- END OF TERMS AND CONDITIONS-- APPENDIX: How to apply the Apache License to your work.-- To apply the Apache License to your work, attach the following- boilerplate notice, with the fields enclosed by brackets "[]"- replaced with your own identifying information. (Don't include- the brackets!) The text should be enclosed in the appropriate- comment syntax for the file format. We also recommend that a- file or class name and description of purpose be included on the- same "printed page" as the copyright notice for easier- identification within third-party archives.-- Copyright [yyyy] [name of copyright owner]-- Licensed under the Apache License, Version 2.0 (the "License");- you may not use this file except in compliance with the License.- You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.++++ Apache License++ Version 2.0, January 2004++ http://www.apache.org/licenses/++++ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION++++ 1. Definitions.++++ "License" shall mean the terms and conditions for use, reproduction,++ and distribution as defined by Sections 1 through 9 of this document.++++ "Licensor" shall mean the copyright owner or entity authorized by++ the copyright owner that is granting the License.++++ "Legal Entity" shall mean the union of the acting entity and all++ other entities that control, are controlled by, or are under common++ control with that entity. For the purposes of this definition,++ "control" means (i) the power, direct or indirect, to cause the++ direction or management of such entity, whether by contract or++ otherwise, or (ii) ownership of fifty percent (50%) or more of the++ outstanding shares, or (iii) beneficial ownership of such entity.++++ "You" (or "Your") shall mean an individual or Legal Entity++ exercising permissions granted by this License.++++ "Source" form shall mean the preferred form for making modifications,++ including but not limited to software source code, documentation++ source, and configuration files.++++ "Object" form shall mean any form resulting from mechanical++ transformation or translation of a Source form, including but++ not limited to compiled object code, generated documentation,++ and conversions to other media types.++++ "Work" shall mean the work of authorship, whether in Source or++ Object form, made available under the License, as indicated by a++ copyright notice that is included in or attached to the work++ (an example is provided in the Appendix below).++++ "Derivative Works" shall mean any work, whether in Source or Object++ form, that is based on (or derived from) the Work and for which the++ editorial revisions, annotations, elaborations, or other modifications++ represent, as a whole, an original work of authorship. For the purposes++ of this License, Derivative Works shall not include works that remain++ separable from, or merely link (or bind by name) to the interfaces of,++ the Work and Derivative Works thereof.++++ "Contribution" shall mean any work of authorship, including++ the original version of the Work and any modifications or additions++ to that Work or Derivative Works thereof, that is intentionally++ submitted to Licensor for inclusion in the Work by the copyright owner++ or by an individual or Legal Entity authorized to submit on behalf of++ the copyright owner. For the purposes of this definition, "submitted"++ means any form of electronic, verbal, or written communication sent++ to the Licensor or its representatives, including but not limited to++ communication on electronic mailing lists, source code control systems,++ and issue tracking systems that are managed by, or on behalf of, the++ Licensor for the purpose of discussing and improving the Work, but++ excluding communication that is conspicuously marked or otherwise++ designated in writing by the copyright owner as "Not a Contribution."++++ "Contributor" shall mean Licensor and any individual or Legal Entity++ on behalf of whom a Contribution has been received by Licensor and++ subsequently incorporated within the Work.++++ 2. Grant of Copyright License. Subject to the terms and conditions of++ this License, each Contributor hereby grants to You a perpetual,++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable++ copyright license to reproduce, prepare Derivative Works of,++ publicly display, publicly perform, sublicense, and distribute the++ Work and such Derivative Works in Source or Object form.++++ 3. Grant of Patent License. Subject to the terms and conditions of++ this License, each Contributor hereby grants to You a perpetual,++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable++ (except as stated in this section) patent license to make, have made,++ use, offer to sell, sell, import, and otherwise transfer the Work,++ where such license applies only to those patent claims licensable++ by such Contributor that are necessarily infringed by their++ Contribution(s) alone or by combination of their Contribution(s)++ with the Work to which such Contribution(s) was submitted. If You++ institute patent litigation against any entity (including a++ cross-claim or counterclaim in a lawsuit) alleging that the Work++ or a Contribution incorporated within the Work constitutes direct++ or contributory patent infringement, then any patent licenses++ granted to You under this License for that Work shall terminate++ as of the date such litigation is filed.++++ 4. Redistribution. You may reproduce and distribute copies of the++ Work or Derivative Works thereof in any medium, with or without++ modifications, and in Source or Object form, provided that You++ meet the following conditions:++++ (a) You must give any other recipients of the Work or++ Derivative Works a copy of this License; and++++ (b) You must cause any modified files to carry prominent notices++ stating that You changed the files; and++++ (c) You must retain, in the Source form of any Derivative Works++ that You distribute, all copyright, patent, trademark, and++ attribution notices from the Source form of the Work,++ excluding those notices that do not pertain to any part of++ the Derivative Works; and++++ (d) If the Work includes a "NOTICE" text file as part of its++ distribution, then any Derivative Works that You distribute must++ include a readable copy of the attribution notices contained++ within such NOTICE file, excluding those notices that do not++ pertain to any part of the Derivative Works, in at least one++ of the following places: within a NOTICE text file distributed++ as part of the Derivative Works; within the Source form or++ documentation, if provided along with the Derivative Works; or,++ within a display generated by the Derivative Works, if and++ wherever such third-party notices normally appear. The contents++ of the NOTICE file are for informational purposes only and++ do not modify the License. You may add Your own attribution++ notices within Derivative Works that You distribute, alongside++ or as an addendum to the NOTICE text from the Work, provided++ that such additional attribution notices cannot be construed++ as modifying the License.++++ You may add Your own copyright statement to Your modifications and++ may provide additional or different license terms and conditions++ for use, reproduction, or distribution of Your modifications, or++ for any such Derivative Works as a whole, provided Your use,++ reproduction, and distribution of the Work otherwise complies with++ the conditions stated in this License.++++ 5. Submission of Contributions. Unless You explicitly state otherwise,++ any Contribution intentionally submitted for inclusion in the Work++ by You to the Licensor shall be under the terms and conditions of++ this License, without any additional terms or conditions.++ Notwithstanding the above, nothing herein shall supersede or modify++ the terms of any separate license agreement you may have executed++ with Licensor regarding such Contributions.++++ 6. Trademarks. This License does not grant permission to use the trade++ names, trademarks, service marks, or product names of the Licensor,++ except as required for reasonable and customary use in describing the++ origin of the Work and reproducing the content of the NOTICE file.++++ 7. Disclaimer of Warranty. Unless required by applicable law or++ agreed to in writing, Licensor provides the Work (and each++ Contributor provides its Contributions) on an "AS IS" BASIS,++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or++ implied, including, without limitation, any warranties or conditions++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A++ PARTICULAR PURPOSE. You are solely responsible for determining the++ appropriateness of using or redistributing the Work and assume any++ risks associated with Your exercise of permissions under this License.++++ 8. Limitation of Liability. In no event and under no legal theory,++ whether in tort (including negligence), contract, or otherwise,++ unless required by applicable law (such as deliberate and grossly++ negligent acts) or agreed to in writing, shall any Contributor be++ liable to You for damages, including any direct, indirect, special,++ incidental, or consequential damages of any character arising as a++ result of this License or out of the use or inability to use the++ Work (including but not limited to damages for loss of goodwill,++ work stoppage, computer failure or malfunction, or any and all++ other commercial damages or losses), even if such Contributor++ has been advised of the possibility of such damages.++++ 9. Accepting Warranty or Additional Liability. While redistributing++ the Work or Derivative Works thereof, You may choose to offer,++ and charge a fee for, acceptance of support, warranty, indemnity,++ or other liability obligations and/or rights consistent with this++ License. However, in accepting such obligations, You may act only++ on Your own behalf and on Your sole responsibility, not on behalf++ of any other Contributor, and only if You agree to indemnify,++ defend, and hold each Contributor harmless for any liability++ incurred by, or claims asserted against, such Contributor by reason++ of your accepting any such warranty or additional liability.++++ END OF TERMS AND CONDITIONS++++ APPENDIX: How to apply the Apache License to your work.++++ To apply the Apache License to your work, attach the following++ boilerplate notice, with the fields enclosed by brackets "[]"++ replaced with your own identifying information. (Don't include++ the brackets!) The text should be enclosed in the appropriate++ comment syntax for the file format. We also recommend that a++ file or class name and description of purpose be included on the++ same "printed page" as the copyright notice for easier++ identification within third-party archives.++++ Copyright [yyyy] [name of copyright owner]++++ Licensed under the Apache License, Version 2.0 (the "License");++ you may not use this file except in compliance with the License.++ You may obtain a copy of the License at++++ http://www.apache.org/licenses/LICENSE-2.0++++ Unless required by applicable law or agreed to in writing, software++ distributed under the License is distributed on an "AS IS" BASIS,++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.++ See the License for the specific language governing permissions and++ limitations under the License.diff --cc solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Cell.javaindex 0f2b24baeed,0f2b24baeed..d1a3626b56b--- a/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Cell.java+++ b/solr/solrj/src/java/org/apache/solr/cloud/autoscaling/Cell.java@@@ -1,57 -1,57 +1,7 @@@--/*-- * Licensed to the Apache Software Foundation (ASF) under one or more-- * contributor license agreements. See the NOTICE file distributed with-- * this work for additional information regarding copyright ownership.-- * The ASF licenses this file to You under the Apache License, Version 2.0-- * (the "License"); you may not use this file except in compliance with-- * the License. You may obtain a copy of the License at-- *-- * http://www.apache.org/licenses/LICENSE-2.0-- *-- * Unless required by applicable law or agreed to in writing, software-- * distributed under the License is distributed on an "AS IS" BASIS,-- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-- * See the License for the specific language governing permissions and-- * limitations under the License.-- */--package org.apache.solr.cloud.autoscaling;--import java.io.IOException;--import java.util.HashMap;----import org.apache.solr.common.MapWriter;--import org.apache.solr.common.util.Utils;----class Cell implements MapWriter {-- final int index;-- final String name;-- Object val, approxVal;---- Cell(int index, String name, Object val) {-- this.index = index;-- this.name = name;-- this.val = val;-- }---- Cell(int index, String name, Object val, Object approxVal) {-- this.index = index;-- this.name = name;-- this.val = val;-- this.approxVal = approxVal;-- }---- @Override-- public void writeMap(EntryWriter ew) throws IOException {-- ew.put(name, val);-- }---- @Override-- public String toString() {-- return Utils.toJSONString(this.toMap(new HashMap<>()));-- }---- public Cell copy() {-- return new Cell(index, name, val, approxVal);-- }++/**++ * Created by shalin on 6/6/17.++ */++public class Cell {}