diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index dcf170a2b6b..8b23dacac45 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -100,7 +100,6 @@ allprojects { prj -> '-Xep:InvalidBlockTag:OFF', // this is needed for tags like lucene.internal '-Xep:JavaUtilDate:OFF', '-Xep:LogicalAssignment:OFF', - '-Xep:MissingOverride:OFF', '-Xep:MissingSummary:OFF', '-Xep:MixedMutabilityReturnType:OFF', '-Xep:ModifiedButNotUsed:OFF', diff --git a/solr/benchmark/src/java/org/apache/solr/bench/SplittableRandomGenerator.java b/solr/benchmark/src/java/org/apache/solr/bench/SplittableRandomGenerator.java index 6e60f6a9789..bf2e2ac1ab5 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/SplittableRandomGenerator.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/SplittableRandomGenerator.java @@ -48,10 +48,12 @@ public SplittableRandomGenerator(long seed) { this.random = new SplittableRandom(seed); } + @Override public void setSeed(int seed) { setSeed((long) seed); } + @Override public void setSeed(int[] seed) { setSeed(RandomGeneratorFactory.convertToLong(seed)); } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/generators/Tracker.java b/solr/benchmark/src/java/org/apache/solr/bench/generators/Tracker.java index e28a73a0785..457d411a1a1 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/generators/Tracker.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/generators/Tracker.java @@ -163,6 +163,7 @@ public List values() { return Collections.unmodifiableList(values); } + @Override public String toString() { return String.format( Locale.ENGLISH, "%s (%s, %s%%): %s", name, count, percentage, Tracker.display(values)); diff --git a/solr/benchmark/src/java/org/quicktheories/impl/BenchmarkRandomSource.java b/solr/benchmark/src/java/org/quicktheories/impl/BenchmarkRandomSource.java index 8eefcdc839c..86deb3880d2 100644 --- a/solr/benchmark/src/java/org/quicktheories/impl/BenchmarkRandomSource.java +++ b/solr/benchmark/src/java/org/quicktheories/impl/BenchmarkRandomSource.java @@ -49,6 +49,7 @@ private BenchmarkRandomSource( this.distribution = distribution; } + @Override public BenchmarkRandomSource withDistribution(Distribution distribution) { if (this.distribution == distribution) { return this; diff --git a/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java b/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java index 468e5cbec95..12337c0e4c7 100644 --- a/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java +++ b/solr/core/src/java/org/apache/solr/api/AnnotatedApi.java @@ -337,6 +337,7 @@ void invoke(SolrQueryRequest req, SolrQueryResponse rsp, CommandOperation cmd) { } } + @Override public int hashCode() { return new HashCodeBuilder() .append(command) @@ -348,6 +349,7 @@ public int hashCode() { .toHashCode(); } + @Override public boolean equals(Object rhs) { if (null == rhs) return false; if (this == rhs) return true; diff --git a/solr/core/src/java/org/apache/solr/api/ApiBag.java b/solr/core/src/java/org/apache/solr/api/ApiBag.java index 7b55610c6c3..e8039401c90 100644 --- a/solr/core/src/java/org/apache/solr/api/ApiBag.java +++ b/solr/core/src/java/org/apache/solr/api/ApiBag.java @@ -264,6 +264,7 @@ public IntrospectApi(Api base, boolean isCoreSpecific) { this.isCoreSpecific = isCoreSpecific; } + @Override @SuppressWarnings({"unchecked"}) public void call(SolrQueryRequest req, SolrQueryResponse rsp) { diff --git a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java index 4e3511a9d30..41d3c11417e 100644 --- a/solr/core/src/java/org/apache/solr/api/V2HttpCall.java +++ b/solr/core/src/java/org/apache/solr/api/V2HttpCall.java @@ -93,6 +93,7 @@ public V2HttpCall( super(solrDispatchFilter, cc, request, response, retry); } + @Override @SuppressForbidden( reason = "Set the thread contextClassLoader for all 3rd party dependencies that we cannot control") diff --git a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java index dd89d4ca2ac..42fe526b2a8 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java +++ b/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java @@ -49,6 +49,7 @@ public ElectionContext( this.zkClient = zkClient; } + @Override public void close() {} public void cancelElection() throws InterruptedException, KeeperException { diff --git a/solr/core/src/java/org/apache/solr/cloud/ExclusiveSliceProperty.java b/solr/core/src/java/org/apache/solr/cloud/ExclusiveSliceProperty.java index e4335f1678e..82639a13958 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ExclusiveSliceProperty.java +++ b/solr/core/src/java/org/apache/solr/cloud/ExclusiveSliceProperty.java @@ -402,6 +402,7 @@ private static class SliceReplica { this.replica = replica; } + @Override public String toString() { StringBuilder sb = new StringBuilder(System.lineSeparator()).append(System.lineSeparator()); sb.append(" :") diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java index 53b9f9cbfde..6736affd526 100644 --- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java +++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java @@ -929,6 +929,7 @@ public synchronized OverseerThread getUpdaterThread() { return updaterThread; } + @Override public synchronized void close() { if (this.id != null) { log.info("Overseer (id={}) closing", id); diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java index 28f77f2190e..ae5386b7e51 100644 --- a/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java +++ b/solr/core/src/java/org/apache/solr/cloud/OverseerTaskProcessor.java @@ -418,6 +418,7 @@ private void cleanUpWorkQueue() throws KeeperException, InterruptedException { } } + @Override public void close() { isClosed = true; overseerTaskProcessorMetricsContext.unregister(); @@ -548,6 +549,7 @@ public Runner( response = null; } + @Override public void run() { String statsName = messageHandler.getTimerName(operation); final Timer.Context timerContext = stats.time(statsName); diff --git a/solr/core/src/java/org/apache/solr/cloud/RefreshCollectionMessage.java b/solr/core/src/java/org/apache/solr/cloud/RefreshCollectionMessage.java index 63628ab0f2c..fee0d32bf50 100644 --- a/solr/core/src/java/org/apache/solr/cloud/RefreshCollectionMessage.java +++ b/solr/core/src/java/org/apache/solr/cloud/RefreshCollectionMessage.java @@ -33,6 +33,7 @@ public RefreshCollectionMessage(String collection) { this.collection = collection; } + @Override public ClusterState run(ClusterState clusterState, Overseer overseer, ZkStateWriter zkStateWriter) throws Exception { Stat stat = diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkCollectionTerms.java b/solr/core/src/java/org/apache/solr/cloud/ZkCollectionTerms.java index 23f69eeda39..56726c6f506 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkCollectionTerms.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkCollectionTerms.java @@ -58,6 +58,7 @@ public void remove(String shardId, CoreDescriptor coreDescriptor) { } } + @Override public void close() { synchronized (terms) { terms.values().forEach(ZkShardTerms::close); diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java b/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java index f6e4625da45..44ea1a8b78a 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java @@ -174,6 +174,7 @@ public void deleteFilesFromConfig(String configName, List filesToDelete) } } + @Override public void copyConfig(String fromConfig, String toConfig) throws IOException { String fromConfigPath = CONFIGS_ZKNODE + "/" + fromConfig; String toConfigPath = CONFIGS_ZKNODE + "/" + toConfig; diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index 66d1380c0f9..47ac97e1f8b 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -275,6 +275,7 @@ private class RegisterCoreAsync implements Callable { this.afterExpiration = afterExpiration; } + @Override public Object call() throws Exception { if (log.isInfoEnabled()) { log.info("Registering core {} afterExpiration? {}", descriptor.getName(), afterExpiration); @@ -737,6 +738,7 @@ public void preClose() { } /** Closes the underlying ZooKeeper client. */ + @Override public void close() { if (!this.isClosed) preClose(); diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java index 0066d95e885..56f8c61c188 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java @@ -38,6 +38,7 @@ public ZkDistributedCollectionLockFactory(SolrZkClient zkClient, String rootPath super(zkClient, rootPath); } + @Override public DistributedLock createLock( boolean isWriteLock, CollectionParams.LockLevel level, diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java index dd5220821ec..4ea61f63f77 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java @@ -35,6 +35,7 @@ public ZkDistributedConfigSetLockFactory(SolrZkClient zkClient, String rootPath) super(zkClient, rootPath); } + @Override public DistributedLock createLock(boolean isWriteLock, String configSetName) { Preconditions.checkArgument(configSetName != null, "configSetName can't be null"); diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkShardTerms.java b/solr/core/src/java/org/apache/solr/cloud/ZkShardTerms.java index 972e0111474..796e7961a93 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkShardTerms.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkShardTerms.java @@ -155,6 +155,7 @@ public boolean registered(String coreNodeName) { return terms.get().getTerm(coreNodeName) != null; } + @Override public void close() { // no watcher will be registered isClosed.set(true); diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java index 4b75947c227..8989b29907e 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java @@ -185,6 +185,7 @@ CollApiCmds.CollectionApiCommand getActionCommand(CollectionParams.CollectionAct } public static class MockOperationCmd implements CollectionApiCommand { + @Override @SuppressForbidden(reason = "Needs currentTimeMillis for mock requests") public void call(ClusterState state, ZkNodeProps message, NamedList results) throws InterruptedException { @@ -207,6 +208,7 @@ public ReloadCollectionCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) { ModifiableSolrParams params = new ModifiableSolrParams(); params.set(CoreAdminParams.ACTION, CoreAdminParams.CoreAdminAction.RELOAD.toString()); @@ -231,6 +233,7 @@ public RebalanceLeadersCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) throws Exception { CollectionHandlingUtils.checkRequired( @@ -275,6 +278,7 @@ public AddReplicaPropCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) throws Exception { CollectionHandlingUtils.checkRequired( @@ -308,6 +312,7 @@ public DeleteReplicaPropCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) throws Exception { CollectionHandlingUtils.checkRequired( @@ -336,6 +341,7 @@ public BalanceShardsUniqueCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) throws Exception { if (StringUtils.isBlank(message.getStr(COLLECTION_PROP)) @@ -371,6 +377,7 @@ public ModifyCollectionCmd(CollectionCommandContext ccc) { this.ccc = ccc; } + @Override public void call(ClusterState clusterState, ZkNodeProps message, NamedList results) throws Exception { diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OcmhCollectionCommandContext.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OcmhCollectionCommandContext.java index 7677da01b40..7fdcff7f52b 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OcmhCollectionCommandContext.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OcmhCollectionCommandContext.java @@ -72,6 +72,7 @@ public void offerStateUpdate(byte[] data) throws KeeperException, InterruptedExc ocmh.overseer.offerStateUpdate(data); } + @Override public void offerStateUpdate(MapWriter mw) throws KeeperException, InterruptedException { ocmh.overseer.offerStateUpdate(mw); } diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java index 2c5a114f37c..9da286faeae 100644 --- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java +++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java @@ -75,6 +75,7 @@ public NodeMetricImpl(String key, Function converter) { this.registry = Registry.UNSPECIFIED; } + @Override public Registry getRegistry() { return registry; } diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginAssignStrategy.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginAssignStrategy.java index 4c2bec84ba5..d7d94644461 100644 --- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginAssignStrategy.java +++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/PlacementPluginAssignStrategy.java @@ -45,6 +45,7 @@ public PlacementPluginAssignStrategy(PlacementPlugin plugin) { this.plugin = plugin; } + @Override public List assign( SolrCloudManager solrCloudManager, List assignRequests) throws Assign.AssignmentException, IOException, InterruptedException { diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java index 9eec9b5f775..bfd6ff77f7f 100644 --- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java +++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/SimpleClusterAbstractionsImpl.java @@ -81,6 +81,7 @@ public Set getLiveNodes() { return liveNodes; } + @Override public Set getLiveDataNodes() { return liveNodesWithData; } @@ -132,6 +133,7 @@ public String toString() { * comparing node names given that new instances of {@link Node} are created with names equal to * existing instances (See {@link ReplicaImpl} constructor). */ + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -146,6 +148,7 @@ public boolean equals(Object obj) { return Objects.equals(this.nodeName, other.nodeName); } + @Override public int hashCode() { return Objects.hashCode(nodeName); } @@ -300,6 +303,7 @@ public ShardState getState() { return shardState; } + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -318,6 +322,7 @@ public boolean equals(Object obj) { && Objects.equals(this.leader, other.leader); } + @Override public int hashCode() { return Objects.hash(shardName, collection, shardState); } @@ -461,6 +466,7 @@ static org.apache.solr.common.cloud.Replica.Type toCloudReplicaType(ReplicaType } } + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -480,6 +486,7 @@ public boolean equals(Object obj) { && Objects.equals(this.node, other.node); } + @Override public int hashCode() { return Objects.hash(replicaName, coreName, shard, replicaType, replicaState, node); } diff --git a/solr/core/src/java/org/apache/solr/core/CoreSorter.java b/solr/core/src/java/org/apache/solr/core/CoreSorter.java index b0e5f00a70f..1eb59422b53 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreSorter.java +++ b/solr/core/src/java/org/apache/solr/core/CoreSorter.java @@ -120,6 +120,7 @@ CoreSorter init(CoreContainer cc, Collection coreDescriptors) { return this; } + @Override public int compare(CoreDescriptor cd1, CoreDescriptor cd2) { String s1 = getShardName(cd1.getCloudDescriptor()); String s2 = getShardName(cd2.getCloudDescriptor()); diff --git a/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java index f5455a3c0f6..f937e3cae8f 100644 --- a/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/EphemeralDirectoryFactory.java @@ -45,6 +45,7 @@ public boolean exists(String path) throws IOException { } } + @Override public boolean isPersistent() { return false; } @@ -64,6 +65,7 @@ public void remove(String path) throws IOException { // ram dir does not persist its dir anywhere } + @Override public void cleanupOldIndexDirectories( final String dataDirPath, final String currentIndexDirPath, boolean reload) { // currently a no-op diff --git a/solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java b/solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java index 2d97f182c0e..d8ee6325779 100644 --- a/solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java +++ b/solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java @@ -75,6 +75,7 @@ public void deleteFilesFromConfig(String configName, List filesToDelete) throw new UnsupportedOperationException(); } + @Override public void copyConfig(String fromConfig, String toConfig) throws IOException { throw new UnsupportedOperationException(); } diff --git a/solr/core/src/java/org/apache/solr/core/PluginBag.java b/solr/core/src/java/org/apache/solr/core/PluginBag.java index bdf8bfeb307..5ecf681ad62 100644 --- a/solr/core/src/java/org/apache/solr/core/PluginBag.java +++ b/solr/core/src/java/org/apache/solr/core/PluginBag.java @@ -398,6 +398,7 @@ public Optional getInstance() { return Optional.ofNullable(inst); } + @Override public T get() { return inst; } @@ -435,6 +436,7 @@ public PluginInfo getPluginInfo() { return pluginInfo; } + @Override public String toString() { return String.valueOf(inst); } diff --git a/solr/core/src/java/org/apache/solr/core/PluginInfo.java b/solr/core/src/java/org/apache/solr/core/PluginInfo.java index aa81eb94e94..0331b084045 100644 --- a/solr/core/src/java/org/apache/solr/core/PluginInfo.java +++ b/solr/core/src/java/org/apache/solr/core/PluginInfo.java @@ -223,6 +223,7 @@ public PluginInfo getChild(String type) { return l.isEmpty() ? null : l.get(0); } + @Override @SuppressWarnings({"unchecked", "rawtypes"}) public Map toMap(Map map) { map.putAll(attributes); diff --git a/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java b/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java index 5b62075b44b..50b46211aac 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java +++ b/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java @@ -98,6 +98,7 @@ public CommitsLoggingInfo(List commits) { this.commits = commits; } + @Override public final String toString() { StringBuilder sb = new StringBuilder(); sb.append("num=").append(commits.size()); @@ -128,6 +129,7 @@ public CommitsLoggingDebug(List commits) { super(commits); } + @Override protected void appendDetails(StringBuilder sb, IndexCommit c) { super.appendDetails(sb, c); try { diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java index 7746713494b..59641b6b912 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java +++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java @@ -600,6 +600,7 @@ public T newInstance(String name, Class expectedType) { private static final Class[] NO_CLASSES = new Class[0]; private static final Object[] NO_OBJECTS = new Object[0]; + @Override public T newInstance(String cname, Class expectedType, String... subpackages) { return newInstance(cname, expectedType, subpackages, NO_CLASSES, NO_OBJECTS); } @@ -711,6 +712,7 @@ protected void doReloadAction(Ctx ctx) { } /** Tell all {@link SolrCoreAware} instances about the SolrCore */ + @Override public void inform(SolrCore core) { if (getSchemaLoader() != null) core.getPackageListeners().addListener(schemaLoader); diff --git a/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java index 75983dd4bb4..2e53828ca78 100644 --- a/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/StandardDirectoryFactory.java @@ -81,6 +81,7 @@ public String normalize(String path) throws IOException { return super.normalize(new File(path).getCanonicalPath()); } + @Override public boolean isPersistent() { return true; } @@ -127,6 +128,7 @@ public void move(Directory fromDir, Directory toDir, String fileName, IOContext } // perform an atomic rename if possible + @Override public void renameWithOverwrite(Directory dir, String fileName, String toName) throws IOException { Directory baseDir = getBaseDir(dir); diff --git a/solr/core/src/java/org/apache/solr/handler/AnalyzeEvaluator.java b/solr/core/src/java/org/apache/solr/handler/AnalyzeEvaluator.java index d90aef5c9f6..efd8471ce3d 100644 --- a/solr/core/src/java/org/apache/solr/handler/AnalyzeEvaluator.java +++ b/solr/core/src/java/org/apache/solr/handler/AnalyzeEvaluator.java @@ -52,6 +52,7 @@ public AnalyzeEvaluator(StreamExpression expression, StreamFactory factory) thro init(_fieldName, _analyzerField); } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; Object solrCoreObj = context.get("solr-core"); diff --git a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java b/solr/core/src/java/org/apache/solr/handler/GraphHandler.java index 88304e7210a..dafa0863de6 100644 --- a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/GraphHandler.java @@ -84,6 +84,7 @@ public PermissionNameProvider.Name getPermissionName(AuthorizationContext reques return PermissionNameProvider.Name.READ_PERM; } + @Override public void inform(SolrCore core) { String defaultCollection; String defaultZkhost; @@ -130,6 +131,7 @@ public void inform(SolrCore core) { } } + @Override @SuppressWarnings({"unchecked"}) public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { SolrParams params = req.getParams(); @@ -160,6 +162,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw requestContext.put("traversal", traversal); } + @Override public String getDescription() { return "GraphHandler"; } @@ -175,20 +178,25 @@ public DummyErrorStream(Exception e) { this.e = e; } + @Override public StreamComparator getStreamSort() { return null; } + @Override public void close() {} + @Override public void open() {} public Exception getException() { return this.e; } + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { return null; } @@ -198,6 +206,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return null; } + @Override public Tuple read() { return Tuple.EXCEPTION(e.getMessage(), true); } @@ -219,23 +228,28 @@ public TimerStream(TupleStream tupleStream) { this.tupleStream = tupleStream; } + @Override public StreamComparator getStreamSort() { return this.tupleStream.getStreamSort(); } + @Override public void close() throws IOException { this.tupleStream.close(); } + @Override public void open() throws IOException { this.begin = System.nanoTime(); this.tupleStream.open(); } + @Override public void setStreamContext(StreamContext context) { this.tupleStream.setStreamContext(context); } + @Override public List children() { return this.tupleStream.children(); } @@ -245,6 +259,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return null; } + @Override public Tuple read() throws IOException { Tuple tuple = this.tupleStream.read(); if (tuple.EOF) { diff --git a/solr/core/src/java/org/apache/solr/handler/HaversineMetersEvaluator.java b/solr/core/src/java/org/apache/solr/handler/HaversineMetersEvaluator.java index 851f93fa882..5cf87a9d115 100644 --- a/solr/core/src/java/org/apache/solr/handler/HaversineMetersEvaluator.java +++ b/solr/core/src/java/org/apache/solr/handler/HaversineMetersEvaluator.java @@ -49,6 +49,7 @@ public static class HaversineDistance implements DistanceMeasure { public HaversineDistance() {} + @Override public double compute(double[] a, double[] b) throws DimensionMismatchException { return SloppyMath.haversinMeters(a[0], a[1], b[0], b[1]); } diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java index d0ab8c1da91..7cbd0519c34 100644 --- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java +++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java @@ -2020,18 +2020,22 @@ private static class DirectoryFile implements FileInterface { outStream = copy2Dir.createOutput(this.saveAs, DirectoryFactory.IOCONTEXT_NO_CACHE); } + @Override public void sync() throws IOException { copy2Dir.sync(Collections.singleton(saveAs)); } + @Override public void write(byte[] buf, int packetSize) throws IOException { outStream.writeBytes(buf, 0, packetSize); } + @Override public void close() throws Exception { outStream.close(); } + @Override public void delete() throws Exception { copy2Dir.deleteFile(saveAs); } @@ -2075,19 +2079,23 @@ private static class LocalFsFile implements FileInterface { this.fileChannel = this.fileOutputStream.getChannel(); } + @Override public void sync() throws IOException { FileUtils.sync(file); } + @Override public void write(byte[] buf, int packetSize) throws IOException { fileChannel.write(ByteBuffer.wrap(buf, 0, packetSize)); } + @Override public void close() throws Exception { // close the FileOutputStream (which also closes the Channel) fileOutputStream.close(); } + @Override public void delete() throws Exception { Files.delete(file.toPath()); } diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java index bd99c649c3d..fa24e94968b 100644 --- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java @@ -183,6 +183,7 @@ public static CommitVersionInfo build(IndexCommit commit) { return new CommitVersionInfo(generation, version); } + @Override public String toString() { return "generation=" + generation + ",version=" + version; } @@ -1681,6 +1682,7 @@ protected void extendReserveAndReleaseCommitPoint() { } } + @Override public void write(OutputStream out) throws IOException { createOutputStream(out); @@ -1807,6 +1809,7 @@ public LocalFsTlogFileStream(SolrParams solrParams) { super(solrParams); } + @Override protected Path initFile() { // if it is a tlog file read from tlog directory return Path.of(core.getUpdateHandler().getUpdateLog().getLogDir(), tlogFileName); @@ -1819,6 +1822,7 @@ public LocalFsConfFileStream(SolrParams solrParams) { super(solrParams); } + @Override protected Path initFile() { // if it is a conf file read from config directory return core.getResourceLoader().getConfigPath().resolve(cfileName); diff --git a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java index ce97be14786..9bbfa4b9049 100644 --- a/solr/core/src/java/org/apache/solr/handler/RestoreCore.java +++ b/solr/core/src/java/org/apache/solr/handler/RestoreCore.java @@ -227,22 +227,27 @@ public BasicRestoreRepository(URI backupPath, BackupRepository repository) { this.repository = repository; } + @Override public String[] listAllFiles() throws IOException { return repository.listAll(backupPath); } + @Override public IndexInput openInput(String filename) throws IOException { return repository.openInput(backupPath, filename, IOContext.READONCE); } + @Override public void repoCopy(String filename, Directory dest) throws IOException { repository.copyFileTo(backupPath, filename, dest); } + @Override public void localCopy(Directory src, String filename, Directory dest) throws IOException { dest.copyFrom(src, filename, filename, IOContext.READONCE); } + @Override public Checksum checksum(String filename) throws IOException { try (IndexInput indexInput = repository.openInput(backupPath, filename, IOContext.READONCE)) { try { @@ -298,6 +303,7 @@ public void localCopy(Directory src, String filename, Directory dest) throws IOE dest.copyFrom(src, filename, filename, IOContext.READONCE); } + @Override public Checksum checksum(String filename) { Optional backedFile = shardBackupMetadata.getFile(filename); return backedFile.map(bf -> bf.fileChecksum).orElse(null); diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java index ef957f9e42f..984ca83411a 100644 --- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java @@ -97,6 +97,7 @@ public PermissionNameProvider.Name getPermissionName(AuthorizationContext reques return PermissionNameProvider.Name.READ_PERM; } + @Override @SuppressWarnings("unchecked") public void inform(SolrCore core) { String defaultCollection; @@ -168,6 +169,7 @@ protected Object initNewInstance(SolrPackageLoader.SolrPackage.Version newest, S } } + @Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { SolrParams params = req.getParams(); params = adjustParams(params); @@ -331,6 +333,7 @@ private SolrParams adjustParams(SolrParams params) { return adjustedParams; } + @Override public String getDescription() { return "StreamHandler"; } @@ -346,16 +349,21 @@ public DummyErrorStream(Exception e) { this.e = e; } + @Override public StreamComparator getStreamSort() { return null; } + @Override public void close() {} + @Override public void open() {} + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { return null; } @@ -370,6 +378,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression("--non-expressible--"); } + @Override public Tuple read() { String msg = e.getMessage(); @@ -389,16 +398,21 @@ public DaemonCollectionStream(Collection col) { this.it = col.iterator(); } + @Override public StreamComparator getStreamSort() { return null; } + @Override public void close() {} + @Override public void open() {} + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { return null; } @@ -413,6 +427,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression("--non-expressible--"); } + @Override public Tuple read() { if (it.hasNext()) { return it.next().getInfo(); @@ -430,16 +445,21 @@ public DaemonResponseStream(String message) { this.message = message; } + @Override public StreamComparator getStreamSort() { return null; } + @Override public void close() {} + @Override public void open() {} + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { return null; } @@ -454,6 +474,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression("--non-expressible--"); } + @Override public Tuple read() { if (sendEOF) { return Tuple.EOF(); @@ -473,23 +494,28 @@ public TimerStream(TupleStream tupleStream) { this.tupleStream = tupleStream; } + @Override public StreamComparator getStreamSort() { return this.tupleStream.getStreamSort(); } + @Override public void close() throws IOException { this.tupleStream.close(); } + @Override public void open() throws IOException { this.begin = System.nanoTime(); this.tupleStream.open(); } + @Override public void setStreamContext(StreamContext context) { this.tupleStream.setStreamContext(context); } + @Override public List children() { return this.tupleStream.children(); } @@ -504,6 +530,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression("--non-expressible--"); } + @Override public Tuple read() throws IOException { Tuple tuple = this.tupleStream.read(); if (tuple.EOF) { diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java index 60ac03f9797..52f0cfd7ef9 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java @@ -200,6 +200,7 @@ public Category getCategory() { return Category.ADMIN; } + @Override public Boolean registerV2() { return true; } diff --git a/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java b/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java index 4ab96fbfd85..2296d7ed193 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java @@ -628,6 +628,7 @@ public Item(Object value, long size) { this.size = size; } + @Override public String toString() { return "size=" + size + ", value=" + value; } @@ -663,6 +664,7 @@ protected boolean lessThan(Item a, Item b) { return a.size < b.size; } + @Override public String toString() { StringBuilder sb = new StringBuilder(); Iterator it = iterator(); @@ -709,6 +711,7 @@ private static class EstimatingVisitor extends StoredFieldVisitor { * * @param value newly allocated byte array with the binary contents. */ + @Override public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { // trim the value if needed int len = value != null ? value.length : 0; @@ -722,6 +725,7 @@ public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { } /** Process a string field. */ + @Override public void stringField(FieldInfo fieldInfo, String value) throws IOException { // trim the value if needed int len = value != null ? UnicodeUtil.calcUTF16toUTF8Length(value, 0, value.length()) : 0; @@ -732,21 +736,25 @@ public void stringField(FieldInfo fieldInfo, String value) throws IOException { } /** Process a int numeric field. */ + @Override public void intField(FieldInfo fieldInfo, int value) throws IOException { countItem(fieldInfo.name, String.valueOf(value), 4); } /** Process a long numeric field. */ + @Override public void longField(FieldInfo fieldInfo, long value) throws IOException { countItem(fieldInfo.name, String.valueOf(value), 8); } /** Process a float numeric field. */ + @Override public void floatField(FieldInfo fieldInfo, float value) throws IOException { countItem(fieldInfo.name, String.valueOf(value), 4); } /** Process a double numeric field. */ + @Override public void doubleField(FieldInfo fieldInfo, double value) throws IOException { countItem(fieldInfo.name, String.valueOf(value), 8); } diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java index eda280a98c8..e38af3e2377 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java @@ -267,6 +267,7 @@ public SecurityConfig setData(InputStream securityJsonInputStream) { return setData(Utils.fromJSON(securityJsonInputStream)); } + @Override public String toString() { return "SecurityConfig: version=" + version + ", data=" + Utils.toJSONString(data); } diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java index b2ecf0b5696..7389fcd22c9 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java @@ -248,6 +248,7 @@ String getPagingHeader() { + (filter != null ? filter : ""); } + @Override public String toString() { return getPagingHeader(); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java index de5dcb7b9f8..17372d154aa 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java @@ -557,6 +557,7 @@ public GroupExpandCollector( } } + @Override public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { final int docBase = context.docBase; @@ -656,6 +657,7 @@ public NumericGroupExpandCollector( this.collapsedSet = collapsedSet; } + @Override public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { final int docBase = context.docBase; diff --git a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java index 77c0d426c32..2db476e2e6c 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java @@ -524,6 +524,7 @@ private void enqueuePivotFacetShardRequests(ResponseBuilder rb, int shardNum) { rb.addRequest(this, shardsRefineRequestPivot); } + @Override public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) { if (!rb.doFacets) return; @@ -1451,6 +1452,7 @@ public static class DistribFieldFacet extends FieldFacet { counted = new FixedBitSet[rb.shards.length]; } + @Override protected void fillParams(ResponseBuilder rb, SolrParams params, String field) { super.fillParams(rb, params, field); this.overrequestRatio = diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java index 1cd131560a2..5c32d29e85a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java @@ -190,6 +190,7 @@ public void onSuccess(LBSolrClient.Rsp rsp) { responses.add(srsp); } + @Override public void onFailure(Throwable throwable) { ssr.elapsedTime = TimeUnit.MILLISECONDS.convert( @@ -408,6 +409,7 @@ private boolean canShortCircuit( return false; } + @Override public ShardHandlerFactory getShardHandlerFactory() { return httpShardHandlerFactory; } diff --git a/solr/core/src/java/org/apache/solr/handler/component/IterativeMergeStrategy.java b/solr/core/src/java/org/apache/solr/handler/component/IterativeMergeStrategy.java index 5729128729a..bbd4ec9f42c 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/IterativeMergeStrategy.java +++ b/solr/core/src/java/org/apache/solr/handler/component/IterativeMergeStrategy.java @@ -47,6 +47,7 @@ public abstract class IterativeMergeStrategy implements MergeStrategy { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Override public void merge(ResponseBuilder rb, ShardRequest sreq) { rb._responseDocs = new SolrDocumentList(); // Null pointers will occur otherwise. rb.onePassDistributedQuery = true; // Turn off the second pass distributed. @@ -64,18 +65,22 @@ public void merge(ResponseBuilder rb, ShardRequest sreq) { } } + @Override public boolean mergesIds() { return true; } + @Override public int getCost() { return 0; } + @Override public boolean handlesMergeFields() { return false; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} public class CallBack implements Callable { @@ -103,6 +108,7 @@ public ShardResponse getOriginalShardResponse() { return this.originalShardResponse; } + @Override public CallBack call() throws Exception { this.response = req.process(solrClient); return this; diff --git a/solr/core/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java b/solr/core/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java index 608ca319470..0f220e0d99a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/MoreLikeThisComponent.java @@ -273,6 +273,7 @@ public SolrDocumentList mergeSolrDocumentList( // hmm...we are ordering by scores that are not really comparable... Comparator c = new Comparator() { + @Override public int compare(SolrDocument o1, SolrDocument o2) { Float f1 = getFloat(o1); Float f2 = getFloat(o2); diff --git a/solr/core/src/java/org/apache/solr/handler/component/PhrasesIdentificationComponent.java b/solr/core/src/java/org/apache/solr/handler/component/PhrasesIdentificationComponent.java index 8f3cdb81f6b..5d8cf03849a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PhrasesIdentificationComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PhrasesIdentificationComponent.java @@ -859,6 +859,7 @@ private Phrase() { private final Map phrase_df = new TreeMap<>(); private final Map fieldScores = new TreeMap<>(); + @Override public String toString() { return "'" + subSequence diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java index d781fb04969..270c839eb5a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java @@ -156,6 +156,7 @@ public void mergeResponseFromShard( } } + @Override public String toString() { return "[" + facetStr + "] | " + this.getKey(); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java index abf944fc197..d62ea39649a 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetField.java @@ -392,6 +392,7 @@ public void contributeFromShard( } } + @Override public String toString() { return String.format(Locale.ROOT, "P:%s F:%s V:%s", parentValue, field, valueCollection); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetFieldValueCollection.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetFieldValueCollection.java index bc2495d78c8..f39c70ae0b5 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetFieldValueCollection.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetFieldValueCollection.java @@ -314,6 +314,7 @@ public void remove() { /** Sorts {@link PivotFacetValue} instances by their count */ public static class PivotFacetCountComparator implements Comparator { + @Override public int compare(PivotFacetValue left, PivotFacetValue right) { int countCmp = right.getCount() - left.getCount(); return (0 != countCmp) ? countCmp : compareWithNullLast(left.getValue(), right.getValue()); @@ -322,6 +323,7 @@ public int compare(PivotFacetValue left, PivotFacetValue right) { /** Sorts {@link PivotFacetValue} instances by their value */ public static class PivotFacetValueComparator implements Comparator { + @Override public int compare(PivotFacetValue left, PivotFacetValue right) { return compareWithNullLast(left.getValue(), right.getValue()); } @@ -345,6 +347,7 @@ static int compareWithNullLast(final Comparable o1, final Comparable o2) { return o1.compareTo(o2); } + @Override public String toString() { return String.format(Locale.ROOT, "Values:%s | Missing:%s ", explicitValues, missingValue); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetValue.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetValue.java index 9f48df8c058..134364be3ce 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetValue.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetValue.java @@ -264,6 +264,7 @@ public void mergeContributionFromShard( } } + @Override public String toString() { return String.format( Locale.ROOT, diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java index 5da64036fd6..7b93db06a22 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java @@ -1481,14 +1481,17 @@ public RTGResultContext( /** * @returns null */ + @Override public DocList getDocList() { return null; } + @Override public ReturnFields getReturnFields() { return this.returnFields; } + @Override public SolrIndexSearcher getSearcher() { return this.searcher; } @@ -1496,10 +1499,12 @@ public SolrIndexSearcher getSearcher() { /** * @returns null */ + @Override public Query getQuery() { return null; } + @Override public SolrQueryRequest getRequest() { return this.req; } @@ -1507,6 +1512,7 @@ public SolrQueryRequest getRequest() { /** * @returns null */ + @Override public Iterator getProcessedDocuments() { return null; } diff --git a/solr/core/src/java/org/apache/solr/handler/component/StatsField.java b/solr/core/src/java/org/apache/solr/handler/component/StatsField.java index c58124edaa3..78b506870a1 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/StatsField.java +++ b/solr/core/src/java/org/apache/solr/handler/component/StatsField.java @@ -87,6 +87,7 @@ public static enum Stat { countDistinct(false, distinctValues), percentiles(true) { /** special for percentiles * */ + @Override boolean parseParams(StatsField sf) { String percentileParas = sf.localParams.get(this.name()); if (percentileParas != null) { @@ -118,6 +119,7 @@ boolean parseParams(StatsField sf) { }, cardinality(true) { /** special for percentiles * */ + @Override boolean parseParams(StatsField sf) { try { sf.hllOpts = HllOptions.parseHllOptions(sf.localParams, sf.schemaField); @@ -551,6 +553,7 @@ public List getTagList() { return tagList; } + @Override public String toString() { return "StatsField<" + originalParam + ">"; } diff --git a/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java b/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java index 9dd3d16c00c..cdea5a4ae2f 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java +++ b/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java @@ -363,6 +363,7 @@ public NamedList getStatsValues() { return res; } + @Override public void setNextReader(LeafReaderContext ctx) throws IOException { if (valueSource == null) { // first time we've collected local values, get the right ValueSource @@ -617,6 +618,7 @@ public void accumulate(int docID) throws IOException { } } + @Override protected void updateMinMax(EnumFieldValue min, EnumFieldValue max) { if (computeMin) { // nested if to encourage JIT to optimize aware final var? if (null != min) { diff --git a/solr/core/src/java/org/apache/solr/handler/designer/DefaultSchemaSuggester.java b/solr/core/src/java/org/apache/solr/handler/designer/DefaultSchemaSuggester.java index d6deeb5f901..82cf8273440 100644 --- a/solr/core/src/java/org/apache/solr/handler/designer/DefaultSchemaSuggester.java +++ b/solr/core/src/java/org/apache/solr/handler/designer/DefaultSchemaSuggester.java @@ -385,6 +385,7 @@ protected boolean isDateTime(List values) { return true; } + @Override public boolean isMultiValued(String name, List docs) { Map> transposed = transposeDocs(docs); List sampleValues = transposed.get(name); diff --git a/solr/core/src/java/org/apache/solr/handler/export/BoolFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/BoolFieldWriter.java index 353bcb88e3a..fbeccdc4c0d 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/BoolFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/BoolFieldWriter.java @@ -27,6 +27,7 @@ public BoolFieldWriter(String field, FieldType fieldType) { super(field, fieldType); } + @Override protected void writeBytes(MapWriter.EntryWriter ew, BytesRef ref, FieldType fieldType) throws IOException { fieldType.indexedToReadable(ref, cref); diff --git a/solr/core/src/java/org/apache/solr/handler/export/DateFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/DateFieldWriter.java index c84916ee549..c86f0eacac1 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/DateFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/DateFieldWriter.java @@ -33,6 +33,7 @@ public DateFieldWriter(String field) { this.field = field; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/DoubleComp.java b/solr/core/src/java/org/apache/solr/handler/export/DoubleComp.java index 02187763909..5803b7fc009 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/DoubleComp.java +++ b/solr/core/src/java/org/apache/solr/handler/export/DoubleComp.java @@ -23,20 +23,24 @@ interface DoubleComp { double resetValue(); static class DoubleAsc implements DoubleComp { + @Override public double resetValue() { return Double.MAX_VALUE; } + @Override public int compare(double a, double b) { return Double.compare(b, a); } } static class DoubleDesc implements DoubleComp { + @Override public double resetValue() { return -Double.MAX_VALUE; } + @Override public int compare(double a, double b) { return Double.compare(a, b); } diff --git a/solr/core/src/java/org/apache/solr/handler/export/DoubleFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/DoubleFieldWriter.java index 9d9e5989132..50cbdddb385 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/DoubleFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/DoubleFieldWriter.java @@ -32,6 +32,7 @@ public DoubleFieldWriter(String field) { this.field = field; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/DoubleValue.java b/solr/core/src/java/org/apache/solr/handler/export/DoubleValue.java index b537f1849e8..4d9ab03e7c8 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/DoubleValue.java +++ b/solr/core/src/java/org/apache/solr/handler/export/DoubleValue.java @@ -40,25 +40,30 @@ public DoubleValue(String field, DoubleComp comp) { this.present = false; } + @Override public Object getCurrentValue() { assert present == true; return currentValue; } + @Override public String getField() { return field; } + @Override public DoubleValue copy() { return new DoubleValue(field, comp); } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.reader = context.reader(); this.vals = DocValues.getNumeric(this.reader, this.field); lastDocID = 0; } + @Override public void setCurrentValue(int docId) throws IOException { if (docId < lastDocID) { throw new AssertionError( @@ -78,6 +83,7 @@ public void setCurrentValue(int docId) throws IOException { } } + @Override public void toGlobalValue(SortValue previousValue) {} @Override @@ -85,17 +91,20 @@ public boolean isPresent() { return present; } + @Override public void setCurrentValue(SortValue sv) { DoubleValue dv = (DoubleValue) sv; this.currentValue = dv.currentValue; this.present = dv.present; } + @Override public void reset() { this.currentValue = comp.resetValue(); this.present = false; } + @Override public int compareTo(SortValue o) { DoubleValue dv = (DoubleValue) o; return comp.compare(currentValue, dv.currentValue); diff --git a/solr/core/src/java/org/apache/solr/handler/export/ExportWriter.java b/solr/core/src/java/org/apache/solr/handler/export/ExportWriter.java index 61a76674516..cc1599562a3 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/ExportWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/ExportWriter.java @@ -179,6 +179,7 @@ protected void writeException(Exception e, PushWriter w, boolean logException) } } + @Override public void write(OutputStream os) throws IOException { try { _write(os); @@ -831,10 +832,12 @@ private void topDocs() throws IOException { } public static class IgnoreException extends IOException { + @Override public void printStackTrace(PrintWriter pw) { pw.print("Early Client Disconnect"); } + @Override public String getMessage() { return "Early Client Disconnect"; } diff --git a/solr/core/src/java/org/apache/solr/handler/export/FloatComp.java b/solr/core/src/java/org/apache/solr/handler/export/FloatComp.java index 1ce6e57f028..3d2f838866c 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/FloatComp.java +++ b/solr/core/src/java/org/apache/solr/handler/export/FloatComp.java @@ -23,20 +23,24 @@ interface FloatComp { float resetValue(); static class FloatAsc implements FloatComp { + @Override public float resetValue() { return Float.MAX_VALUE; } + @Override public int compare(float a, float b) { return Float.compare(b, a); } } static class FloatDesc implements FloatComp { + @Override public float resetValue() { return -Float.MAX_VALUE; } + @Override public int compare(float a, float b) { return Float.compare(a, b); } diff --git a/solr/core/src/java/org/apache/solr/handler/export/FloatFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/FloatFieldWriter.java index 06bd27cd112..48bd9d632ed 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/FloatFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/FloatFieldWriter.java @@ -32,6 +32,7 @@ public FloatFieldWriter(String field) { this.field = field; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/FloatValue.java b/solr/core/src/java/org/apache/solr/handler/export/FloatValue.java index 727334026bb..95d02c0ace4 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/FloatValue.java +++ b/solr/core/src/java/org/apache/solr/handler/export/FloatValue.java @@ -38,26 +38,32 @@ public FloatValue(String field, FloatComp comp) { this.present = false; } + @Override public Object getCurrentValue() { assert present == true; return currentValue; } + @Override public void toGlobalValue(SortValue previousValue) {} + @Override public String getField() { return field; } + @Override public FloatValue copy() { return new FloatValue(field, comp); } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); lastDocID = 0; } + @Override public void setCurrentValue(int docId) throws IOException { if (docId < lastDocID) { throw new AssertionError( @@ -82,17 +88,20 @@ public boolean isPresent() { return present; } + @Override public void setCurrentValue(SortValue sv) { FloatValue fv = (FloatValue) sv; this.currentValue = fv.currentValue; this.present = fv.present; } + @Override public void reset() { this.currentValue = comp.resetValue(); this.present = false; } + @Override public int compareTo(SortValue o) { FloatValue fv = (FloatValue) o; return comp.compare(currentValue, fv.currentValue); diff --git a/solr/core/src/java/org/apache/solr/handler/export/IntComp.java b/solr/core/src/java/org/apache/solr/handler/export/IntComp.java index 8ca0c236b3e..bb04ae1e159 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/IntComp.java +++ b/solr/core/src/java/org/apache/solr/handler/export/IntComp.java @@ -24,10 +24,12 @@ public interface IntComp { static class IntAsc implements IntComp { + @Override public int resetValue() { return Integer.MAX_VALUE; } + @Override public int compare(int a, int b) { return Integer.compare(b, a); } @@ -35,10 +37,12 @@ public int compare(int a, int b) { static class IntDesc implements IntComp { + @Override public int resetValue() { return Integer.MIN_VALUE; } + @Override public int compare(int a, int b) { return Integer.compare(a, b); } diff --git a/solr/core/src/java/org/apache/solr/handler/export/IntFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/IntFieldWriter.java index ce0659d5a1e..1ecef85f21b 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/IntFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/IntFieldWriter.java @@ -32,6 +32,7 @@ public IntFieldWriter(String field) { this.field = field; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/IntValue.java b/solr/core/src/java/org/apache/solr/handler/export/IntValue.java index b8a98d2b1d3..b732c40b53b 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/IntValue.java +++ b/solr/core/src/java/org/apache/solr/handler/export/IntValue.java @@ -31,15 +31,18 @@ public class IntValue implements SortValue { private int lastDocID; protected boolean present; + @Override public Object getCurrentValue() { assert present == true; return currentValue; } + @Override public String getField() { return field; } + @Override public IntValue copy() { return new IntValue(field, comp); } @@ -51,11 +54,13 @@ public IntValue(String field, IntComp comp) { this.present = false; } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); lastDocID = 0; } + @Override public void setCurrentValue(int docId) throws IOException { if (docId < lastDocID) { throw new AssertionError( @@ -75,6 +80,7 @@ public void setCurrentValue(int docId) throws IOException { } } + @Override public void toGlobalValue(SortValue previousValue) {} @Override @@ -82,17 +88,20 @@ public boolean isPresent() { return this.present; } + @Override public int compareTo(SortValue o) { IntValue iv = (IntValue) o; return comp.compare(currentValue, iv.currentValue); } + @Override public void setCurrentValue(SortValue sv) { IntValue iv = (IntValue) sv; this.currentValue = iv.currentValue; this.present = iv.present; } + @Override public void reset() { currentValue = comp.resetValue(); this.present = false; diff --git a/solr/core/src/java/org/apache/solr/handler/export/LongComp.java b/solr/core/src/java/org/apache/solr/handler/export/LongComp.java index 0637f7202f8..9388a21183e 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/LongComp.java +++ b/solr/core/src/java/org/apache/solr/handler/export/LongComp.java @@ -24,10 +24,12 @@ interface LongComp { static class LongAsc implements LongComp { + @Override public long resetValue() { return Long.MAX_VALUE; } + @Override public int compare(long a, long b) { return Long.compare(b, a); } @@ -35,10 +37,12 @@ public int compare(long a, long b) { static class LongDesc implements LongComp { + @Override public long resetValue() { return Long.MIN_VALUE; } + @Override public int compare(long a, long b) { return Long.compare(a, b); } diff --git a/solr/core/src/java/org/apache/solr/handler/export/LongFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/LongFieldWriter.java index 889abf969ff..9c18a72bd6d 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/LongFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/LongFieldWriter.java @@ -33,6 +33,7 @@ public LongFieldWriter(String field) { this.field = field; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/LongValue.java b/solr/core/src/java/org/apache/solr/handler/export/LongValue.java index cd21257d15c..81ace242e27 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/LongValue.java +++ b/solr/core/src/java/org/apache/solr/handler/export/LongValue.java @@ -38,26 +38,32 @@ public LongValue(String field, LongComp comp) { this.present = false; } + @Override public Object getCurrentValue() { assert present == true; return currentValue; } + @Override public String getField() { return field; } + @Override public LongValue copy() { return new LongValue(field, comp); } + @Override public void toGlobalValue(SortValue previousValue) {} + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); lastDocID = 0; } + @Override public void setCurrentValue(int docId) throws IOException { if (docId < lastDocID) { throw new AssertionError( @@ -82,17 +88,20 @@ public boolean isPresent() { return present; } + @Override public void setCurrentValue(SortValue sv) { LongValue lv = (LongValue) sv; this.currentValue = lv.currentValue; this.present = lv.present; } + @Override public int compareTo(SortValue o) { LongValue l = (LongValue) o; return comp.compare(currentValue, l.currentValue); } + @Override public void reset() { this.currentValue = comp.resetValue(); this.present = false; diff --git a/solr/core/src/java/org/apache/solr/handler/export/MultiFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/MultiFieldWriter.java index 863451eb217..86dd8ba82e3 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/MultiFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/MultiFieldWriter.java @@ -56,6 +56,7 @@ public MultiFieldWriter( } } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter out, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/SingleValueSortDoc.java b/solr/core/src/java/org/apache/solr/handler/export/SingleValueSortDoc.java index a8381c1a015..5e82e1d3939 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/SingleValueSortDoc.java +++ b/solr/core/src/java/org/apache/solr/handler/export/SingleValueSortDoc.java @@ -101,6 +101,7 @@ public int compareTo(SortDoc o) { } } + @Override public String toString() { return ord + ":" + docBase + ":" + docId + ":val=" + value1.toString(); } diff --git a/solr/core/src/java/org/apache/solr/handler/export/SortDoc.java b/solr/core/src/java/org/apache/solr/handler/export/SortDoc.java index 67d88bdf250..4f0febc19d3 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/SortDoc.java +++ b/solr/core/src/java/org/apache/solr/handler/export/SortDoc.java @@ -135,6 +135,7 @@ public int compareTo(SortDoc sd) { return (sd.docId + sd.docBase) - (docId + docBase); } + @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(ord).append(':').append(docBase).append(':').append(docId).append("; "); diff --git a/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java b/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java index 366b500795b..7e15704f32d 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java +++ b/solr/core/src/java/org/apache/solr/handler/export/StringFieldWriter.java @@ -55,6 +55,7 @@ public StringFieldWriter(String field, FieldType fieldType) { this.fieldType = fieldType; } + @Override public boolean write( SortDoc sortDoc, LeafReaderContext readerContext, MapWriter.EntryWriter ew, int fieldIndex) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/handler/export/StringValue.java b/solr/core/src/java/org/apache/solr/handler/export/StringValue.java index 00f0b399c52..53a427ee621 100644 --- a/solr/core/src/java/org/apache/solr/handler/export/StringValue.java +++ b/solr/core/src/java/org/apache/solr/handler/export/StringValue.java @@ -68,11 +68,13 @@ public void setLastString(String lastString) { this.lastString = lastString; } + @Override public StringValue copy() { StringValue copy = new StringValue(globalDocValues, field, comp); return copy; } + @Override public void setCurrentValue(int docId) throws IOException { // System.out.println(docId +":"+lastDocID); /* @@ -101,6 +103,7 @@ public boolean isPresent() { return present; } + @Override public void setCurrentValue(SortValue sv) { StringValue v = (StringValue) sv; this.currentOrd = v.currentOrd; @@ -110,6 +113,7 @@ public void setCurrentValue(SortValue sv) { this.toGlobal = v.toGlobal; } + @Override public Object getCurrentValue() throws IOException { assert present == true; if (currentOrd != lastOrd) { @@ -120,6 +124,7 @@ public Object getCurrentValue() throws IOException { return lastBytes; } + @Override public void toGlobalValue(SortValue previousValue) { lastOrd = currentOrd; StringValue sv = (StringValue) previousValue; @@ -136,10 +141,12 @@ public void toGlobalValue(SortValue previousValue) { } } + @Override public String getField() { return field; } + @Override public void setNextReader(LeafReaderContext context) throws IOException { leafOrd = context.ord; if (ordinalMap != null) { @@ -149,17 +156,20 @@ public void setNextReader(LeafReaderContext context) throws IOException { lastDocID = 0; } + @Override public void reset() { this.currentOrd = comp.resetValue(); this.present = false; lastDocID = 0; } + @Override public int compareTo(SortValue o) { StringValue sv = (StringValue) o; return comp.compare(currentOrd, sv.currentOrd); } + @Override public String toString() { return Integer.toString(this.currentOrd); } diff --git a/solr/core/src/java/org/apache/solr/jersey/container/ContainerRequestUtils.java b/solr/core/src/java/org/apache/solr/jersey/container/ContainerRequestUtils.java index 0d944f2cc0f..7f43820316d 100644 --- a/solr/core/src/java/org/apache/solr/jersey/container/ContainerRequestUtils.java +++ b/solr/core/src/java/org/apache/solr/jersey/container/ContainerRequestUtils.java @@ -44,18 +44,22 @@ private ContainerRequestUtils() { // all requests. public static final SecurityContext DEFAULT_SECURITY_CONTEXT = new SecurityContext() { + @Override public boolean isUserInRole(String role) { return false; } + @Override public boolean isSecure() { return false; } + @Override public Principal getUserPrincipal() { return null; } + @Override public String getAuthenticationScheme() { return null; } diff --git a/solr/core/src/java/org/apache/solr/logging/MDCSnapshot.java b/solr/core/src/java/org/apache/solr/logging/MDCSnapshot.java index 83b55d8bb04..c3e3e9bbc63 100644 --- a/solr/core/src/java/org/apache/solr/logging/MDCSnapshot.java +++ b/solr/core/src/java/org/apache/solr/logging/MDCSnapshot.java @@ -47,6 +47,7 @@ private MDCSnapshot() { this.snapshot = MDC.getCopyOfContextMap(); } + @Override public void close() { MDC.clear(); if (snapshot != null && !snapshot.isEmpty()) { // common case optimization diff --git a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java index ee340b73ed7..2cc3247a41c 100644 --- a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java +++ b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java @@ -60,6 +60,7 @@ protected class Log4j2Appender extends AbstractAppender { this.threshold = threshold; } + @Override public void append(LogEvent logEvent) { watcher.add(logEvent, logEvent.getTimeMillis()); } diff --git a/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java b/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java index fd62c6f3c49..816b8c3a3f9 100644 --- a/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java +++ b/solr/core/src/java/org/apache/solr/metrics/MetricsMap.java @@ -103,6 +103,7 @@ public Map getValue(boolean detailed) { return map; } + @Override public String toString() { return getValue().toString(); } diff --git a/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java b/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java index 206c8fe75bb..61a1a0881fb 100644 --- a/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java +++ b/solr/core/src/java/org/apache/solr/metrics/SolrMetricReporter.java @@ -50,6 +50,7 @@ protected SolrMetricReporter(SolrMetricManager metricManager, String registryNam * * @param pluginInfo the plugin's configuration */ + @Override @SuppressWarnings("unchecked") public void init(PluginInfo pluginInfo) { if (pluginInfo != null) { diff --git a/solr/core/src/java/org/apache/solr/metrics/reporters/ReporterClientCache.java b/solr/core/src/java/org/apache/solr/metrics/reporters/ReporterClientCache.java index 756f5859b59..b6465d11022 100644 --- a/solr/core/src/java/org/apache/solr/metrics/reporters/ReporterClientCache.java +++ b/solr/core/src/java/org/apache/solr/metrics/reporters/ReporterClientCache.java @@ -69,6 +69,7 @@ public synchronized T getOrCreate(String id, ClientProvider clientProvider) { } /** Empty this cache, and close all clients that are {@link Closeable}. */ + @Override public void close() { for (T client : cache.values()) { if (client instanceof Closeable) { diff --git a/solr/core/src/java/org/apache/solr/metrics/reporters/SolrJmxReporter.java b/solr/core/src/java/org/apache/solr/metrics/reporters/SolrJmxReporter.java index 0e23d66bb6b..6790a577457 100644 --- a/solr/core/src/java/org/apache/solr/metrics/reporters/SolrJmxReporter.java +++ b/solr/core/src/java/org/apache/solr/metrics/reporters/SolrJmxReporter.java @@ -66,6 +66,7 @@ public SolrJmxReporter(SolrMetricManager metricManager, String registryName) { setDomain(registryName); } + @Override protected synchronized void doInit() { if (serviceUrl != null && agentId != null) { mBeanServer = JmxUtil.findFirstMBeanServer(); diff --git a/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java b/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java index 999fdaf3750..772a56094e0 100644 --- a/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java +++ b/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java @@ -322,6 +322,7 @@ public long[] values() { return metric.getSnapshot().getValues(); } + @Override public long getSnapshotSize() { return metric.getSnapshot().size(); } diff --git a/solr/core/src/java/org/apache/solr/parser/QueryParser.java b/solr/core/src/java/org/apache/solr/parser/QueryParser.java index f1fb211c94d..7b4f90c79f5 100644 --- a/solr/core/src/java/org/apache/solr/parser/QueryParser.java +++ b/solr/core/src/java/org/apache/solr/parser/QueryParser.java @@ -137,6 +137,7 @@ protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, } // This makes sure that there is no garbage after the query string + @Override final public Query TopLevelQuery(String field) throws ParseException, SyntaxError {Query q; q = Query(field); jj_consume_token(0); @@ -773,6 +774,7 @@ protected QueryParser(CharStream stream) { } /** Reinitialise. */ + @Override public void ReInit(CharStream stream) { token_source.ReInit(stream); token = new Token(); diff --git a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java index 2ed6d572807..3bf8aa80dd1 100644 --- a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java +++ b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java @@ -93,6 +93,7 @@ public LocalPrincipal(String user) { this.user = user; } + @Override public String getName() { return user; } diff --git a/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java b/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java index 134c3421d8a..613ae31d438 100644 --- a/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java +++ b/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java @@ -67,6 +67,7 @@ public interface SolrQueryRequest extends AutoCloseable { * This method should be called when all uses of this request are finished, so that resources can * be freed. */ + @Override void close(); /** diff --git a/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java b/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java index 03fc55900ab..f1034b00bec 100644 --- a/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java +++ b/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java @@ -227,6 +227,7 @@ public Principal getUserPrincipal() { List parsedCommands; + @Override public List getCommands(boolean validateInput) { if (parsedCommands == null) { Iterable contentStreams = getContentStreams(); diff --git a/solr/core/src/java/org/apache/solr/response/DocsStreamer.java b/solr/core/src/java/org/apache/solr/response/DocsStreamer.java index 985c6fc1b76..2f1e003628c 100644 --- a/solr/core/src/java/org/apache/solr/response/DocsStreamer.java +++ b/solr/core/src/java/org/apache/solr/response/DocsStreamer.java @@ -82,10 +82,12 @@ public int currentIndex() { return idx; } + @Override public boolean hasNext() { return docIterator.hasNext(); } + @Override public SolrDocument next() { int id = docIterator.nextDoc(); idx++; diff --git a/solr/core/src/java/org/apache/solr/response/GraphMLResponseWriter.java b/solr/core/src/java/org/apache/solr/response/GraphMLResponseWriter.java index 2d1e3f2d092..84da639bd6d 100644 --- a/solr/core/src/java/org/apache/solr/response/GraphMLResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/GraphMLResponseWriter.java @@ -30,10 +30,12 @@ public class GraphMLResponseWriter implements QueryResponseWriter { + @Override public String getContentType(SolrQueryRequest req, SolrQueryResponse res) { return "application/xml"; } + @Override public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse res) throws IOException { Exception e1 = res.getException(); diff --git a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java index 7099e7e87ae..830cadb505a 100644 --- a/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java @@ -116,6 +116,7 @@ protected final boolean shouldWriteRaw(String fname, ReturnFields returnFields) } /** done with this ResponseWriter... make sure any buffers are flushed to writer */ + @Override public void close() throws IOException { if (writer != null) writer.flushBuffer(); } @@ -126,6 +127,7 @@ public boolean doIndent() { } /** returns the Writer that the response is being written to */ + @Override public Writer getWriter() { return writer; } @@ -138,23 +140,28 @@ public void setLevel(int level) { this.level = level; } + @Override public int level() { return level; } + @Override public int incLevel() { return ++level; } + @Override public int decLevel() { return --level; } + @Override public TextResponseWriter setIndent(boolean doIndent) { this.doIndent = doIndent; return this; } + @Override public final void writeVal(String name, Object val, boolean raw) throws IOException { // if there get to be enough types, perhaps hashing on the type diff --git a/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java b/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java index 32bccc65016..36ce27f5765 100644 --- a/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java +++ b/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java @@ -149,14 +149,17 @@ public NoopFieldTransformer(String field) { this.field = field; } + @Override public String getName() { return "noop"; } + @Override public String[] getExtraRequestFields() { return this.field == null ? null : new String[] {field}; } + @Override public void transform(SolrDocument doc, int docid) { // No-Op } diff --git a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedStopFilterFactory.java b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedStopFilterFactory.java index f92b0dfab2f..0691ef9c6de 100644 --- a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedStopFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedStopFilterFactory.java @@ -58,6 +58,7 @@ public String getResourceId() { } /** Returns the implementation class for managing stop words. */ + @Override protected Class getManagedResourceImplClass() { return ManagedWordSetResource.class; } diff --git a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java index e8c0075c95a..a2bce21a4b0 100644 --- a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymFilterFactory.java @@ -94,6 +94,7 @@ Set getMappings(boolean ignoreCase, String key) { return synMappings; } + @Override public String toString() { return mappings.toString(); } @@ -401,6 +402,7 @@ public String getResourceId() { return "/schema/analysis/synonyms/" + handle; } + @Override protected Class getManagedResourceImplClass() { return SynonymManager.class; } diff --git a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymGraphFilterFactory.java b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymGraphFilterFactory.java index 2cc40d2f184..7517242f05e 100644 --- a/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymGraphFilterFactory.java +++ b/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedSynonymGraphFilterFactory.java @@ -90,6 +90,7 @@ Set getMappings(boolean ignoreCase, String key) { return synMappings; } + @Override public String toString() { return mappings.toString(); } @@ -397,6 +398,7 @@ public String getResourceId() { return "/schema/analysis/synonyms/" + handle; } + @Override protected Class getManagedResourceImplClass() { return SynonymManager.class; } diff --git a/solr/core/src/java/org/apache/solr/schema/CurrencyFieldType.java b/solr/core/src/java/org/apache/solr/schema/CurrencyFieldType.java index 0dd9296768e..9b48ad63e57 100644 --- a/solr/core/src/java/org/apache/solr/schema/CurrencyFieldType.java +++ b/solr/core/src/java/org/apache/solr/schema/CurrencyFieldType.java @@ -307,6 +307,7 @@ public Query getFieldQuery(QParser parser, SchemaField field, String externalVal * @see Currency#getDefaultFractionDigits * @see #getConvertedValueSource */ + @Override public RawCurrencyValueSource getValueSource(SchemaField field, QParser parser) { getAmountField(field).checkFieldCacheSource(); getCurrencyField(field).checkFieldCacheSource(); diff --git a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java index 33ad1b62302..6a9e77c9c9b 100644 --- a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java +++ b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java @@ -162,6 +162,7 @@ public void checkSchemaField(final SchemaField field) throws SolrException { } } + @Override public List createFields(SchemaField field, Object value) { ArrayList fields = new ArrayList<>(); float[] parsedVector; diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java index e6ac7900155..34e0944c547 100644 --- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java +++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java @@ -1148,14 +1148,17 @@ private static class NameStartsWith extends DynamicPattern { super(regex, regex.substring(0, regex.length() - 1)); } + @Override boolean matches(String name) { return name.startsWith(fixedStr); } + @Override String remainder(String name) { return name.substring(fixedStr.length()); } + @Override String subst(String replacement) { return fixedStr + replacement; } @@ -1166,14 +1169,17 @@ private static class NameEndsWith extends DynamicPattern { super(regex, regex.substring(1)); } + @Override boolean matches(String name) { return name.endsWith(fixedStr); } + @Override String remainder(String name) { return name.substring(0, name.length() - fixedStr.length()); } + @Override String subst(String replacement) { return replacement + fixedStr; } @@ -1184,14 +1190,17 @@ private static class NameEquals extends DynamicPattern { super(regex, regex); } + @Override boolean matches(String name) { return regex.equals(name); } + @Override String remainder(String name) { return ""; } + @Override String subst(String replacement) { return fixedStr; } diff --git a/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java b/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java index 215f05c7ccb..72e0c783e2d 100644 --- a/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java +++ b/solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java @@ -1043,6 +1043,7 @@ private void decrementCopyFieldTargetCount(SchemaField dest) { } } + @Override public ManagedIndexSchema addFieldTypes(List fieldTypeList, boolean persist) { if (!isMutable) { String msg = "This ManagedIndexSchema is not mutable."; diff --git a/solr/core/src/java/org/apache/solr/schema/SchemaField.java b/solr/core/src/java/org/apache/solr/schema/SchemaField.java index 64c02917064..e40e1a98e06 100644 --- a/solr/core/src/java/org/apache/solr/schema/SchemaField.java +++ b/solr/core/src/java/org/apache/solr/schema/SchemaField.java @@ -102,6 +102,7 @@ public boolean indexed() { return (properties & INDEXED) != 0; } + @Override public boolean stored() { return (properties & STORED) != 0; } @@ -126,6 +127,7 @@ public boolean storeTermPayloads() { return (properties & STORE_TERMPAYLOADS) != 0; } + @Override public boolean omitNorms() { return (properties & OMIT_NORMS) != 0; } diff --git a/solr/core/src/java/org/apache/solr/schema/SortableTextField.java b/solr/core/src/java/org/apache/solr/schema/SortableTextField.java index a124872030d..f5b3a8c970a 100644 --- a/solr/core/src/java/org/apache/solr/schema/SortableTextField.java +++ b/solr/core/src/java/org/apache/solr/schema/SortableTextField.java @@ -65,6 +65,7 @@ public class SortableTextField extends TextField { private int maxCharsForDocValues = DEFAULT_MAX_CHARS_FOR_DOC_VALUES; + @Override protected void init(IndexSchema schema, Map args) { { final String maxS = args.remove("maxCharsForDocValues"); diff --git a/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java b/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java index 87249cdaf13..d37e812a891 100644 --- a/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java +++ b/solr/core/src/java/org/apache/solr/schema/ZkIndexSchemaReader.java @@ -223,10 +223,12 @@ public String getUniqueCoreId() { return uniqueCoreId; } + @Override public String toString() { return "ZkIndexSchemaReader: " + managedSchemaPath + ", uniqueCoreId: " + uniqueCoreId; } + @Override public int hashCode() { return managedSchemaPath.hashCode() + uniqueCoreId.hashCode(); } @@ -234,6 +236,7 @@ public int hashCode() { // We need the uniqueCoreId which is core name + start time nanos to be the tie breaker // as there can be multiple ZkIndexSchemaReader instances active for the same core after // a reload (one is initializing and the other is being shutdown) + @Override public boolean equals(Object other) { if (other == null) return false; if (other == this) return true; diff --git a/solr/core/src/java/org/apache/solr/search/AbstractReRankQuery.java b/solr/core/src/java/org/apache/solr/search/AbstractReRankQuery.java index 51ee5eb6a1c..f37e2372e4a 100644 --- a/solr/core/src/java/org/apache/solr/search/AbstractReRankQuery.java +++ b/solr/core/src/java/org/apache/solr/search/AbstractReRankQuery.java @@ -45,6 +45,7 @@ public AbstractReRankQuery(Query mainQuery, int reRankDocs, Rescorer reRankQuery this.reRankQueryRescorer = reRankQueryRescorer; } + @Override public RankQuery wrap(Query _mainQuery) { if (_mainQuery != null) { this.mainQuery = _mainQuery; @@ -52,10 +53,12 @@ public RankQuery wrap(Query _mainQuery) { return this; } + @Override public MergeStrategy getMergeStrategy() { return null; } + @Override @SuppressWarnings({"unchecked"}) public TopDocsCollector getTopDocsCollector( int len, QueryCommand cmd, IndexSearcher searcher) throws IOException { @@ -71,6 +74,7 @@ public TopDocsCollector getTopDocsCollector( reRankDocs, len, reRankQueryRescorer, cmd, searcher, boostedPriority); } + @Override public Query rewrite(IndexReader reader) throws IOException { Query q = mainQuery.rewrite(reader); if (q != mainQuery) { diff --git a/solr/core/src/java/org/apache/solr/search/AnalyticsQuery.java b/solr/core/src/java/org/apache/solr/search/AnalyticsQuery.java index 6868229233c..c0779b4923d 100644 --- a/solr/core/src/java/org/apache/solr/search/AnalyticsQuery.java +++ b/solr/core/src/java/org/apache/solr/search/AnalyticsQuery.java @@ -28,18 +28,22 @@ */ public abstract class AnalyticsQuery extends ExtendedQueryBase implements PostFilter { + @Override public boolean getCache() { return false; } + @Override public int getCost() { return Math.max(super.getCost(), 100); } + @Override public boolean equals(Object o) { return this == o; } + @Override public int hashCode() { return System.identityHashCode(this); } @@ -58,6 +62,7 @@ public AnalyticsQuery(MergeStrategy mergeStrategy) { rb.addMergeStrategy(mergeStrategy); } + @Override public DelegatingCollector getFilterCollector(IndexSearcher searcher) { SolrRequestInfo info = SolrRequestInfo.getRequestInfo(); ResponseBuilder rb = null; diff --git a/solr/core/src/java/org/apache/solr/search/BitDocSet.java b/solr/core/src/java/org/apache/solr/search/BitDocSet.java index 2eebe19bf2e..0e5cdbbb5f2 100644 --- a/solr/core/src/java/org/apache/solr/search/BitDocSet.java +++ b/solr/core/src/java/org/apache/solr/search/BitDocSet.java @@ -308,6 +308,7 @@ public long cost() { }; } + @Override public DocSetQuery makeQuery() { return new DocSetQuery(this); } diff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java index 8de0a4bbe53..68f7e1cdd76 100644 --- a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java @@ -195,6 +195,7 @@ public static NullPolicy fromString(String nullPolicy) { static NullPolicy DEFAULT_POLICY = IGNORE; } + @Override public QParser createParser( String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request) { return new CollapsingQParser(qstr, localParams, params, request); @@ -207,6 +208,7 @@ public CollapsingQParser( super(qstr, localParams, params, request); } + @Override public Query parse() throws SyntaxError { try { return new CollapsingPostFilter(localParams, params, req); @@ -303,14 +305,17 @@ public String getField() { return this.collapseField; } + @Override public void setCache(boolean cache) {} + @Override public boolean getCache() { return false; } // Only a subset of fields in hashCode/equals? + @Override public int hashCode() { int hashCode = classHash(); hashCode = 31 * hashCode + collapseField.hashCode(); @@ -319,6 +324,7 @@ public int hashCode() { return hashCode; } + @Override public boolean equals(Object other) { return sameClassAs(other) && equalsTo(getClass().cast(other)); } @@ -334,10 +340,12 @@ public void visit(QueryVisitor visitor) { visitor.visitLeaf(this); } + @Override public int getCost() { return Math.max(super.getCost(), 100); } + @Override public String toString(String s) { return "CollapsingPostFilter(field=" + this.collapseField @@ -435,6 +443,7 @@ public CollapsingPostFilter( this.nullPolicy = NullPolicy.fromString(localParams.get("nullPolicy")); } + @Override @SuppressWarnings({"unchecked"}) public DelegatingCollector getFilterCollector(IndexSearcher indexSearcher) { try { @@ -534,10 +543,12 @@ private static class ReaderWrapper extends FilterLeafReader { this.fieldInfos = infos; } + @Override public FieldInfos getFieldInfos() { return fieldInfos; } + @Override public SortedDocValues getSortedDocValues(String field) { return null; } @@ -563,10 +574,12 @@ private static class ScoreAndDoc extends Scorable { public float score; public int docId; + @Override public float score() { return score; } + @Override public int docID() { return docId; } @@ -1136,10 +1149,12 @@ public ScoreMode scoreMode() { return needsScores ? ScoreMode.COMPLETE : super.scoreMode(); } + @Override public void setScorer(Scorable scorer) throws IOException { this.collapseStrategy.setScorer(scorer); } + @Override public void doSetNextReader(LeafReaderContext context) throws IOException { this.contexts[context.ord] = context; this.docBase = context.docBase; @@ -1152,6 +1167,7 @@ public void doSetNextReader(LeafReaderContext context) throws IOException { } } + @Override public void collect(int contextDoc) throws IOException { int globalDoc = contextDoc + this.docBase; int ord = -1; @@ -1178,6 +1194,7 @@ public void collect(int contextDoc) throws IOException { collapseStrategy.collapse(ord, contextDoc, globalDoc); } + @Override public void finish() throws IOException { if (contexts.length == 0) { return; @@ -1393,6 +1410,7 @@ public void setScorer(Scorable scorer) throws IOException { this.collapseStrategy.setScorer(scorer); } + @Override public void doSetNextReader(LeafReaderContext context) throws IOException { this.contexts[context.ord] = context; this.docBase = context.docBase; @@ -1400,6 +1418,7 @@ public void doSetNextReader(LeafReaderContext context) throws IOException { this.collapseValues = DocValues.getNumeric(context.reader(), this.collapseField); } + @Override public void collect(int contextDoc) throws IOException { final int globalDoc = contextDoc + this.docBase; if (collapseValues.advanceExact(contextDoc)) { @@ -1422,6 +1441,7 @@ public void collect(int contextDoc) throws IOException { } } + @Override public void finish() throws IOException { if (contexts.length == 0) { return; @@ -2373,10 +2393,12 @@ public OrdIntStrategy( } } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.minMaxValues = DocValues.getNumeric(context.reader(), this.field); } + @Override public void collapse(int ord, int contextDoc, int globalDoc) throws IOException { int currentVal; @@ -2448,10 +2470,12 @@ public OrdFloatStrategy( } } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.minMaxValues = DocValues.getNumeric(context.reader(), this.field); } + @Override public void collapse(int ord, int contextDoc, int globalDoc) throws IOException { int currentMinMax; @@ -2525,10 +2549,12 @@ public OrdLongStrategy( } } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.minMaxVals = DocValues.getNumeric(context.reader(), this.field); } + @Override public void collapse(int ord, int contextDoc, int globalDoc) throws IOException { long currentVal; @@ -2609,10 +2635,12 @@ public OrdValueSourceStrategy( collapseScore.setupIfNeeded(groupHeadSelector, rcontext); } + @Override public void setNextReader(LeafReaderContext context) throws IOException { functionValues = this.valueSource.getValues(rcontext, context); } + @Override public void collapse(int ord, int contextDoc, int globalDoc) throws IOException { float score = 0; @@ -2910,6 +2938,7 @@ public IntIntStrategy( } } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.minMaxVals = DocValues.getNumeric(context.reader(), this.field); } @@ -2921,6 +2950,7 @@ private int advanceAndGetCurrentVal(int contextDoc) throws IOException { return 0; } + @Override public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOException { final int currentVal = advanceAndGetCurrentVal(contextDoc); @@ -2945,6 +2975,7 @@ public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOEx } } + @Override public void collapseNullGroup(int contextDoc, int globalDoc) throws IOException { assert NullPolicy.IGNORE.getCode() != this.nullPolicy; @@ -3001,6 +3032,7 @@ public IntFloatStrategy( } } + @Override public void setNextReader(LeafReaderContext context) throws IOException { this.minMaxVals = DocValues.getNumeric(context.reader(), this.field); } @@ -3012,6 +3044,7 @@ private float advanceAndGetCurrentVal(int contextDoc) throws IOException { return Float.intBitsToFloat(0); } + @Override public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOException { final float currentVal = advanceAndGetCurrentVal(contextDoc); @@ -3036,6 +3069,7 @@ public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOEx } } + @Override public void collapseNullGroup(int contextDoc, int globalDoc) throws IOException { assert NullPolicy.IGNORE.getCode() != this.nullPolicy; final float currentVal = advanceAndGetCurrentVal(contextDoc); @@ -3107,6 +3141,7 @@ public IntValueSourceStrategy( collapseScore.setupIfNeeded(groupHeadSelector, rcontext); } + @Override @SuppressWarnings({"unchecked"}) public void setNextReader(LeafReaderContext context) throws IOException { functionValues = this.valueSource.getValues(rcontext, context); @@ -3120,6 +3155,7 @@ private float computeScoreIfNeeded4Collapse() throws IOException { return 0F; } + @Override public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOException { float score = computeScoreIfNeeded4Collapse(); @@ -3152,6 +3188,7 @@ public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOEx } } + @Override public void collapseNullGroup(int contextDoc, int globalDoc) throws IOException { assert NullPolicy.IGNORE.getCode() != this.nullPolicy; @@ -3232,6 +3269,7 @@ private float computeScoreIfNeeded4Collapse() throws IOException { return needsScores4Collapsing ? scorer.score() : 0F; } + @Override public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOException { float score = computeScoreIfNeeded4Collapse(); @@ -3263,6 +3301,7 @@ public void collapse(int collapseKey, int contextDoc, int globalDoc) throws IOEx } } + @Override public void collapseNullGroup(int contextDoc, int globalDoc) throws IOException { assert NullPolicy.IGNORE.getCode() != this.nullPolicy; @@ -3409,6 +3448,7 @@ public void purgeGroupsThatHaveBoostedDocs( // Add the (collected) boosted docs to the collapsedSet boostedDocs.forEach( new IntProcedure() { + @Override public void apply(int globalDoc) { collapsedSet.set(globalDoc); } @@ -3693,36 +3733,42 @@ private static interface LongCompare { } private static class MaxIntComp implements IntCompare { + @Override public boolean test(int i1, int i2) { return i1 > i2; } } private static class MinIntComp implements IntCompare { + @Override public boolean test(int i1, int i2) { return i1 < i2; } } private static class MaxFloatComp implements FloatCompare { + @Override public boolean test(float i1, float i2) { return i1 > i2; } } private static class MinFloatComp implements FloatCompare { + @Override public boolean test(float i1, float i2) { return i1 < i2; } } private static class MaxLongComp implements LongCompare { + @Override public boolean test(long i1, long i2) { return i1 > i2; } } private static class MinLongComp implements LongCompare { + @Override public boolean test(long i1, long i2) { return i1 < i2; } diff --git a/solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java index 0b4fe7ba651..9d8210a8c2e 100644 --- a/solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/ComplexPhraseQParserPlugin.java @@ -122,6 +122,7 @@ public Query parse() throws SyntaxError { lparser = new ComplexPhraseQueryParser(defaultField, getReq().getSchema().getQueryAnalyzer()) { + @Override protected Query newWildcardQuery(org.apache.lucene.index.Term t) { try { org.apache.lucene.search.Query wildcardQuery = @@ -142,6 +143,7 @@ private Query setRewriteMethod(org.apache.lucene.search.Query query) { return query; } + @Override protected Query newRangeQuery( String field, String part1, diff --git a/solr/core/src/java/org/apache/solr/search/DocSet.java b/solr/core/src/java/org/apache/solr/search/DocSet.java index 2b5eedd2d00..132b8d5b3a4 100644 --- a/solr/core/src/java/org/apache/solr/search/DocSet.java +++ b/solr/core/src/java/org/apache/solr/search/DocSet.java @@ -129,6 +129,7 @@ public int andNotSize(DocSet other) { */ public abstract void addAllTo(FixedBitSet target); + @Override public abstract DocSet clone(); /** diff --git a/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java index 0ea8582b136..c55bdeba82f 100644 --- a/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/ExportQParserPlugin.java @@ -42,6 +42,7 @@ public class ExportQParserPlugin extends QParserPlugin { public static final String NAME = "xport"; + @Override public QParser createParser( String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request) { return new ExportQParser(qstr, localParams, params, request); @@ -54,6 +55,7 @@ public ExportQParser( super(qstr, localParams, params, request); } + @Override public Query parse() throws SyntaxError { try { return new ExportQuery(localParams, params, req); @@ -67,17 +69,20 @@ public class ExportQuery extends RankQuery { private Query mainQuery; private Object id; + @Override public RankQuery clone() { ExportQuery clone = new ExportQuery(); clone.id = id; return clone; } + @Override public RankQuery wrap(Query mainQuery) { this.mainQuery = mainQuery; return this; } + @Override public MergeStrategy getMergeStrategy() { return null; } @@ -88,6 +93,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo return mainQuery.createWeight(searcher, scoreMode, boost); } + @Override public Query rewrite(IndexReader reader) throws IOException { Query q = mainQuery.rewrite(reader); if (q == mainQuery) { @@ -97,6 +103,7 @@ public Query rewrite(IndexReader reader) throws IOException { } } + @Override public TopDocsCollector getTopDocsCollector( int len, QueryCommand cmd, IndexSearcher searcher) throws IOException { int leafCount = searcher.getTopReaderContext().leaves().size(); @@ -104,10 +111,12 @@ public TopDocsCollector getTopDocsCollector( return new ExportCollector(sets); } + @Override public int hashCode() { return classHash() + 31 * id.hashCode() + 31 * Objects.hash(mainQuery); } + @Override public boolean equals(Object other) { return sameClassAs(other) && equalsTo(getClass().cast(other)); } @@ -116,6 +125,7 @@ private boolean equalsTo(ExportQuery other) { return Objects.equals(id, other.id) && Objects.equals(mainQuery, other.mainQuery); } + @Override public String toString(String s) { return s; } @@ -168,6 +178,7 @@ private ScoreDoc[] getScoreDocs(int howMany) { return docs; } + @Override public TopDocs topDocs(int start, int howMany) { assert (sets != null); diff --git a/solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java index 7568eae3bcd..f9dd2619778 100644 --- a/solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/GraphTermsQParserPlugin.java @@ -180,19 +180,23 @@ private GraphTermsQuery(String field, Term[] terms, int maxDocFreq, Object id) { this.id = id; } + @Override public boolean getCache() { return false; } + @Override public void setCache(boolean cache) { // TODO support user choice } + @Override public int getCost() { // 0 is the default and keeping it avoids a needless wrapper for TwoPhaseIterator matchCost. return 0; } + @Override public void setCost(int cost) {} @Override @@ -200,14 +204,17 @@ public Query rewrite(IndexReader reader) throws IOException { return this; } + @Override public int hashCode() { return 31 * classHash() + id.hashCode(); } + @Override public boolean equals(Object other) { return sameClassAs(other) && id == ((GraphTermsQuery) other).id; } + @Override public GraphTermsQuery clone() { GraphTermsQuery clone = new GraphTermsQuery(this.field, this.queryTerms, this.maxDocFreq, this.id); diff --git a/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java index aabbeae7670..1438edeabfd 100644 --- a/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/HashQParserPlugin.java @@ -44,6 +44,7 @@ public class HashQParserPlugin extends QParserPlugin { public static final String NAME = "hash"; + @Override public QParser createParser( String query, SolrParams localParams, SolrParams params, SolrQueryRequest request) { return new HashQParser(query, localParams, params, request); @@ -56,6 +57,7 @@ public HashQParser( super(query, localParams, params, request); } + @Override public Query parse() { int workers = localParams.getInt("workers", 0); if (workers < 2) { diff --git a/solr/core/src/java/org/apache/solr/search/PointMerger.java b/solr/core/src/java/org/apache/solr/search/PointMerger.java index bade14462c6..253d466be8d 100644 --- a/solr/core/src/java/org/apache/solr/search/PointMerger.java +++ b/solr/core/src/java/org/apache/solr/search/PointMerger.java @@ -202,6 +202,7 @@ static class IntSeg extends BaseSeg { this.currentValue = this.mval = new MutableValueInt(); } + @Override public int setNextValue() throws IOException { if (readPos >= pos) { if (last != Integer.MAX_VALUE) { @@ -264,6 +265,7 @@ static class LongSeg extends BaseSeg { this.currentValue = this.mval = new MutableValueLong(); } + @Override public int setNextValue() throws IOException { if (readPos >= pos) { if (last != Long.MAX_VALUE) { @@ -326,6 +328,7 @@ static class FloatSeg extends BaseSeg { this.currentValue = this.mval = new MutableValueFloat(); } + @Override public int setNextValue() throws IOException { if (readPos >= pos) { if (last != Float.MAX_VALUE) { @@ -388,6 +391,7 @@ static class DoubleSeg extends BaseSeg { this.currentValue = this.mval = new MutableValueDouble(); } + @Override public int setNextValue() throws IOException { if (readPos >= pos) { if (last != Double.MAX_VALUE) { diff --git a/solr/core/src/java/org/apache/solr/search/ReRankCollector.java b/solr/core/src/java/org/apache/solr/search/ReRankCollector.java index c4bb7c18b86..47d4b5fda73 100644 --- a/solr/core/src/java/org/apache/solr/search/ReRankCollector.java +++ b/solr/core/src/java/org/apache/solr/search/ReRankCollector.java @@ -80,6 +80,7 @@ public ReRankCollector( this.reRankQueryRescorer = reRankQueryRescorer; } + @Override public int getTotalHits() { return mainCollector.getTotalHits(); } @@ -94,6 +95,7 @@ public ScoreMode scoreMode() { return this.mainCollector.scoreMode(); } + @Override public TopDocs topDocs(int start, int howMany) { try { @@ -180,6 +182,7 @@ public BoostedComp(IntIntHashMap boostedDocs, ScoreDoc[] scoreDocs, float maxSco } } + @Override public int compare(ScoreDoc doc1, ScoreDoc doc2) { float score1 = doc1.score; float score2 = doc2.score; diff --git a/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java index 925ef93bc45..803694ea5a9 100644 --- a/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/ReRankQParserPlugin.java @@ -44,6 +44,7 @@ public class ReRankQParserPlugin extends QParserPlugin { public static final String RERANK_WEIGHT = "reRankWeight"; public static final double RERANK_WEIGHT_DEFAULT = 2.0d; + @Override public QParser createParser( String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) { return new ReRankQParser(query, localParams, params, req); @@ -56,6 +57,7 @@ public ReRankQParser( super(query, localParams, params, req); } + @Override public Query parse() throws SyntaxError { String reRankQueryString = localParams.get(RERANK_QUERY); if (StringUtils.isBlank(reRankQueryString)) { @@ -98,6 +100,7 @@ private final class ReRankQuery extends AbstractReRankQuery { private final Query reRankQuery; private final double reRankWeight; + @Override public int hashCode() { return 31 * classHash() + mainQuery.hashCode() @@ -106,6 +109,7 @@ public int hashCode() { + reRankDocs; } + @Override public boolean equals(Object other) { return sameClassAs(other) && equalsTo(getClass().cast(other)); } @@ -135,6 +139,7 @@ public String toString(String s) { return sb.toString(); } + @Override protected Query rewrite(Query rewrittenMainQuery) throws IOException { return new ReRankQuery(reRankQuery, reRankDocs, reRankWeight).wrap(rewrittenMainQuery); } diff --git a/solr/core/src/java/org/apache/solr/search/ReRankWeight.java b/solr/core/src/java/org/apache/solr/search/ReRankWeight.java index a1d5329de7d..1d74b6e8bd0 100644 --- a/solr/core/src/java/org/apache/solr/search/ReRankWeight.java +++ b/solr/core/src/java/org/apache/solr/search/ReRankWeight.java @@ -39,6 +39,7 @@ public ReRankWeight( this.reRankQueryRescorer = reRankQueryRescorer; } + @Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { final Explanation mainExplain = in.explain(context, doc); return reRankQueryRescorer.explain(searcher, mainExplain, context.docBase + doc); diff --git a/solr/core/src/java/org/apache/solr/search/SolrCache.java b/solr/core/src/java/org/apache/solr/search/SolrCache.java index 95b249fcd03..870d18ea2c9 100644 --- a/solr/core/src/java/org/apache/solr/search/SolrCache.java +++ b/solr/core/src/java/org/apache/solr/search/SolrCache.java @@ -143,6 +143,7 @@ public enum State { // init and have the cache implementation save it. /** Frees any non-memory resources */ + @Override default void close() throws IOException { SolrInfoBean.super.close(); } diff --git a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java index 503c5fc21b0..296f67ce411 100644 --- a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java @@ -200,6 +200,7 @@ public TopLevelDocValuesTermsQuery(String field, BytesRef... terms) { this.fieldName = field; } + @Override public Weight createWeight(IndexSearcher searcher, final ScoreMode scoreMode, float boost) throws IOException { if (!(searcher instanceof SolrIndexSearcher)) { @@ -225,6 +226,7 @@ public Weight createWeight(IndexSearcher searcher, final ScoreMode scoreMode, fl } return new ConstantScoreWeight(this, boost) { + @Override public Scorer scorer(LeafReaderContext context) throws IOException { if (!matchesAtLeastOneTerm) { return null; @@ -241,6 +243,7 @@ public Scorer scorer(LeafReaderContext context) throws IOException { this.score(), scoreMode, new TwoPhaseIterator(segmentDocValues) { + @Override public boolean matches() throws IOException { topLevelDocValues.advanceExact(docBase + approximation.docID()); for (long ord = topLevelDocValues.nextOrd(); @@ -254,12 +257,14 @@ public boolean matches() throws IOException { return false; } + @Override public float matchCost() { return 10.0F; } }); } + @Override public boolean isCacheable(LeafReaderContext ctx) { return DocValues.isCacheable(ctx, new String[] {fieldName}); } diff --git a/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java index 737ebdd4c08..b72fade0065 100644 --- a/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/TextLogisticRegressionQParserPlugin.java @@ -62,6 +62,7 @@ private static class TextLogisticRegressionQParser extends QParser { super(qstr, localParams, params, req); } + @Override public Query parse() { String fs = params.get("feature"); @@ -108,6 +109,7 @@ public TextLogisticRegressionQuery(TrainingParams trainingParams) { this.trainingParams = trainingParams; } + @Override public DelegatingCollector getAnalyticsCollector( ResponseBuilder rbsp, IndexSearcher indexSearcher) { return new TextLogisticRegressionCollector(rbsp, indexSearcher, trainingParams); @@ -141,12 +143,14 @@ private static class TextLogisticRegressionCollector extends DelegatingCollector docsSet = new SparseFixedBitSet(searcher.getIndexReader().numDocs()); } + @Override public void doSetNextReader(LeafReaderContext context) throws IOException { super.doSetNextReader(context); leafReader = context.reader(); leafOutcomeValue = leafReader.getNumericDocValues(trainingParams.outcome); } + @Override public void collect(int doc) throws IOException { int outcome; if (leafOutcomeValue.advanceExact(doc)) { @@ -162,6 +166,7 @@ public void collect(int doc) throws IOException { docsSet.set(context.docBase + doc); } + @Override @SuppressWarnings({"unchecked"}) public void finish() throws IOException { diff --git a/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java b/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java index 56c7a523a9c..ea7b55a2e75 100644 --- a/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java +++ b/solr/core/src/java/org/apache/solr/search/TopLevelJoinQuery.java @@ -87,6 +87,7 @@ public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float bo final boolean toMultivalued = toSearcher.getSchema().getFieldOrNull(toField).multiValued(); return new ConstantScoreWeight(this, boost) { + @Override public Scorer scorer(LeafReaderContext context) throws IOException { if (toBitsetBounds.lower == BitsetBounds.NO_MATCHES) { return null; @@ -106,6 +107,7 @@ public Scorer scorer(LeafReaderContext context) throws IOException { this.score(), scoreMode, new TwoPhaseIterator(toApproximation) { + @Override public boolean matches() throws IOException { final boolean hasDoc = topLevelToDocValues.advanceExact(docBase + approximation.docID()); @@ -121,12 +123,14 @@ public boolean matches() throws IOException { return false; } + @Override public float matchCost() { return 10.0F; } }); } + @Override public boolean isCacheable(LeafReaderContext ctx) { return false; } @@ -261,6 +265,7 @@ public SelfJoin(String joinField, Query subQuery) { super(joinField, joinField, null, subQuery); } + @Override protected BitsetBounds convertFromOrdinalsIntoToField( LongBitSet fromOrdBitSet, SortedSetDocValues fromDocValues, diff --git a/solr/core/src/java/org/apache/solr/search/XmlQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/XmlQParserPlugin.java index 4de6953a7a3..285263405d6 100755 --- a/solr/core/src/java/org/apache/solr/search/XmlQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/XmlQParserPlugin.java @@ -82,6 +82,7 @@ public XmlQParser( super(qstr, localParams, params, req); } + @Override public Query parse() throws SyntaxError { final String qstr = getString(); if (qstr == null || qstr.isEmpty()) { @@ -101,6 +102,7 @@ public Query parse() throws SyntaxError { } } + @Override public QParser createParser( String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) { return new XmlQParser(qstr, localParams, params, req); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java index 5bb55abe27d..f0f867fadfd 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java @@ -646,12 +646,14 @@ private SlotAcc resortSlots(Slot[] slots) throws IOException { final Comparator comparator = null != indexOrderAcc ? (new Comparator() { + @Override public int compare(Slot x, Slot y) { final int cmp = resortMul * countAcc.compare(x.slot, y.slot); return cmp != 0 ? cmp : indexOrderAcc.compare(x.slot, y.slot); } }) : (new Comparator() { + @Override public int compare(Slot x, Slot y) { final int cmp = resortMul * countAcc.compare(x.slot, y.slot); return cmp != 0 ? cmp : Integer.compare(x.slot, y.slot); @@ -665,6 +667,7 @@ public int compare(Slot x, Slot y) { Arrays.sort( slots, new Comparator() { + @Override public int compare(Slot x, Slot y) { return resortMul * indexOrderAcc.compare(x.slot, y.slot); } @@ -714,12 +717,14 @@ public int compare(Slot x, Slot y) { final Comparator comparator = null != indexOrderAcc ? (new Comparator() { + @Override public int compare(Slot x, Slot y) { final int cmp = resortMul * acc.compare(x.resortSlotNum, y.resortSlotNum); return cmp != 0 ? cmp : indexOrderAcc.compare(x.slot, y.slot); } }) : (new Comparator() { + @Override public int compare(Slot x, Slot y) { final int cmp = resortMul * acc.compare(x.resortSlotNum, y.resortSlotNum); return cmp != 0 ? cmp : Integer.compare(x.slot, y.slot); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java b/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java index d659562b862..4a13ddc51af 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java @@ -109,6 +109,7 @@ static class Parser extends FacetParser { super(parent, key); } + @Override public FacetHeatmap parse(Object argsObj) { assert facet == null; diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java b/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java index 3c7edfa826c..6ef55cb4be1 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java @@ -538,6 +538,7 @@ public FacetFieldParser(FacetParser parent, String key) { facet = new FacetField(); } + @Override public FacetField parse(Object arg) throws SyntaxError { parseCommonParams(arg); if (arg instanceof String) { diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetRangeParser.java b/solr/core/src/java/org/apache/solr/search/facet/FacetRangeParser.java index a0d3675287c..8e8594e7843 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetRangeParser.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetRangeParser.java @@ -28,6 +28,7 @@ public FacetRangeParser(FacetParser parent, String key) { facet = new FacetRange(); } + @Override public FacetRange parse(Object arg) throws SyntaxError { parseCommonParams(arg); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java b/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java index f53b2993396..2b56d8596cc 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetRequest.java @@ -60,6 +60,7 @@ public FacetSort(final String sortVariable, final SortDirection sortDirection) { this.sortDirection = sortDirection; } + @Override public boolean equals(Object other) { if (other instanceof FacetSort) { final FacetSort that = (FacetSort) other; @@ -69,10 +70,12 @@ public boolean equals(Object other) { return false; } + @Override public int hashCode() { return Objects.hash(sortVariable, sortDirection); } + @Override public String toString() { return sortVariable + " " + sortDirection; } diff --git a/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java b/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java index cf2b4433b71..1a63f9fa7bf 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java @@ -145,6 +145,7 @@ public Acc(ValueSource values, FacetContext fcontext, int numSlots) { digests = new AVLTreeDigest[numSlots]; } + @Override public void collect(int doc, int slotNum, IntFunction slotContext) throws IOException { if (!values.exists(doc)) return; diff --git a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java index 2a87adcc8fe..edcc9ae6df7 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java @@ -138,6 +138,7 @@ public FunctionValues getValues(Map context, LeafReaderContext r throw new UnsupportedOperationException("NOT IMPLEMENTED " + name + " " + this); } + @Override public SlotAcc createSlotAcc(FacetContext fcontext, long numDocs, int numSlots) throws IOException { // TODO: Ideally this is where we should check fgQ/bgQ for 'null' and apply defaults... @@ -259,6 +260,7 @@ private double getRelatedness(int slot) { } } + @Override public int compare(int slotA, int slotB) { int r = Double.compare(getRelatedness(slotA), getRelatedness(slotB)); if (0 == r) { @@ -440,6 +442,7 @@ public int collect(DocSet docs, int slot, IntFunction slotContext) return docs.size(); } + @Override public int compare(int slotA, int slotB) { final BucketData a = slotvalues[slotA]; final BucketData b = slotvalues[slotB]; diff --git a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java index 753eeb174ec..11d6489f573 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java +++ b/solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java @@ -409,6 +409,7 @@ public SumSlotAcc(ValueSource values, FacetContext fcontext, int numSlots) { super(values, fcontext, numSlots); } + @Override public void collect(int doc, int slotNum, IntFunction slotContext) throws IOException { // todo: worth trying to share this value across multiple stats that need it? @@ -837,6 +838,7 @@ public CountSlotAcc(FacetContext fcontext) { public abstract void incrementCount(int slot, long count); + @Override public abstract long getCount(int slot); } diff --git a/solr/core/src/java/org/apache/solr/search/facet/SumAgg.java b/solr/core/src/java/org/apache/solr/search/facet/SumAgg.java index f7147152b20..f7fdc14ba0c 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/SumAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/SumAgg.java @@ -77,6 +77,7 @@ public void merge(Object facetResult, Context mcontext) { val += ((Number) facetResult).doubleValue(); } + @Override protected double getDouble() { return val; } diff --git a/solr/core/src/java/org/apache/solr/search/function/CollapseScoreFunction.java b/solr/core/src/java/org/apache/solr/search/function/CollapseScoreFunction.java index fc36229cf24..a25043a2214 100644 --- a/solr/core/src/java/org/apache/solr/search/function/CollapseScoreFunction.java +++ b/solr/core/src/java/org/apache/solr/search/function/CollapseScoreFunction.java @@ -25,10 +25,12 @@ public class CollapseScoreFunction extends ValueSource { + @Override public String description() { return "CollapseScoreFunction"; } + @Override public boolean equals(Object o) { if (o instanceof CollapseScoreFunction) { return true; @@ -37,10 +39,12 @@ public boolean equals(Object o) { } } + @Override public int hashCode() { return 1213241257; } + @Override public FunctionValues getValues(Map context, LeafReaderContext readerContext) throws IOException { return new CollapseScoreFunctionValues(context); @@ -55,18 +59,22 @@ public CollapseScoreFunctionValues(Map context) { assert null != this.cscore; } + @Override public int intVal(int doc) { return 0; } + @Override public String toString(int doc) { return Float.toString(cscore.score); } + @Override public float floatVal(int doc) { return cscore.score; } + @Override public double doubleVal(int doc) { return 0.0D; } diff --git a/solr/core/src/java/org/apache/solr/search/function/ConcatStringFunction.java b/solr/core/src/java/org/apache/solr/search/function/ConcatStringFunction.java index 78dd8449eed..08671c53b7a 100644 --- a/solr/core/src/java/org/apache/solr/search/function/ConcatStringFunction.java +++ b/solr/core/src/java/org/apache/solr/search/function/ConcatStringFunction.java @@ -31,6 +31,7 @@ public ConcatStringFunction(ValueSource[] sources) { super(sources); } + @Override protected String name() { return NAME; } diff --git a/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java b/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java index 9a5d8c73c60..e745a65e543 100644 --- a/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java +++ b/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java @@ -78,6 +78,7 @@ public int getNumHits() { return numHits; } + @Override public void collect(int segDoc) throws IOException { int doc = segDoc + base; if (skipSet != null && skipSet.exists(doc)) { diff --git a/solr/core/src/java/org/apache/solr/search/join/MultiValueTermOrdinalCollector.java b/solr/core/src/java/org/apache/solr/search/join/MultiValueTermOrdinalCollector.java index 26fd8cb0093..35caf7d8ed0 100644 --- a/solr/core/src/java/org/apache/solr/search/join/MultiValueTermOrdinalCollector.java +++ b/solr/core/src/java/org/apache/solr/search/join/MultiValueTermOrdinalCollector.java @@ -40,6 +40,7 @@ public MultiValueTermOrdinalCollector( this.topLevelDocValuesBitSet = topLevelDocValuesBitSet; } + @Override public ScoreMode scoreMode() { return ScoreMode.COMPLETE_NO_SCORES; } diff --git a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java index e7dbb77766c..d1316564c7d 100644 --- a/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java +++ b/solr/core/src/java/org/apache/solr/search/mlt/CloudMLTQParser.java @@ -59,6 +59,7 @@ public CloudMLTQParser( super(qstr, localParams, params, req); } + @Override public Query parse() { String id = localParams.get(QueryParsing.V); // Do a Real Time Get for the document diff --git a/solr/core/src/java/org/apache/solr/search/mlt/SimpleMLTQParser.java b/solr/core/src/java/org/apache/solr/search/mlt/SimpleMLTQParser.java index 0265831a0ef..c9aba360dce 100644 --- a/solr/core/src/java/org/apache/solr/search/mlt/SimpleMLTQParser.java +++ b/solr/core/src/java/org/apache/solr/search/mlt/SimpleMLTQParser.java @@ -52,6 +52,7 @@ public SimpleMLTQParser( super(qstr, localParams, params, req); } + @Override public Query parse() { String defaultField = req.getSchema().getUniqueKeyField().getName(); diff --git a/solr/core/src/java/org/apache/solr/search/stats/CollectionStats.java b/solr/core/src/java/org/apache/solr/search/stats/CollectionStats.java index bf1539500df..43e8a3548e6 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/CollectionStats.java +++ b/solr/core/src/java/org/apache/solr/search/stats/CollectionStats.java @@ -61,6 +61,7 @@ public CollectionStatistics toCollectionStatistics() { return new CollectionStatistics(field, maxDoc, docCount, sumTotalTermFreq, sumDocFreq); } + @Override public String toString() { return StatsUtil.colStatsToString(this); } diff --git a/solr/core/src/java/org/apache/solr/search/stats/ExactSharedStatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/ExactSharedStatsCache.java index e81b6d3a1d8..850246c8c56 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/ExactSharedStatsCache.java +++ b/solr/core/src/java/org/apache/solr/search/stats/ExactSharedStatsCache.java @@ -82,19 +82,23 @@ protected void addToPerShardTermStats( } } + @Override protected Map getPerShardColStats(ResponseBuilder rb, String shard) { return perShardColStats.get(shard); } + @Override protected TermStats getPerShardTermStats(SolrQueryRequest req, String t, String shard) { Map cache = perShardTermStats.get(shard); return (cache != null) ? cache.get(t) : null; // Term doesn't exist in shard; } + @Override protected void addToGlobalColStats(SolrQueryRequest req, Entry e) { currentGlobalColStats.put(e.getKey(), e.getValue()); } + @Override protected void addToGlobalTermStats(SolrQueryRequest req, Entry e) { currentGlobalTermStats.put(e.getKey(), e.getValue()); } diff --git a/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java index 92924d06c69..0d3f746acb0 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java +++ b/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java @@ -383,6 +383,7 @@ public ExactStatsSource( this.colStatsCache = colStatsCache; } + @Override public TermStatistics termStatistics( SolrIndexSearcher localSearcher, Term term, int docFreq, long totalTermFreq) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java index efd9f773d34..dc548c3e9d9 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java +++ b/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java @@ -97,6 +97,7 @@ public void getSnapshot(BiConsumer consumer) { consumer.accept("missingGlobalFieldStats", missingGlobalFieldStats.longValue()); } + @Override public String toString() { Map map = new HashMap<>(); getSnapshot(map::put); diff --git a/solr/core/src/java/org/apache/solr/search/stats/TermStats.java b/solr/core/src/java/org/apache/solr/search/stats/TermStats.java index 696862ca309..390d1b7e882 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/TermStats.java +++ b/solr/core/src/java/org/apache/solr/search/stats/TermStats.java @@ -64,6 +64,7 @@ public TermStatistics toTermStatistics() { return new TermStatistics(t.bytes(), docFreq, totalTermFreq); } + @Override public String toString() { return StatsUtil.termStatsToString(this, false); } diff --git a/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java b/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java index d7c20b4c5b9..cc9ca3220b9 100644 --- a/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java +++ b/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java @@ -93,6 +93,7 @@ public void init(Map pluginConfig) { } } + @Override public boolean authenticate(String username, String password) { String cred = credentials.get(username); if (cred == null || cred.isEmpty()) return false; diff --git a/solr/core/src/java/org/apache/solr/servlet/ServletInputStreamWrapper.java b/solr/core/src/java/org/apache/solr/servlet/ServletInputStreamWrapper.java index b9ba801cb37..e1719a7404a 100644 --- a/solr/core/src/java/org/apache/solr/servlet/ServletInputStreamWrapper.java +++ b/solr/core/src/java/org/apache/solr/servlet/ServletInputStreamWrapper.java @@ -37,66 +37,82 @@ public ServletInputStreamWrapper(ServletInputStream stream) throws IOException { this.stream = stream; } + @Override public int hashCode() { return stream.hashCode(); } + @Override public boolean equals(Object obj) { return stream.equals(obj); } + @Override public int available() throws IOException { return stream.available(); } + @Override public void close() throws IOException { stream.close(); } + @Override public boolean isFinished() { return stream.isFinished(); } + @Override public boolean isReady() { return stream.isReady(); } + @Override public int read() throws IOException { return stream.read(); } + @Override public int read(byte[] b) throws IOException { return stream.read(b); } + @Override public int read(byte[] b, int off, int len) throws IOException { return stream.read(b, off, len); } + @Override public void mark(int readlimit) { stream.mark(readlimit); } + @Override public boolean markSupported() { return stream.markSupported(); } + @Override public int readLine(byte[] b, int off, int len) throws IOException { return stream.readLine(b, off, len); } + @Override public void reset() throws IOException { stream.reset(); } + @Override public void setReadListener(ReadListener arg0) { stream.setReadListener(arg0); } + @Override public long skip(long n) throws IOException { return stream.skip(n); } + @Override public String toString() { return stream.toString(); } diff --git a/solr/core/src/java/org/apache/solr/servlet/ServletOutputStreamWrapper.java b/solr/core/src/java/org/apache/solr/servlet/ServletOutputStreamWrapper.java index 9a9da669c8d..b8794066f8c 100644 --- a/solr/core/src/java/org/apache/solr/servlet/ServletOutputStreamWrapper.java +++ b/solr/core/src/java/org/apache/solr/servlet/ServletOutputStreamWrapper.java @@ -37,102 +37,127 @@ public ServletOutputStreamWrapper(ServletOutputStream stream) { this.stream = stream; } + @Override public int hashCode() { return stream.hashCode(); } + @Override public boolean equals(Object obj) { return stream.equals(obj); } + @Override public void flush() throws IOException { stream.flush(); } + @Override public void close() throws IOException { stream.close(); } + @Override public boolean isReady() { return stream.isReady(); } + @Override public void print(boolean arg0) throws IOException { stream.print(arg0); } + @Override public void print(char c) throws IOException { stream.print(c); } + @Override public void print(double d) throws IOException { stream.print(d); } + @Override public void print(float f) throws IOException { stream.print(f); } + @Override public void print(int i) throws IOException { stream.print(i); } + @Override public void print(long l) throws IOException { stream.print(l); } + @Override public void print(String arg0) throws IOException { stream.print(arg0); } + @Override public void println() throws IOException { stream.println(); } + @Override public void println(boolean b) throws IOException { stream.println(b); } + @Override public void println(char c) throws IOException { stream.println(c); } + @Override public void println(double d) throws IOException { stream.println(d); } + @Override public void println(float f) throws IOException { stream.println(f); } + @Override public void println(int i) throws IOException { stream.println(i); } + @Override public void println(long l) throws IOException { stream.println(l); } + @Override public void println(String s) throws IOException { stream.println(s); } + @Override public void setWriteListener(WriteListener arg0) { stream.setWriteListener(arg0); } + @Override public void write(int b) throws IOException { stream.write(b); } + @Override public void write(byte[] b) throws IOException { stream.write(b); } + @Override public void write(byte[] b, int off, int len) throws IOException { stream.write(b, off, len); } + @Override public String toString() { return stream.toString(); } diff --git a/solr/core/src/java/org/apache/solr/uninverting/FieldCache.java b/solr/core/src/java/org/apache/solr/uninverting/FieldCache.java index fc64f880012..ef573df1bae 100644 --- a/solr/core/src/java/org/apache/solr/uninverting/FieldCache.java +++ b/solr/core/src/java/org/apache/solr/uninverting/FieldCache.java @@ -81,6 +81,7 @@ public interface Parser { *

This abstraction can be cleaned up when Parser.termsEnum is removed. */ public abstract class PointParser implements Parser { + @Override public final TermsEnum termsEnum(Terms terms) throws IOException { throw new UnsupportedOperationException("makes no sense for parsing points"); } diff --git a/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java b/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java index 91d549ef8a9..717b67e60e1 100644 --- a/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java +++ b/solr/core/src/java/org/apache/solr/uninverting/FieldCacheImpl.java @@ -913,10 +913,12 @@ public Collection getChildResources() { } } + @Override public SortedDocValues getTermsIndex(LeafReader reader, String field) throws IOException { return getTermsIndex(reader, field, PackedInts.FAST); } + @Override public SortedDocValues getTermsIndex( LeafReader reader, String field, float acceptableOverheadRatio) throws IOException { SortedDocValues valuesIn = reader.getSortedDocValues(field); @@ -1125,10 +1127,12 @@ public Collection getChildResources() { // TODO: this if DocTermsIndex was already created, we // should share it... + @Override public BinaryDocValues getTerms(LeafReader reader, String field) throws IOException { return getTerms(reader, field, PackedInts.FAST); } + @Override public BinaryDocValues getTerms(LeafReader reader, String field, float acceptableOverheadRatio) throws IOException { BinaryDocValues valuesIn = reader.getBinaryDocValues(field); @@ -1253,6 +1257,7 @@ public int length() { // TODO: this if DocTermsIndex was already created, we // should share it... + @Override public SortedSetDocValues getDocTermOrds(LeafReader reader, String field, BytesRef prefix) throws IOException { // not a general purpose filtering mechanism... diff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java index 4a8efea33fd..19b8e480265 100644 --- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java +++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java @@ -267,6 +267,7 @@ private SolrIndexWriter createMainIndexWriter(SolrCore core, String name) throws core.getCodec()); } + @Override public Sort getMergePolicySort() throws IOException { lock(iwLock.readLock()); try { diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java index 17cbda302e1..cb5690e06df 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java +++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java @@ -96,6 +96,7 @@ public void finish() { } } + @Override public void close() { clients.shutdown(); } @@ -431,6 +432,7 @@ public boolean shouldRetry(SolrError err) { return isRetry && retries < node.getMaxRetries(); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SolrCmdDistributor$Req: cmd=").append(cmd.toString()); @@ -507,6 +509,7 @@ public static class SolrError { */ public Req req; + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SolrCmdDistributor$Error: statusCode=").append(statusCode); @@ -557,10 +560,12 @@ public StdNode(ZkCoreNodeProps nodeProps, String collection, String shardId, int this.maxRetries = maxRetries; } + @Override public String getCollection() { return collection; } + @Override public String getShardId() { return shardId; } diff --git a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java index d19fda8c488..9d55511264a 100644 --- a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java +++ b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java @@ -159,6 +159,7 @@ public Builder( this.errors = errors; } + @Override public ErrorReportingConcurrentUpdateSolrClient build() { return new ErrorReportingConcurrentUpdateSolrClient(this); } diff --git a/solr/core/src/java/org/apache/solr/update/TimedVersionBucket.java b/solr/core/src/java/org/apache/solr/update/TimedVersionBucket.java index 2545ffbfd1c..abd530d85e6 100644 --- a/solr/core/src/java/org/apache/solr/update/TimedVersionBucket.java +++ b/solr/core/src/java/org/apache/solr/update/TimedVersionBucket.java @@ -51,14 +51,17 @@ public R runWithLock(int lockTimeoutMs, CheckedFunction function) } } + @Override public void unlock() { lock.unlock(); } + @Override public void signalAll() { condition.signalAll(); } + @Override public void awaitNanos(long nanosTimeout) { try { if (nanosTimeout > 0) { diff --git a/solr/core/src/java/org/apache/solr/update/TransactionLog.java b/solr/core/src/java/org/apache/solr/update/TransactionLog.java index 60fb32dc70e..55678912468 100644 --- a/solr/core/src/java/org/apache/solr/update/TransactionLog.java +++ b/solr/core/src/java/org/apache/solr/update/TransactionLog.java @@ -594,6 +594,7 @@ public void finish(UpdateLog.SyncLevel syncLevel) { } } + @Override public void close() { try { if (debug) { @@ -859,6 +860,7 @@ public FSReverseReader() throws IOException { * @return The log record, or null if EOF * @throws IOException If there is a low-level I/O error. */ + @Override public Object next() throws IOException { if (prevPos <= 0) return null; @@ -899,10 +901,12 @@ public Object next() throws IOException { } /* returns the position in the log file of the last record returned by next() */ + @Override public long position() { return prevPos + 4; // skip the length } + @Override public void close() { decref(); } diff --git a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java index f55a194df4e..38b17cc442f 100644 --- a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java +++ b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java @@ -284,6 +284,7 @@ public ExecutorService getRecoveryExecutor() { return recoveryExecutor; } + @Override public void close() { try { // do not interrupt, do not interrupt diff --git a/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java index 74956073eaa..fb4a9de1d8a 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/AllValuesOrNoneFieldMutatingUpdateProcessor.java @@ -73,6 +73,7 @@ public AllValuesOrNoneFieldMutatingUpdateProcessor( */ protected abstract Object mutateValue(final Object srcVal); + @Override protected final SolrInputField mutate(final SolrInputField srcField) { Collection vals = srcField.getValues(); if (vals == null || vals.isEmpty()) return srcField; diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java index d3ee6b0a999..1a796fd9bd6 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java @@ -1379,6 +1379,7 @@ public void testAndSetAchievedRf(int rf) { this.achievedRf = Math.min(this.achievedRf, rf); } + @Override public String toString() { StringBuilder sb = new StringBuilder("RollupRequestReplicationTracker") @@ -1424,6 +1425,7 @@ public void trackRequestResult(Node node, boolean success) { } } + @Override public String toString() { StringBuilder sb = new StringBuilder("LeaderRequestReplicationTracker"); sb.append(", achievedRf=").append(getAchievedRf()).append(" for shard ").append(myShardId); diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java index b2777988c6d..fbe89388192 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java @@ -1245,6 +1245,7 @@ public void processRollback(RollbackUpdateCommand cmd) throws IOException { } // TODO: optionally fail if n replicas are not reached... + @Override protected void doDistribFinish() { clusterState = zkController.getClusterState(); diff --git a/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java index 6a8ca31f856..d7a2a70c666 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/DocExpirationUpdateProcessorFactory.java @@ -241,6 +241,7 @@ private void initDeleteExpiredDocsScheduler(SolrCore core) { 1, new SolrNamedThreadFactory("autoExpireDocs"), new RejectedExecutionHandler() { + @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { log.warn("Skipping execution of '{}' using '{}'", r, e); } @@ -248,6 +249,7 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { core.addCloseHook( new CloseHook() { + @Override public void postClose(SolrCore core) { // update handler is gone, terminate anything that's left. @@ -257,6 +259,7 @@ public void postClose(SolrCore core) { } } + @Override public void preClose(SolrCore core) { log.info("Triggering Graceful close of DocExpiration Executor"); executor.shutdown(); @@ -358,6 +361,7 @@ public DeleteExpiredDocsRunnable(final DocExpirationUpdateProcessorFactory facto this.expireField = factory.expireField; } + @Override public void run() { // setup the request context early so the logging (including any from // shouldWeDoPeriodicDelete() ) includes the core context info diff --git a/solr/core/src/java/org/apache/solr/update/processor/NestedUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/NestedUpdateProcessorFactory.java index b81702320af..243890b80fb 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/NestedUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/NestedUpdateProcessorFactory.java @@ -37,6 +37,7 @@ */ public class NestedUpdateProcessorFactory extends UpdateRequestProcessorFactory { + @Override public UpdateRequestProcessor getInstance( SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) { boolean storeParent = shouldStoreDocParent(req.getSchema()); diff --git a/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java index dfd4f6803a3..16d7963ef1a 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/UUIDUpdateProcessorFactory.java @@ -61,6 +61,7 @@ public class UUIDUpdateProcessorFactory extends UpdateRequestProcessorFactory { protected String fieldName = null; + @Override public void init(NamedList args) { Object obj = args.remove(FIELD_PARAM); @@ -69,6 +70,7 @@ public void init(NamedList args) { } } + @Override public UpdateRequestProcessor getInstance( SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) { String fieldName = this.fieldName; diff --git a/solr/core/src/java/org/apache/solr/util/PackageTool.java b/solr/core/src/java/org/apache/solr/util/PackageTool.java index 1254e3e0db0..c045ffb5cd4 100644 --- a/solr/core/src/java/org/apache/solr/util/PackageTool.java +++ b/solr/core/src/java/org/apache/solr/util/PackageTool.java @@ -310,6 +310,7 @@ private Pair parsePackageVersion(String arg) { return new Pair<>(packageName, version); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("solrUrl") diff --git a/solr/core/src/java/org/apache/solr/util/RTimer.java b/solr/core/src/java/org/apache/solr/util/RTimer.java index e08161b503d..e4a46bffb71 100644 --- a/solr/core/src/java/org/apache/solr/util/RTimer.java +++ b/solr/core/src/java/org/apache/solr/util/RTimer.java @@ -45,10 +45,12 @@ protected interface TimerImpl { private static class NanoTimeTimerImpl implements TimerImpl { private long start; + @Override public void start() { start = System.nanoTime(); } + @Override public double elapsed() { return TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS); } diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java index c4a29717c66..c7ad6f92286 100755 --- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java +++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java @@ -161,6 +161,7 @@ protected void echo(final String msg) { stdout.println(msg); } + @Override public int runTool(CommandLine cli) throws Exception { verbose = cli.hasOption(OPTION_VERBOSE.getOpt()); @@ -195,10 +196,12 @@ protected SolrCloudTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return cloudOptions; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = cli.getOptionValue(OPTION_ZKHOST.getOpt(), ZK_HOST); @@ -694,6 +697,7 @@ public static Map getJson( @SuppressWarnings("unchecked") private static class SolrResponseHandler implements ResponseHandler> { + @Override public Map handleResponse(HttpResponse response) throws ClientProtocolException, IOException { HttpEntity entity = response.getEntity(); @@ -879,10 +883,12 @@ public StatusTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "status"; } + @Override public Option[] getOptions() { return new Option[] { Option.builder("solr") @@ -900,6 +906,7 @@ public Option[] getOptions() { }; } + @Override protected void runImpl(CommandLine cli) throws Exception { int maxWaitSecs = Integer.parseInt(cli.getOptionValue("maxWaitSecs", "0")); String solrUrl = cli.getOptionValue("solr", DEFAULT_SOLR_URL); @@ -1031,10 +1038,12 @@ public ApiTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "api"; } + @Override public Option[] getOptions() { return new Option[] { Option.builder("get") @@ -1046,6 +1055,7 @@ public Option[] getOptions() { }; } + @Override protected void runImpl(CommandLine cli) throws Exception { String getUrl = cli.getOptionValue("get"); if (getUrl != null) { @@ -1126,16 +1136,19 @@ public Map asMap() { return map; } + @Override public String toString() { CharArr arr = new CharArr(); new JSONWriter(arr, 2).write(asMap()); return arr.toString(); } + @Override public int hashCode() { return this.shard.hashCode() + (isLeader ? 1 : 0); } + @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; @@ -1144,6 +1157,7 @@ public boolean equals(Object obj) { return this.shard.equals(that.shard) && this.isLeader == that.isLeader; } + @Override public int compareTo(ReplicaHealth other) { if (this == other) return 0; if (other == null) return 1; @@ -1208,6 +1222,7 @@ public Map asMap() { return map; } + @Override public String toString() { CharArr arr = new CharArr(); new JSONWriter(arr, 2).write(asMap()); @@ -1533,14 +1548,17 @@ public CreateCollectionTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "create_collection"; } + @Override public Option[] getOptions() { return CREATE_COLLECTION_OPTIONS; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -1692,10 +1710,12 @@ public CreateCoreTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "create_core"; } + @Override public Option[] getOptions() { return new Option[] { OPTION_SOLRURL, @@ -1724,6 +1744,7 @@ public Option[] getOptions() { }; } + @Override protected void runImpl(CommandLine cli) throws Exception { String solrUrl = cli.getOptionValue("solrUrl", DEFAULT_SOLR_URL); if (!solrUrl.endsWith("/")) solrUrl += "/"; @@ -1851,14 +1872,17 @@ public CreateTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "create"; } + @Override public Option[] getOptions() { return CREATE_COLLECTION_OPTIONS; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String solrUrl = cli.getOptionValue("solrUrl", DEFAULT_SOLR_URL); @@ -1892,6 +1916,7 @@ public ConfigSetUploadTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("confname") @@ -1917,10 +1942,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "upconfig"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -1968,6 +1995,7 @@ public ConfigSetDownloadTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("confname") @@ -1987,10 +2015,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "downconfig"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2038,6 +2068,7 @@ public ZkRmTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("path") @@ -2052,10 +2083,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "rm"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2107,6 +2140,7 @@ public ZkLsTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("path") @@ -2121,10 +2155,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "ls"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2167,6 +2203,7 @@ public ZkMkrootTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("path") @@ -2180,10 +2217,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "mkroot"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2218,6 +2257,7 @@ public ZkCpTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("src") @@ -2238,10 +2278,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "cp"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2295,6 +2337,7 @@ public ZkMvTool(PrintStream stdout) { super(stdout); } + @Override public Option[] getOptions() { return new Option[] { Option.builder("src") @@ -2314,10 +2357,12 @@ public Option[] getOptions() { }; } + @Override public String getName() { return "mv"; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String zkHost = getZkHost(cli); @@ -2367,10 +2412,12 @@ public DeleteTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "delete"; } + @Override public Option[] getOptions() { return new Option[] { OPTION_SOLRURL, @@ -2397,6 +2444,7 @@ public Option[] getOptions() { }; } + @Override protected void runImpl(CommandLine cli) throws Exception { raiseLogLevelUnlessVerbose(cli); String solrUrl = cli.getOptionValue("solrUrl", DEFAULT_SOLR_URL); @@ -2568,6 +2616,7 @@ public ConfigTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "config"; } @@ -2617,6 +2666,7 @@ public Option[] getOptions() { return joinOptions(configOptions, cloudOptions); } + @Override protected void runImpl(CommandLine cli) throws Exception { String solrUrl; try { @@ -2699,10 +2749,12 @@ public RunExampleTool(Executor executor, InputStream userInput, PrintStream stdo this.userInput = userInput; } + @Override public String getName() { return "run_example"; } + @Override public Option[] getOptions() { return new Option[] { Option.builder("noprompt") @@ -2793,6 +2845,7 @@ public Option[] getOptions() { }; } + @Override protected void runImpl(CommandLine cli) throws Exception { this.urlScheme = cli.getOptionValue("urlScheme", "http"); @@ -3677,10 +3730,12 @@ public AssertTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "assert"; } + @Override public Option[] getOptions() { return new Option[] { Option.builder("R") @@ -3752,6 +3807,7 @@ public Option[] getOptions() { }; } + @Override public int runTool(CommandLine cli) throws Exception { verbose = cli.hasOption(OPTION_VERBOSE.getOpt()); @@ -4013,6 +4069,7 @@ public AuthTool(PrintStream stdout) { super(stdout); } + @Override public String getName() { return "auth"; } @@ -4021,6 +4078,7 @@ public String getName() { Arrays.asList( "SOLR_AUTHENTICATION_CLIENT_BUILDER", "SOLR_AUTH_TYPE", "SOLR_AUTHENTICATION_OPTS"); + @Override public Option[] getOptions() { return new Option[] { Option.builder("type") diff --git a/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java b/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java index ccba6c61299..06bac86b932 100644 --- a/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java +++ b/solr/core/src/java/org/apache/solr/util/configuration/providers/EnvSSLCredentialProvider.java @@ -46,6 +46,7 @@ public EnvSSLCredentialProvider() { this.envVars = System.getenv(); } + @Override protected EnumMap getCredentialKeyMap() { return Maps.newEnumMap( ImmutableMap.of( @@ -55,6 +56,7 @@ protected EnumMap getCredentialKeyMap() { SSL_CLIENT_TRUST_STORE_PASSWORD, EnvVars.SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD)); } + @Override protected String getCredential(String envKey) { if (envVars.containsKey(envKey)) { return envVars.get(envKey); diff --git a/solr/core/src/java/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProvider.java b/solr/core/src/java/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProvider.java index 4100d41cfdc..52831a32dd3 100644 --- a/solr/core/src/java/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProvider.java +++ b/solr/core/src/java/org/apache/solr/util/configuration/providers/SysPropSSLCredentialProvider.java @@ -26,6 +26,7 @@ protected EnumMap getCredentialKeyMap() { return DEFAULT_CREDENTIAL_KEY_MAP; } + @Override protected String getCredential(String syspropKey) { if (System.getProperty(syspropKey) != null) { return System.getProperty(syspropKey); diff --git a/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java index d6bd16bf06a..7702012713d 100644 --- a/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/AddReplicaTest.java @@ -42,6 +42,7 @@ public static void setupCluster() throws Exception { .configure(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java index 379345e5472..0ecb4aab598 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java @@ -55,6 +55,7 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi private final int numPullReplicas; private final int numRealtimeOrTlogReplicas; + @Override protected int getPullReplicaCount() { return numPullReplicas; } @@ -87,10 +88,12 @@ public static void afterSuperClass() { private final boolean runFullThrottle; + @Override public String[] getFieldNames() { return fieldNames; } + @Override public RandVal[] getRandValues() { return randVals; } diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java index d98f200ac5f..5469fac6ab4 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java @@ -84,10 +84,12 @@ public static void afterSuperClass() { protected static final String[] fieldNames = new String[] {"f_i", "f_f", "f_d", "f_l", "f_dt"}; protected static final RandVal[] randVals = new RandVal[] {rint, rfloat, rdouble, rlong, rdate}; + @Override public String[] getFieldNames() { return fieldNames; } + @Override public RandVal[] getRandValues() { return randVals; } diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java index 65778b65ba2..d354b69defb 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java @@ -61,6 +61,7 @@ public static void beforeSuperClass() { System.clearProperty("solr.retries.to.followers"); } + @Override @Test public void test() throws Exception { waitForThingsToLevelOut(15, TimeUnit.SECONDS); diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java index 904e6da69e7..bf69aa31a4d 100644 --- a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java @@ -317,6 +317,7 @@ private static class QueueChangerThread extends Thread { this.waitBeforeOfferMs = waitBeforeOfferMs; } + @Override public void run() { try { Thread.sleep(waitBeforeOfferMs); diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java index 41933370a4e..d2864f469ec 100644 --- a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java @@ -154,6 +154,7 @@ public void testReplicaVersionHandling() throws Exception { final Random rand = new Random(5150); Thread docSenderThread = new Thread() { + @Override public void run() { // brief delay before sending docs @@ -182,6 +183,7 @@ public void run() { Thread reloaderThread = new Thread() { + @Override public void run() { try { Thread.sleep(rand.nextInt(300) + 1); @@ -204,6 +206,7 @@ public void run() { Thread deleteThread = new Thread() { + @Override public void run() { // brief delay before sending docs @@ -232,6 +235,7 @@ public void run() { Thread committerThread = new Thread() { + @Override public void run() { try { Thread.sleep(rand.nextInt(200) + 1); diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java index c97b89e5c64..1af5f6ca1be 100644 --- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java @@ -610,6 +610,7 @@ private NamedList realTimeGetDocId(SolrClient solr, String docId) return solr.request(qr); } + @Override protected int getReplicaPort(Replica replica) { String replicaNode = replica.getNodeName(); String tmp = replicaNode.substring(replicaNode.indexOf(':') + 1); diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderFailoverAfterPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderFailoverAfterPartitionTest.java index 2c4972262e3..7701793129b 100644 --- a/solr/core/src/test/org/apache/solr/cloud/LeaderFailoverAfterPartitionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/LeaderFailoverAfterPartitionTest.java @@ -46,6 +46,7 @@ public LeaderFailoverAfterPartitionTest() { super(); } + @Override @Test public void test() throws Exception { waitForThingsToLevelOut(30, TimeUnit.SECONDS); diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderFailureAfterFreshStartTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderFailureAfterFreshStartTest.java index 289950cf850..e1e75eabcc7 100644 --- a/solr/core/src/test/org/apache/solr/cloud/LeaderFailureAfterFreshStartTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/LeaderFailureAfterFreshStartTest.java @@ -76,6 +76,7 @@ public LeaderFailureAfterFreshStartTest() { fixShardCount(3); } + @Override protected String getCloudSolrConfig() { return "solrconfig-tlog.xml"; } diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java index e99479f5a29..86bccffd73f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/LeaderTragicEventTest.java @@ -60,6 +60,7 @@ public static void setupCluster() throws Exception { .configure(); } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -67,6 +68,7 @@ public void setUp() throws Exception { cluster.getSolrClient().setDefaultCollection(collection); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java b/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java index a8c127718c8..e86bdf93e1d 100644 --- a/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/LeaderVoteWaitTimeoutTest.java @@ -105,6 +105,7 @@ public void setupTest() throws Exception { } } + @Override @After public void tearDown() throws Exception { if (null != proxies) { diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java index 00b6d52c611..265cbd4d1ea 100644 --- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java @@ -25,11 +25,13 @@ */ public class MoveReplicaTest extends AbstractMoveReplicaTestBase { + @Override @Test public void test() throws Exception { super.test(); } + @Override @Test public void testFailedMove() throws Exception { super.testFailedMove(); diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java index 843c8dd731f..f0ccaebf14c 100644 --- a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java @@ -239,6 +239,7 @@ public static void tearDownOnce() { solrMetricsContextMock = null; } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -276,6 +277,7 @@ public void setUp() throws Exception { replicas.clear(); } + @Override @After public void tearDown() throws Exception { stopComponentUnderTest(); @@ -459,6 +461,7 @@ protected Set commonMocks(int liveNodesCount, boolean distributedCluster Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { System.out.println( "set data: " + invocation.getArgument(0) + " " + invocation.getArgument(1)); @@ -505,6 +508,7 @@ public Void answer(InvocationOnMock invocation) { Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { System.out.println( "set data: " + invocation.getArgument(0) + " " + Arrays.toString(new byte[0])); @@ -546,6 +550,7 @@ public Void answer(InvocationOnMock invocation) { // 1. Single line recording and executing a command Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { handleCreateCollMessageProps(invocation.getArgument(1)); return null; @@ -557,6 +562,7 @@ public Void answer(InvocationOnMock invocation) { // 2. Recording a command to be executed as part of a batch of commands Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { handleCreateCollMessageProps(invocation.getArgument(1)); return null; @@ -568,6 +574,7 @@ public Void answer(InvocationOnMock invocation) { // Mocking for state change via the Overseer queue Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { try { handleCreateCollMessage(invocation.getArgument(0)); @@ -592,6 +599,7 @@ public Void answer(InvocationOnMock invocation) { Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { System.out.println( "set data: " + invocation.getArgument(0) + " " + invocation.getArgument(1)); @@ -638,6 +646,7 @@ public Void answer(InvocationOnMock invocation) { Mockito.doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { System.out.println( "set data: " + invocation.getArgument(0) + " " + Arrays.toString(new byte[0])); diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java index 3dc5aef4a97..aa9503182ee 100644 --- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java @@ -357,6 +357,7 @@ public static void beforeClass() throws Exception { initCore(); } + @Override @Before public void setUp() throws Exception { testDone = false; @@ -379,6 +380,7 @@ public static void afterClass() throws Exception { server = null; } + @Override @After public void tearDown() throws Exception { testDone = true; @@ -1877,6 +1879,7 @@ private ZkController createMockZkController( new SolrZkClient(server.getZkAddress(), AbstractZkTestCase.TIMEOUT); doAnswer( new Answer() { + @Override public Void answer(InvocationOnMock invocation) { newZkClient.close(); return null; diff --git a/solr/core/src/test/org/apache/solr/cloud/PeerSyncReplicationTest.java b/solr/core/src/test/org/apache/solr/cloud/PeerSyncReplicationTest.java index f9ee3b97f0e..cc2df95fb15 100644 --- a/solr/core/src/test/org/apache/solr/cloud/PeerSyncReplicationTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/PeerSyncReplicationTest.java @@ -84,6 +84,7 @@ public PeerSyncReplicationTest() { fixShardCount(3); } + @Override protected String getCloudSolrConfig() { return "solrconfig-tlog.xml"; } @@ -217,6 +218,7 @@ public IndexInBackGround(int numDocs, CloudJettyRunner nodeToBringUp) { this.runner = nodeToBringUp; } + @Override public void run() { try { // If we don't wait for cores get loaded, the leader may put this replica into LIR state diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java index a03e3666ea8..16ecdd73f01 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudSearcherWarming.java @@ -61,6 +61,7 @@ public static void setupCluster() throws Exception { useFactory("solr.StandardDirectoryFactory"); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java index 7a831d41806..c2f0f23dab8 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java @@ -1827,6 +1827,7 @@ private StringBuilder getConfigSetProps(Map map) { } public static class CreateNoErrorChecking extends ConfigSetAdminRequest.Create { + @Override public ConfigSetAdminRequest setAction(ConfigSetAction action) { return super.setAction(action); } @@ -1842,6 +1843,7 @@ public SolrParams getParams() { } public static class DeleteNoErrorChecking extends ConfigSetAdminRequest.Delete { + @Override public ConfigSetAdminRequest setAction(ConfigSetAction action) { return super.setAction(action); } diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java index 680cff48d44..7e1e48bd568 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java @@ -123,6 +123,7 @@ public ConfigSetsAPIThread(MiniSolrCloudCluster solrCluster, int trials) { public abstract ConfigSetAdminRequest createRequest(); + @Override public void run() { final String baseUrl = solrCluster.getJettySolrRunners().get(0).getBaseUrl().toString(); final SolrClient solrClient = getHttpSolrClient(baseUrl); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java b/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java index 4708752bb28..a0fc4b2b988 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestDistribDocBasedVersion.java @@ -284,6 +284,7 @@ void vdeleteFail(String id, long version, int errCode, String... params) { assertTrue(failed); } + @Override void doQuery(String expectedDocs, String... queryParams) throws Exception { List strs = StrUtils.splitSmart(expectedDocs, ",", true); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java index 012d2477498..677ca916a5d 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java @@ -745,6 +745,7 @@ public FieldValueValidator(final String expectedFieldName, final String actualFi this.actualFieldName = actualFieldName; } + @Override public abstract String getFlParam(); @Override @@ -784,6 +785,7 @@ public SimpleFieldValueValidator(final String fieldName) { super(fieldName, fieldName); } + @Override public String getFlParam() { return expectedFieldName; } @@ -795,10 +797,12 @@ public RenameFieldValueValidator(final String origFieldName, final String alias) super(origFieldName, alias); } + @Override public String getFlParam() { return actualFieldName + ":" + expectedFieldName; } + @Override public Set getSuppressedFields() { return Collections.singleton(expectedFieldName); } @@ -831,6 +835,7 @@ public RawFieldValueValidator(final String type, final String fieldName) { this(type, fieldName, null); } + @Override public String getFlParam() { return (null == alias ? "" : (alias + ":")) + "[" + type + " f=" + expectedFieldName + "]"; } @@ -881,6 +886,7 @@ public SolrParams getExtraRequestParams() { return extraParams; } + @Override public String getDefaultTransformerFactoryName() { return type; } @@ -906,6 +912,7 @@ private static String convertRawContent(String raw) throws XMLStreamException { }); } + @Override protected String consumeRawContent(XMLStreamReader parser) throws XMLStreamException { return consumeRawContent0(parser); } @@ -955,14 +962,17 @@ public DocIdValidator() { this(USAGE); } + @Override public String getDefaultTransformerFactoryName() { return NAME; } + @Override public String getFlParam() { return USAGE.equals(resultKey) ? resultKey : resultKey + ":" + USAGE; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -999,14 +1009,17 @@ public ShardValidator() { this(USAGE); } + @Override public String getDefaultTransformerFactoryName() { return NAME; } + @Override public String getFlParam() { return USAGE.equals(resultKey) ? resultKey : resultKey + ":" + USAGE; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1050,14 +1063,17 @@ public ValueAugmenterValidator(final int expectedVal) { this(trans(expectedVal), expectedVal, "[" + NAME + "]"); } + @Override public String getDefaultTransformerFactoryName() { return NAME; } + @Override public String getFlParam() { return fl; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1094,14 +1110,17 @@ private FunctionValidator(final String fl, final String fieldName, final String this.fieldName = fieldName; } /** always returns true */ + @Override public boolean requiresRealtimeSearcherReOpen() { return true; } + @Override public String getFlParam() { return fl; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1139,10 +1158,12 @@ private static class SubQueryValidator implements FlValidator { public static final String SUBQ_KEY = "subq"; public static final String SUBQ_FIELD = "next_2_ids_i"; + @Override public String getFlParam() { return SUBQ_KEY + ":[" + NAME + "]"; } + @Override @SuppressWarnings("unchecked") public Collection assertRTGResults( final Collection validators, @@ -1178,10 +1199,12 @@ public Collection assertRTGResults( return Collections.singleton(SUBQ_KEY); } + @Override public String getDefaultTransformerFactoryName() { return NAME; } + @Override public SolrParams getExtraRequestParams() { return params( SubQueryValidator.SUBQ_KEY + ".q", @@ -1242,14 +1265,17 @@ private GeoTransformerValidator( this.fieldName = fieldName; } + @Override public String getDefaultTransformerFactoryName() { return NAME; } + @Override public String getFlParam() { return fl; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1271,6 +1297,7 @@ public Collection assertRTGResults( return Collections.singleton(resultKey); } + @Override public Set getSuppressedFields() { return Collections.singleton(fieldName); } @@ -1295,6 +1322,7 @@ public GlobValidator(final String glob) { private final Set matchingFieldsCache = new LinkedHashSet<>(); + @Override public String getFlParam() { return glob; } @@ -1307,6 +1335,7 @@ private boolean matchesGlob(final String fieldName) { return false; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1350,10 +1379,12 @@ public NotIncludedValidator(final String fieldName, final String fl) { this.fl = fl; } + @Override public String getFlParam() { return fl; } + @Override public Collection assertRTGResults( final Collection validators, final SolrInputDocument expected, @@ -1377,6 +1408,7 @@ public ExplainValidator(final String resultKey) { super(USAGE, resultKey + ":" + USAGE); } + @Override public String getDefaultTransformerFactoryName() { return NAME; } diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSizeLimitedDistributedMap.java b/solr/core/src/test/org/apache/solr/cloud/TestSizeLimitedDistributedMap.java index 7c63d6a1ad9..6c9e01d7d7b 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestSizeLimitedDistributedMap.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestSizeLimitedDistributedMap.java @@ -116,13 +116,14 @@ public void testConcurrentCleanup() throws Exception { } // there's no guarantees on exactly how many elements will be removed, but it should at // least NOT throw exception - assertTrue(!deletedItems.isEmpty()); + assertFalse(deletedItems.isEmpty()); } finally { ExecutorUtil.shutdownAndAwaitTermination(executorService); } } } + @Override protected DistributedMap createMap(SolrZkClient zkClient, String path) { return new SizeLimitedDistributedMap(zkClient, path, Overseer.NUM_RESPONSES_TO_STORE, null); } diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java b/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java index 46635a070d9..6c0541a678c 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java @@ -51,6 +51,7 @@ public void setupCluster() throws Exception { .configure(); } + @Override @After public void tearDown() throws Exception { shutdownCluster(); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java index 468940441d2..d91261aa40f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestStressCloudBlindAtomicUpdates.java @@ -437,6 +437,7 @@ private void doRandomAtomicUpdate(int docId) throws Exception { counter.getAndAdd(delta); } + @Override public void run() { final String origThreadName = Thread.currentThread().getName(); try { diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressLiveNodes.java b/solr/core/src/test/org/apache/solr/cloud/TestStressLiveNodes.java index 7675753c8d9..de5742a414e 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestStressLiveNodes.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestStressLiveNodes.java @@ -244,6 +244,7 @@ public LiveNodeTrasher(String id, int numNodesToAdd) { this.client = newSolrZkClient(); } /** returns the number of nodes actually added w/o error */ + @Override public Integer call() { running = true; // NOTE: test includes 'running' diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java index be56310e4a3..023f304f7cf 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java @@ -1248,6 +1248,7 @@ public ExpectedErr(String type, String id, String msgSubStr) { this.msgSubStr = msgSubStr; } + @Override public String toString() { return "type=<" + type + ">,id=<" + id + ">,msgSubStr=<" + msgSubStr + ">"; } diff --git a/solr/core/src/test/org/apache/solr/cloud/TestWaitForStateWithJettyShutdowns.java b/solr/core/src/test/org/apache/solr/cloud/TestWaitForStateWithJettyShutdowns.java index 5b95a5e3f74..bddb5ba2e35 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestWaitForStateWithJettyShutdowns.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestWaitForStateWithJettyShutdowns.java @@ -153,6 +153,7 @@ public LatchCountingPredicateWrapper( this.inner = inner; } + @Override public boolean matches(Set liveNodes, DocCollection collectionState) { final boolean result = inner.matches(liveNodes, collectionState); if (log.isInfoEnabled()) { diff --git a/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java b/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java index 98fe143d922..7e62974bd6f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/TriLevelCompositeIdRoutingTest.java @@ -63,6 +63,7 @@ public TriLevelCompositeIdRoutingTest() { NUM_ADDS = atLeast(200); } + @Override @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-13369") @Test public void test() throws Exception { @@ -147,6 +148,7 @@ public void test() throws Exception { } } + @Override void doAddDoc(String id) throws Exception { index("id", id); // todo - target diff servers and use cloud clients as well as non-cloud clients diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java b/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java index c3c9408292f..8c1ad8beea5 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ZkSolrClientTest.java @@ -131,6 +131,7 @@ public void testReconnect() throws Exception { Thread thread = new Thread() { + @Override public void run() { try { zkClient.makePath("collections/collection2", false); @@ -153,6 +154,7 @@ public void run() { Thread thread2 = new Thread() { + @Override public void run() { try { diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIAsyncDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIAsyncDistributedZkTest.java index 0807a3ce9bc..bd3b1d56cd1 100644 --- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIAsyncDistributedZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionsAPIAsyncDistributedZkTest.java @@ -59,6 +59,7 @@ public void setupCluster() throws Exception { configureCluster(2).addConfig("conf1", configset("cloud-minimal")).configure(); } + @Override @After public void tearDown() throws Exception { shutdownCluster(); diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java index 1a5fb1f9dc4..b69bdb3c5cc 100644 --- a/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java @@ -96,6 +96,7 @@ public void distribSetUp() throws Exception { useFactory(null); } + @Override @Test @Nightly public void test() throws Exception { diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestRequestStatusCollectionAPI.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestRequestStatusCollectionAPI.java index e2d4e5833a1..543d53b9f04 100644 --- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestRequestStatusCollectionAPI.java +++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestRequestStatusCollectionAPI.java @@ -39,6 +39,7 @@ public TestRequestStatusCollectionAPI() { schemaString = "schema15.xml"; // we need a string id } + @Override @Test public void test() { ModifiableSolrParams params = new ModifiableSolrParams(); diff --git a/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java b/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java index 73093e41f3f..80604de2b85 100644 --- a/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/overseer/ZkStateReaderTest.java @@ -88,12 +88,14 @@ public void close() throws IOException { private TestFixture fixture = null; + @Override @Before public void setUp() throws Exception { super.setUp(); fixture = setupTestFixture(getTestName()); } + @Override @After public void tearDown() throws Exception { if (fixture != null) { diff --git a/solr/core/src/test/org/apache/solr/cluster/events/AllEventsListener.java b/solr/core/src/test/org/apache/solr/cluster/events/AllEventsListener.java index 5a80ff97a67..06dd9d1449d 100644 --- a/solr/core/src/test/org/apache/solr/cluster/events/AllEventsListener.java +++ b/solr/core/src/test/org/apache/solr/cluster/events/AllEventsListener.java @@ -51,5 +51,6 @@ public void waitForExpectedEvent(int timeoutSeconds) throws InterruptedException } } + @Override public void close() {} } diff --git a/solr/core/src/test/org/apache/solr/cluster/events/ClusterEventProducerTest.java b/solr/core/src/test/org/apache/solr/cluster/events/ClusterEventProducerTest.java index 5813fb9512c..6f44d4da2f0 100644 --- a/solr/core/src/test/org/apache/solr/cluster/events/ClusterEventProducerTest.java +++ b/solr/core/src/test/org/apache/solr/cluster/events/ClusterEventProducerTest.java @@ -63,6 +63,7 @@ public static void setupCluster() throws Exception { .configure(); } + @Override @Before public void setUp() throws Exception { System.setProperty("enable.packages", "true"); diff --git a/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java b/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java index 20d19fdab41..dc8f9e293af 100644 --- a/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java +++ b/solr/core/src/test/org/apache/solr/cluster/events/impl/CollectionsRepairEventListenerTest.java @@ -120,6 +120,7 @@ public static void setupCluster() throws Exception { repairListener.start(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/cluster/placement/ClusterAbstractionsForTest.java b/solr/core/src/test/org/apache/solr/cluster/placement/ClusterAbstractionsForTest.java index f771927cdb5..baf24527965 100644 --- a/solr/core/src/test/org/apache/solr/cluster/placement/ClusterAbstractionsForTest.java +++ b/solr/core/src/test/org/apache/solr/cluster/placement/ClusterAbstractionsForTest.java @@ -93,6 +93,7 @@ public String toString() { * comparing node names given that new instances of {@link Node} are created with names equal to * existing instances (See {@link Builders.NodeBuilder#build()}). */ + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -107,6 +108,7 @@ public boolean equals(Object obj) { return Objects.equals(this.nodeName, other.nodeName); } + @Override public int hashCode() { return Objects.hashCode(nodeName); } @@ -220,6 +222,7 @@ public ShardState getState() { return shardState; } + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -238,6 +241,7 @@ public boolean equals(Object obj) { && Objects.equals(this.leader, other.leader); } + @Override public int hashCode() { return Objects.hash(shardName, collection, shardState); } @@ -296,6 +300,7 @@ public Node getNode() { return node; } + @Override public boolean equals(Object obj) { if (obj == null) { return false; @@ -315,6 +320,7 @@ public boolean equals(Object obj) { && Objects.equals(this.node, other.node); } + @Override public int hashCode() { return Objects.hash(replicaName, coreName, shard, replicaType, replicaState, node); } diff --git a/solr/core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java b/solr/core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java index 8ad5ee12b76..1e8e147af0b 100644 --- a/solr/core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java +++ b/solr/core/src/test/org/apache/solr/core/BlobRepositoryMockingTest.java @@ -65,6 +65,7 @@ public static void beforeClass() { SolrTestCaseJ4.assumeWorkingMockito(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/core/CachingDirectoryFactoryTest.java b/solr/core/src/test/org/apache/solr/core/CachingDirectoryFactoryTest.java index eb8520ac4bc..7ce94dc8758 100644 --- a/solr/core/src/test/org/apache/solr/core/CachingDirectoryFactoryTest.java +++ b/solr/core/src/test/org/apache/solr/core/CachingDirectoryFactoryTest.java @@ -77,6 +77,7 @@ private void doStressTest(final CachingDirectoryFactory df) throws Exception { Thread closeThread = new Thread() { + @Override public void run() { try { df.close(); diff --git a/solr/core/src/test/org/apache/solr/core/TestCoreContainer.java b/solr/core/src/test/org/apache/solr/core/TestCoreContainer.java index 1fde25d409c..a536191ad50 100644 --- a/solr/core/src/test/org/apache/solr/core/TestCoreContainer.java +++ b/solr/core/src/test/org/apache/solr/core/TestCoreContainer.java @@ -572,6 +572,7 @@ public void deleteConfig(String configName) {} @Override public void deleteFilesFromConfig(String configName, List filesToDelete) {} + @Override public void copyConfig(String fromConfig, String toConfig) {} @Override diff --git a/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java b/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java index e2dcb23f3a9..95b4fd7022a 100644 --- a/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java +++ b/solr/core/src/test/org/apache/solr/core/TestNRTOpen.java @@ -51,6 +51,7 @@ public static void afterClass() { systemClearPropertySolrTestsMergePolicyFactory(); } + @Override public void setUp() throws Exception { super.setUp(); // delete all, then add initial doc diff --git a/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java b/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java index 228ad8cc48b..164a897459e 100644 --- a/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java +++ b/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java @@ -42,6 +42,7 @@ public static void beforeClass() throws Exception { configureCluster(1).addConfig("conf1", configset("cloud-aggregate-node-metrics")).configure(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/TestHealthCheckHandlerLegacyMode.java b/solr/core/src/test/org/apache/solr/handler/TestHealthCheckHandlerLegacyMode.java index fc8dc8a592a..8d62803a9f5 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestHealthCheckHandlerLegacyMode.java +++ b/solr/core/src/test/org/apache/solr/handler/TestHealthCheckHandlerLegacyMode.java @@ -48,6 +48,7 @@ public class TestHealthCheckHandlerLegacyMode extends SolrTestCaseJ4 { private static final String context = "/solr"; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java index ccb342ee316..5e284d9fff3 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java @@ -117,6 +117,7 @@ public static void beforeClass() { useLegacyParams = rarely(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java index 369243c4fff..4c9cc6b35d5 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java @@ -93,6 +93,7 @@ private static SolrClient createNewSolrClient(int port) { } } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerDiskOverFlow.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerDiskOverFlow.java index f816cc3b2bf..698dd398721 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerDiskOverFlow.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerDiskOverFlow.java @@ -61,6 +61,7 @@ public class TestReplicationHandlerDiskOverFlow extends SolrTestCaseJ4 { SolrClient leaderClient, followerClient; ReplicationTestHelper.SolrInstance leader = null, follower = null; + @Override @Before public void setUp() throws Exception { originalDiskSpaceprovider = IndexFetcher.usableDiskSpaceProvider; diff --git a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java index 1c831c2a7aa..12d4dc72be9 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java +++ b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java @@ -76,6 +76,7 @@ private static SolrClient createNewSolrClient(int port) { } } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/TestStressIncrementalBackup.java b/solr/core/src/test/org/apache/solr/handler/TestStressIncrementalBackup.java index 2f6cb29988d..3b34120953e 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestStressIncrementalBackup.java +++ b/solr/core/src/test/org/apache/solr/handler/TestStressIncrementalBackup.java @@ -110,6 +110,7 @@ public void testCoreAdminHandler() throws Exception { // possible to create a lot of index churn w/ segment merging final Thread heavyCommitting = new Thread() { + @Override public void run() { try { int docIdCounter = 0; diff --git a/solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java b/solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java index f990bcf6c8d..121ce4251c7 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java +++ b/solr/core/src/test/org/apache/solr/handler/TestStressThreadBackup.java @@ -139,6 +139,7 @@ private GenericSolrRequest makeReplicationReq(SolrParams p) { * Override default backup impl to hit ReplicationHandler, and then poll that same handler * until success */ + @Override public void makeBackup(final String backupName, final String snapName) throws Exception { final TimeOut timeout = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME); ModifiableSolrParams p = @@ -170,6 +171,7 @@ public void testSnapshotsAndBackupsDuringConcurrentCommitsAndOptimizes(final Bac // possible to create a lot of index churn w/ segment merging final Thread heavyCommitting = new Thread() { + @Override public void run() { try { int docIdCounter = 0; diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java index 476c685f116..797dabd04a9 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminOperationTest.java @@ -41,6 +41,7 @@ public static void setUpClass() { assumeWorkingMockito(); } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -49,6 +50,7 @@ public void setUp() throws Exception { callInfo = new CoreAdminHandler.CallInfo(null, mockRequest, null, null); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/handler/admin/SecurityConfHandlerLocalForTesting.java b/solr/core/src/test/org/apache/solr/handler/admin/SecurityConfHandlerLocalForTesting.java index f69723870ec..36a4fdba8e5 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/SecurityConfHandlerLocalForTesting.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/SecurityConfHandlerLocalForTesting.java @@ -26,10 +26,12 @@ public SecurityConfHandlerLocalForTesting(CoreContainer coreContainer) { super(coreContainer); } + @Override public boolean persistConf(SecurityConfig securityConfig) throws IOException { return super.persistConf(securityConfig); } + @Override public void securityConfEdited() { super.securityConfEdited(); } diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/AddReplicaPropertyAPITest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/AddReplicaPropertyAPITest.java index e31e12497ea..01ca69ed6d3 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/api/AddReplicaPropertyAPITest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/api/AddReplicaPropertyAPITest.java @@ -60,6 +60,7 @@ public static void ensureWorkingMockito() { assumeWorkingMockito(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java index 83a51980349..e844e652736 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedFacetPivotSmallTest.java @@ -2609,6 +2609,7 @@ public boolean equals(Object o) { return equal; } + @Override public int indexOf(Object o) { for (int i = 0; i < size(); i++) { if (get(i).equals(o)) { diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java index 2d3fce4a44e..d181008e9c1 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java @@ -181,6 +181,7 @@ public void test() throws Exception { // query("qt", "/terms", "terms.fl", "foo_date_p", "terms.ttf", "true"); } + @Override protected QueryResponse query(Object... q) throws Exception { if (Stream.of(q).noneMatch(s -> s.equals("terms.list"))) { // SOLR-9243 doesn't support max/min count diff --git a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java index 8519dbaa0fe..381928669c6 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java @@ -2347,18 +2347,22 @@ public StatSetCombinations(int comboSize, EnumSet universe) { intCombos = new Combinations(all.length, comboSize); } + @Override public Iterator> iterator() { return new Iterator>() { final Iterator wrapped = intCombos.iterator(); + @Override public void remove() { wrapped.remove(); } + @Override public boolean hasNext() { return wrapped.hasNext(); } + @Override public EnumSet next() { EnumSet result = EnumSet.noneOf(Stat.class); int[] indexes = wrapped.next(); diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java index e5b938b43bf..84b23dea383 100644 --- a/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java +++ b/solr/core/src/test/org/apache/solr/handler/tagger/EmbeddedSolrNoSerializeTest.java @@ -64,6 +64,7 @@ public static void cleanUpAfterClass() { solrServer = null; } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/legacy/TestLegacyTerms.java b/solr/core/src/test/org/apache/solr/legacy/TestLegacyTerms.java index 6de741d1ac6..b1b0dc0b876 100644 --- a/solr/core/src/test/org/apache/solr/legacy/TestLegacyTerms.java +++ b/solr/core/src/test/org/apache/solr/legacy/TestLegacyTerms.java @@ -149,38 +149,47 @@ public void testDoubleFieldMinMax() throws Exception { /** A complete empty Terms instance that has no terms in it and supports no optional statistics */ private static Terms EMPTY_TERMS = new Terms() { + @Override public TermsEnum iterator() { return TermsEnum.EMPTY; } + @Override public long size() { return -1; } + @Override public long getSumTotalTermFreq() { return 0; } + @Override public long getSumDocFreq() { return 0; } + @Override public int getDocCount() { return 0; } + @Override public boolean hasFreqs() { return false; } + @Override public boolean hasOffsets() { return false; } + @Override public boolean hasPositions() { return false; } + @Override public boolean hasPayloads() { return false; } diff --git a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrGraphiteReporterTest.java b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrGraphiteReporterTest.java index d9a320ad7d8..385ebc85733 100644 --- a/solr/core/src/test/org/apache/solr/metrics/reporters/SolrGraphiteReporterTest.java +++ b/solr/core/src/test/org/apache/solr/metrics/reporters/SolrGraphiteReporterTest.java @@ -98,6 +98,7 @@ private static class MockGraphite extends Thread { stop = false; } + @Override public void run() { while (!stop) { try { diff --git a/solr/core/src/test/org/apache/solr/parser/SolrQueryParserBaseTest.java b/solr/core/src/test/org/apache/solr/parser/SolrQueryParserBaseTest.java index be64a28fe9e..fa11166cd71 100644 --- a/solr/core/src/test/org/apache/solr/parser/SolrQueryParserBaseTest.java +++ b/solr/core/src/test/org/apache/solr/parser/SolrQueryParserBaseTest.java @@ -44,8 +44,10 @@ public static void setUpClass() { private static final String DEFAULT_FIELD_NAME = "TestDefaultFieldname"; private static class MockSolrQueryParser extends SolrQueryParserBase { + @Override public void ReInit(CharStream stream) {} + @Override public Query TopLevelQuery(String field) { return null; } @@ -59,6 +61,7 @@ public Query TopLevelQuery(String field) { private MockSolrQueryParser solrQueryParser; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java b/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java index 58478b924a2..a74f2012157 100644 --- a/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java +++ b/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java @@ -126,18 +126,23 @@ public TestStream() { tuples = testTuples.iterator(); } + @Override public StreamComparator getStreamSort() { return null; } + @Override public void close() {} + @Override public void open() {} + @Override public List children() { return null; } + @Override @SuppressWarnings({"unchecked"}) public Tuple read() { if (tuples.hasNext()) { @@ -150,8 +155,10 @@ public Tuple read() { } } + @Override public void setStreamContext(StreamContext streamContext) {} + @Override public Explanation toExplanation(StreamFactory factory) { return null; } diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java index 29488cc5f09..a987b96dcfc 100644 --- a/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java +++ b/solr/core/src/test/org/apache/solr/schema/DocValuesMultiTest.java @@ -47,6 +47,7 @@ public static void beforeTests() throws Exception { } } + @Override public void setUp() throws Exception { super.setUp(); assertU(delQ("*:*")); diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java index ed826cb5e30..f1ce167cbed 100644 --- a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java +++ b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java @@ -63,6 +63,7 @@ public static void beforeTests() throws Exception { } } + @Override public void setUp() throws Exception { super.setUp(); assertU(delQ("*:*")); diff --git a/solr/core/src/test/org/apache/solr/schema/IntPointPrefixActsAsRangeQueryFieldType.java b/solr/core/src/test/org/apache/solr/schema/IntPointPrefixActsAsRangeQueryFieldType.java index 3112db56a1c..ba130bda8fa 100644 --- a/solr/core/src/test/org/apache/solr/schema/IntPointPrefixActsAsRangeQueryFieldType.java +++ b/solr/core/src/test/org/apache/solr/schema/IntPointPrefixActsAsRangeQueryFieldType.java @@ -28,6 +28,7 @@ */ public class IntPointPrefixActsAsRangeQueryFieldType extends IntPointField { + @Override public Query getPrefixQuery(QParser parser, SchemaField sf, String termStr) { return getRangeQuery(parser, sf, termStr, Integer.MAX_VALUE + "", true, false); } diff --git a/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java b/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java index e2d5b5a4257..48c99a630b9 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java +++ b/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java @@ -58,6 +58,7 @@ public static void initSysProperties() { System.setProperty("enable.update.log", "true"); } + @Override protected String getCloudSolrConfig() { return "solrconfig-managed-schema.xml"; } diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java b/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java index 295896cecd3..0bb42c3afd8 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java +++ b/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java @@ -45,6 +45,7 @@ public class TestCloudSchemaless extends AbstractFullDistribZkTestBase { private static final String SUCCESS_XPATH = "/response/lst[@name='responseHeader']/int[@name='status'][.='0']"; + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java index 64ffb41c072..407fb4eca3b 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestPointFields.java +++ b/solr/core/src/test/org/apache/solr/schema/TestPointFields.java @@ -676,6 +676,7 @@ private class PosVal> { this.val = val; } + @Override public String toString() { return "(" + pos + ": " + val.toString() + ")"; } diff --git a/solr/core/src/test/org/apache/solr/schema/TrieIntPrefixActsAsRangeQueryFieldType.java b/solr/core/src/test/org/apache/solr/schema/TrieIntPrefixActsAsRangeQueryFieldType.java index c67cb0a00c2..3c3e0baea3e 100644 --- a/solr/core/src/test/org/apache/solr/schema/TrieIntPrefixActsAsRangeQueryFieldType.java +++ b/solr/core/src/test/org/apache/solr/schema/TrieIntPrefixActsAsRangeQueryFieldType.java @@ -30,6 +30,7 @@ @Deprecated public class TrieIntPrefixActsAsRangeQueryFieldType extends TrieIntField { + @Override public Query getPrefixQuery(QParser parser, SchemaField sf, String termStr) { return getRangeQuery(parser, sf, termStr, Integer.MAX_VALUE + "", true, false); } diff --git a/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java index 0a59da43c61..489809f549e 100644 --- a/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java +++ b/solr/core/src/test/org/apache/solr/search/AnalyticsTestQParserPlugin.java @@ -35,6 +35,7 @@ public class AnalyticsTestQParserPlugin extends QParserPlugin { + @Override public QParser createParser( String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) { return new TestAnalyticsQueryParser(query, localParams, params, req); @@ -47,6 +48,7 @@ public TestAnalyticsQueryParser( super(query, localParams, params, req); } + @Override public Query parse() { int base = localParams.getInt("base", 0); boolean iterate = localParams.getBool("iterate", false); @@ -64,6 +66,7 @@ public TestAnalyticsQuery(int base, MergeStrategy mergeStrategy) { this.base = base; } + @Override public DelegatingCollector getAnalyticsCollector(ResponseBuilder rb, IndexSearcher searcher) { return new TestAnalyticsCollector(base, rb); } @@ -79,11 +82,13 @@ public TestAnalyticsCollector(int base, ResponseBuilder rb) { this.rb = rb; } + @Override public void collect(int doc) throws IOException { ++count; leafDelegate.collect(doc); } + @Override @SuppressWarnings({"unchecked"}) public void finish() throws IOException { @SuppressWarnings({"rawtypes"}) @@ -98,20 +103,25 @@ public void finish() throws IOException { static class TestAnalyticsMergeStrategy implements MergeStrategy { + @Override public boolean mergesIds() { return false; } + @Override public boolean handlesMergeFields() { return false; } + @Override public int getCost() { return 100; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} + @Override @SuppressWarnings({"unchecked"}) public void merge(ResponseBuilder rb, ShardRequest shardRequest) { int count = 0; @@ -134,6 +144,7 @@ public void merge(ResponseBuilder rb, ShardRequest shardRequest) { static class TestIterative extends IterativeMergeStrategy { + @Override @SuppressWarnings({"unchecked"}) public void process(ResponseBuilder rb, ShardRequest sreq) throws Exception { int count = 0; diff --git a/solr/core/src/test/org/apache/solr/search/ApacheLuceneSolrNearQueryBuilder.java b/solr/core/src/test/org/apache/solr/search/ApacheLuceneSolrNearQueryBuilder.java index 8ab8f146e8c..c28eb533c44 100644 --- a/solr/core/src/test/org/apache/solr/search/ApacheLuceneSolrNearQueryBuilder.java +++ b/solr/core/src/test/org/apache/solr/search/ApacheLuceneSolrNearQueryBuilder.java @@ -35,10 +35,12 @@ public ApacheLuceneSolrNearQueryBuilder( super(defaultField, analyzer, req, spanFactory); } + @Override public Query getQuery(Element e) throws ParserException { return getSpanQuery(e); } + @Override public SpanQuery getSpanQuery(Element e) throws ParserException { final String fieldName = DOMUtils.getAttributeWithInheritanceOrFail(e, "fieldName"); final SpanQuery[] spanQueries = diff --git a/solr/core/src/test/org/apache/solr/search/ChooseOneWordQueryBuilder.java b/solr/core/src/test/org/apache/solr/search/ChooseOneWordQueryBuilder.java index fccccf77065..ca18546b78c 100644 --- a/solr/core/src/test/org/apache/solr/search/ChooseOneWordQueryBuilder.java +++ b/solr/core/src/test/org/apache/solr/search/ChooseOneWordQueryBuilder.java @@ -36,10 +36,12 @@ public ChooseOneWordQueryBuilder( super(defaultField, analyzer, req, spanFactory); } + @Override public Query getQuery(Element e) throws ParserException { return implGetQuery(e, false); } + @Override public SpanQuery getSpanQuery(Element e) throws ParserException { return (SpanQuery) implGetQuery(e, true); } diff --git a/solr/core/src/test/org/apache/solr/search/GoodbyeQueryBuilder.java b/solr/core/src/test/org/apache/solr/search/GoodbyeQueryBuilder.java index cfbd33e7432..58e5ce46a8e 100644 --- a/solr/core/src/test/org/apache/solr/search/GoodbyeQueryBuilder.java +++ b/solr/core/src/test/org/apache/solr/search/GoodbyeQueryBuilder.java @@ -30,6 +30,7 @@ public GoodbyeQueryBuilder( super(defaultField, analyzer, req, queryFactory); } + @Override public Query getQuery(Element e) { return new MatchNoDocsQuery(); } diff --git a/solr/core/src/test/org/apache/solr/search/HandyQueryBuilder.java b/solr/core/src/test/org/apache/solr/search/HandyQueryBuilder.java index 44463896ff3..44580ad8be3 100644 --- a/solr/core/src/test/org/apache/solr/search/HandyQueryBuilder.java +++ b/solr/core/src/test/org/apache/solr/search/HandyQueryBuilder.java @@ -37,6 +37,7 @@ public HandyQueryBuilder( super(defaultField, analyzer, req, spanFactory); } + @Override public Query getQuery(Element e) throws ParserException { final BooleanQuery.Builder bq = new BooleanQuery.Builder(); final Query lhsQ = getSubQuery(e, "Left"); @@ -46,6 +47,7 @@ public Query getQuery(Element e) throws ParserException { return bq.build(); } + @Override public SpanQuery getSpanQuery(Element e) throws ParserException { SpanQuery subQueries[] = { getSubSpanQuery(e, "Left"), getSubSpanQuery(e, "Right"), diff --git a/solr/core/src/test/org/apache/solr/search/HelloQueryBuilder.java b/solr/core/src/test/org/apache/solr/search/HelloQueryBuilder.java index 74e14a33f16..3cb3be830d4 100644 --- a/solr/core/src/test/org/apache/solr/search/HelloQueryBuilder.java +++ b/solr/core/src/test/org/apache/solr/search/HelloQueryBuilder.java @@ -30,6 +30,7 @@ public HelloQueryBuilder( super(defaultField, analyzer, req, queryFactory); } + @Override public Query getQuery(Element e) { return new MatchAllDocsQuery(); } diff --git a/solr/core/src/test/org/apache/solr/search/MergeStrategyTest.java b/solr/core/src/test/org/apache/solr/search/MergeStrategyTest.java index 0cde4d58e28..bec2b7160ba 100644 --- a/solr/core/src/test/org/apache/solr/search/MergeStrategyTest.java +++ b/solr/core/src/test/org/apache/solr/search/MergeStrategyTest.java @@ -107,14 +107,17 @@ public void test() throws Exception { @Override public void merge(ResponseBuilder rb, ShardRequest sreq) {} + @Override public boolean mergesIds() { return true; } + @Override public boolean handlesMergeFields() { return false; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} @Override @@ -128,14 +131,17 @@ public int getCost() { @Override public void merge(ResponseBuilder rb, ShardRequest sreq) {} + @Override public boolean mergesIds() { return true; } + @Override public boolean handlesMergeFields() { return false; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} @Override @@ -149,14 +155,17 @@ public int getCost() { @Override public void merge(ResponseBuilder rb, ShardRequest sreq) {} + @Override public boolean mergesIds() { return false; } + @Override public boolean handlesMergeFields() { return false; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} @Override diff --git a/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java b/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java index 1cbaee0a957..791a26369af 100644 --- a/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java +++ b/solr/core/src/test/org/apache/solr/search/RankQueryTestPlugin.java @@ -69,6 +69,7 @@ public class RankQueryTestPlugin extends QParserPlugin { + @Override public QParser createParser( String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) { return new TestRankQueryParser(query, localParams, params, req); @@ -81,6 +82,7 @@ public TestRankQueryParser( super(query, localParams, params, req); } + @Override public Query parse() { int mergeStrategy = localParams.getInt("mergeStrategy", 0); @@ -95,10 +97,12 @@ static class TestRankQuery extends RankQuery { private int collector; private Query q; + @Override public int hashCode() { return collector + q.hashCode(); } + @Override public boolean equals(Object o) { if (o instanceof TestRankQuery) { TestRankQuery trq = (TestRankQuery) o; @@ -109,6 +113,7 @@ public boolean equals(Object o) { return false; } + @Override public Weight createWeight(IndexSearcher indexSearcher, ScoreMode scoreMode, float boost) throws IOException { return q.createWeight(indexSearcher, scoreMode, boost); @@ -122,6 +127,7 @@ public String toString(String field) { return q.toString(field); } + @Override public RankQuery wrap(Query q) { this.q = q; return this; @@ -132,12 +138,14 @@ public TestRankQuery(int collector, int mergeStrategy) { this.mergeStrategy = mergeStrategy; } + @Override public TopDocsCollector getTopDocsCollector( int len, QueryCommand cmd, IndexSearcher searcher) { if (collector == 0) return new TestCollector(null); else return new TestCollector1(null); } + @Override public MergeStrategy getMergeStrategy() { if (mergeStrategy == 0) return new TestMergeStrategy(); else return new TestMergeStrategy1(); @@ -146,20 +154,25 @@ public MergeStrategy getMergeStrategy() { static class TestMergeStrategy implements MergeStrategy { + @Override public int getCost() { return 1; } + @Override public boolean mergesIds() { return true; } + @Override public boolean handlesMergeFields() { return false; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) {} + @Override public void merge(ResponseBuilder rb, ShardRequest sreq) { // id to shard mapping, to eliminate any accidental dups @@ -328,18 +341,22 @@ public void merge(ResponseBuilder rb, ShardRequest sreq) { static class TestMergeStrategy1 implements MergeStrategy { + @Override public int getCost() { return 1; } + @Override public boolean mergesIds() { return true; } + @Override public boolean handlesMergeFields() { return true; } + @Override public void handleMergeFields(ResponseBuilder rb, SolrIndexSearcher searcher) throws IOException { SolrQueryRequest req = rb.req; @@ -470,6 +487,7 @@ public float score() { } } + @Override @SuppressWarnings({"unchecked"}) public void merge(ResponseBuilder rb, ShardRequest sreq) { @@ -706,6 +724,7 @@ public LeafCollector getLeafCollector(LeafReaderContext context) throws IOExcept @Override public void setScorer(Scorable scorer) {} + @Override public void collect(int doc) throws IOException { long value; if (values.advanceExact(doc)) { @@ -718,13 +737,16 @@ public void collect(int doc) throws IOException { }; } + @Override public int topDocsSize() { return list.size(); } + @Override public TopDocs topDocs() { list.sort( new Comparator<>() { + @Override public int compare(ScoreDoc s1, ScoreDoc s2) { if (s1.score == s2.score) { return 0; @@ -739,10 +761,12 @@ public int compare(ScoreDoc s1, ScoreDoc s2) { return new TopDocs(new TotalHits(list.size(), TotalHits.Relation.EQUAL_TO), scoreDocs); } + @Override public TopDocs topDocs(int start, int len) { return topDocs(); } + @Override public int getTotalHits() { return list.size(); } @@ -773,19 +797,23 @@ public void setScorer(Scorable scorer) { this.scorer = scorer; } + @Override public void collect(int doc) throws IOException { list.add(new ScoreDoc(doc + base, scorer.score())); } }; } + @Override public int topDocsSize() { return list.size(); } + @Override public TopDocs topDocs() { list.sort( new Comparator<>() { + @Override public int compare(ScoreDoc s1, ScoreDoc s2) { if (s1.score == s2.score) { return 0; @@ -800,10 +828,12 @@ public int compare(ScoreDoc s1, ScoreDoc s2) { return new TopDocs(new TotalHits(list.size(), TotalHits.Relation.EQUAL_TO), scoreDocs); } + @Override public TopDocs topDocs(int start, int len) { return topDocs(); } + @Override public int getTotalHits() { return list.size(); } diff --git a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java index 2a13531e345..a93caafb194 100644 --- a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java +++ b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java @@ -69,6 +69,7 @@ private static String numbersTo(int i) { return numbers.toString(); } + @Override @Before public void setUp() throws Exception { assertU( @@ -299,6 +300,7 @@ public FixedScoreReRankQuery(Query q, float fixedScore) { this.fixedScore = fixedScore; } + @Override public Weight createWeight(IndexSearcher indexSearcher, ScoreMode scoreMode, float boost) throws IOException { return q.createWeight(indexSearcher, scoreMode, boost); @@ -355,6 +357,7 @@ public MergeStrategy getMergeStrategy() { return null; } + @Override public RankQuery wrap(Query q) { this.q = q; return this; diff --git a/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java b/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java index 6c0b6a4d908..e59cb2a109e 100644 --- a/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java +++ b/solr/core/src/test/org/apache/solr/search/TestIndexSearcher.java @@ -314,6 +314,7 @@ public void testDontUseColdSearcher() throws Exception { Thread t = new Thread() { + @Override public void run() { try { doQuery(newCore); @@ -386,6 +387,7 @@ public void testUseColdSearcher() throws Exception { Thread t = new Thread() { + @Override public void run() { try { doQuery(newCore); diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestBaseStatsCache.java b/solr/core/src/test/org/apache/solr/search/stats/TestBaseStatsCache.java index b3bfc30f0e7..e2c6180c33c 100644 --- a/solr/core/src/test/org/apache/solr/search/stats/TestBaseStatsCache.java +++ b/solr/core/src/test/org/apache/solr/search/stats/TestBaseStatsCache.java @@ -33,6 +33,7 @@ public void distribSetUp() throws Exception { System.setProperty("solr.statsCache", getStatsCacheClassName()); } + @Override public void distribTearDown() throws Exception { super.distribTearDown(); System.clearProperty("solr.statsCache"); diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestDefaultStatsCache.java b/solr/core/src/test/org/apache/solr/search/stats/TestDefaultStatsCache.java index 50db3e0e44c..845154009ab 100644 --- a/solr/core/src/test/org/apache/solr/search/stats/TestDefaultStatsCache.java +++ b/solr/core/src/test/org/apache/solr/search/stats/TestDefaultStatsCache.java @@ -35,6 +35,7 @@ public void distribSetUp() throws Exception { System.setProperty("solr.statsCache", LocalStatsCache.class.getName()); } + @Override public void distribTearDown() throws Exception { super.distribTearDown(); System.clearProperty("solr.statsCache"); diff --git a/solr/core/src/test/org/apache/solr/security/AuditLoggerPluginTest.java b/solr/core/src/test/org/apache/solr/security/AuditLoggerPluginTest.java index b9499caffb0..9b82e6d0585 100644 --- a/solr/core/src/test/org/apache/solr/security/AuditLoggerPluginTest.java +++ b/solr/core/src/test/org/apache/solr/security/AuditLoggerPluginTest.java @@ -125,6 +125,7 @@ public class AuditLoggerPluginTest extends SolrTestCaseJ4 { private MockAuditLoggerPlugin plugin; private HashMap config; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/security/CertAuthPluginTest.java b/solr/core/src/test/org/apache/solr/security/CertAuthPluginTest.java index a7c679265cd..c961b1775b8 100644 --- a/solr/core/src/test/org/apache/solr/security/CertAuthPluginTest.java +++ b/solr/core/src/test/org/apache/solr/security/CertAuthPluginTest.java @@ -41,6 +41,7 @@ public static void setupMockito() { SolrTestCaseJ4.assumeWorkingMockito(); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java b/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java index 81d2dfbafc1..3fdda76715d 100644 --- a/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java +++ b/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java @@ -46,6 +46,7 @@ public class TestAuthorizationFramework extends AbstractFullDistribZkTestBase { static final int TIMEOUT = 10000; + @Override public void distribSetUp() throws Exception { super.distribSetUp(); try (ZkStateReader zkStateReader = diff --git a/solr/core/src/test/org/apache/solr/update/MaxSizeAutoCommitTest.java b/solr/core/src/test/org/apache/solr/update/MaxSizeAutoCommitTest.java index f38da87e46b..a0a5fcb57a4 100644 --- a/solr/core/src/test/org/apache/solr/update/MaxSizeAutoCommitTest.java +++ b/solr/core/src/test/org/apache/solr/update/MaxSizeAutoCommitTest.java @@ -90,6 +90,7 @@ public void setup() throws Exception { updateRequestHandler.init(null); } + @Override @After public void tearDown() throws Exception { if (null != monitor) { diff --git a/solr/core/src/test/org/apache/solr/update/MockingHttp2SolrClient.java b/solr/core/src/test/org/apache/solr/update/MockingHttp2SolrClient.java index d412c278e3b..12bfcacf605 100644 --- a/solr/core/src/test/org/apache/solr/update/MockingHttp2SolrClient.java +++ b/solr/core/src/test/org/apache/solr/update/MockingHttp2SolrClient.java @@ -58,6 +58,7 @@ public Builder(UpdateShardHandlerConfig config) { this.idleTimeout(config.getDistributedSocketTimeout()); } + @Override public MockingHttp2SolrClient build() { return new MockingHttp2SolrClient(null, this); } diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java index f4b32d93522..2a59bbb8312 100644 --- a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java +++ b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java @@ -68,6 +68,7 @@ public static void beforeClass() throws Exception { initCore(solrConfigFileName, schemaFileName); } + @Override @After public void tearDown() throws Exception { System.clearProperty("mergePolicySort"); diff --git a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java index cd0fab5c1c5..fc42d5405cd 100644 --- a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java +++ b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesStandalone.java @@ -1179,6 +1179,7 @@ public void checkRandomReplay(final int maxDocId, final int numCmds) throws Exce /** sentinel object for {@link #checkReplay} */ public Object SOFTCOMMIT = new Object() { + @Override public String toString() { return "SOFTCOMMIT"; } @@ -1186,6 +1187,7 @@ public String toString() { /** sentinel object for {@link #checkReplay} */ public Object HARDCOMMIT = new Object() { + @Override public String toString() { return "HARDCOMMIT"; } diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateJavabinTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateJavabinTest.java index 38b1957ea70..363dbe14945 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateJavabinTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateJavabinTest.java @@ -68,6 +68,7 @@ public static void setupCluster() throws Exception { cluster.waitForActiveCollection(COLLECTION, 1, 1); } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java index cd2f1dba572..b7bd389405a 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/RegexBoostProcessorTest.java @@ -62,6 +62,7 @@ public static void tearDownAfterClass() { factory = null; } + @Override @Before public void setUp() throws Exception { document = new SolrInputDocument(); diff --git a/solr/core/src/test/org/apache/solr/util/AuthToolTest.java b/solr/core/src/test/org/apache/solr/util/AuthToolTest.java index 1f00461f67e..718b4fc7f99 100644 --- a/solr/core/src/test/org/apache/solr/util/AuthToolTest.java +++ b/solr/core/src/test/org/apache/solr/util/AuthToolTest.java @@ -42,12 +42,14 @@ public static void setupCluster() throws Exception { .configure(); } + @Override @Before public void setUp() throws Exception { super.setUp(); dir = createTempDir("AuthToolTest").toAbsolutePath(); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java b/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java index d1ca49d821c..23a67a8daab 100644 --- a/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java +++ b/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java @@ -30,10 +30,12 @@ public static void incrementSystemTime(long ms) { private long start; + @Override public void start() { start = systemTime; } + @Override public double elapsed() { return systemTime - start; } diff --git a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java index 3503706c2eb..0b247dd78c0 100644 --- a/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java +++ b/solr/core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java @@ -230,6 +230,7 @@ protected int startStandaloneSolr(String[] args) { standaloneSolr = new JettySolrRunner(solrHomeDir.getAbsolutePath(), "/solr", port); Thread bg = new Thread() { + @Override public void run() { try { standaloneSolr.start(); @@ -294,6 +295,7 @@ public void close() { protected List closeables = new ArrayList<>(); + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/util/TestSystemIdResolver.java b/solr/core/src/test/org/apache/solr/util/TestSystemIdResolver.java index eb5633acd56..d7bf4228011 100644 --- a/solr/core/src/test/org/apache/solr/util/TestSystemIdResolver.java +++ b/solr/core/src/test/org/apache/solr/util/TestSystemIdResolver.java @@ -28,6 +28,7 @@ public class TestSystemIdResolver extends SolrTestCaseJ4 { + @Override public void tearDown() throws Exception { System.clearProperty(SolrResourceLoader.SOLR_ALLOW_UNSAFE_RESOURCELOADING_PARAM); super.tearDown(); diff --git a/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java b/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java index 82456d716ce..42110c2aec5 100644 --- a/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java +++ b/solr/core/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java @@ -55,6 +55,7 @@ public class SSLConfigurationsTest extends SolrTestCase { SSLConfigurations.SysProps.SSL_CLIENT_KEY_STORE_PASSWORD, SSLConfigurations.SysProps.SSL_CLIENT_TRUST_STORE_PASSWORD); + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/ExpressionComparator.java b/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/ExpressionComparator.java index 17069b1c940..5b981062455 100644 --- a/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/ExpressionComparator.java +++ b/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/ExpressionComparator.java @@ -31,6 +31,7 @@ public ExpressionComparator(String expression) { this.expression = expression; } + @Override @SuppressWarnings("unchecked") public int compare(FacetBucket b1, FacetBucket b2) { T t1 = (T) b1.getResult(expression); diff --git a/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/FacetResultsComparator.java b/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/FacetResultsComparator.java index 62702053f5a..a8abc2001c3 100644 --- a/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/FacetResultsComparator.java +++ b/solr/modules/analytics/src/java/org/apache/solr/analytics/facet/compare/FacetResultsComparator.java @@ -43,5 +43,6 @@ public void setDirection(boolean ascending) { * @param b1 the first bucket to compare * @param b2 the second bucket to compare */ + @Override public abstract int compare(FacetBucket b1, FacetBucket b2); } diff --git a/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/DateParseFunction.java b/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/DateParseFunction.java index eb1ae409a8d..c97a3f4e6e5 100644 --- a/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/DateParseFunction.java +++ b/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/DateParseFunction.java @@ -210,6 +210,7 @@ public void streamLongs(LongConsumer cons) { }); } + @Override public String getName() { return name; } diff --git a/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/LambdaFunction.java b/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/LambdaFunction.java index d114ab0a349..01b79e5b337 100644 --- a/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/LambdaFunction.java +++ b/solr/modules/analytics/src/java/org/apache/solr/analytics/function/mapping/LambdaFunction.java @@ -1385,6 +1385,7 @@ public boolean exists() { return exists; } + @Override public void accept(boolean paramValue) { if (!exists) { exists = true; @@ -1753,6 +1754,7 @@ public boolean exists() { return exists; } + @Override public void accept(int paramValue) { if (!exists) { exists = true; @@ -2114,6 +2116,7 @@ public boolean exists() { return exists; } + @Override public void accept(long paramValue) { if (!exists) { exists = true; @@ -2476,6 +2479,7 @@ public boolean exists() { return exists; } + @Override public void accept(float paramValue) { if (!exists) { exists = true; @@ -2838,6 +2842,7 @@ public boolean exists() { return exists; } + @Override public void accept(double paramValue) { if (!exists) { exists = true; @@ -3205,6 +3210,7 @@ public boolean exists() { return exists; } + @Override public void accept(long paramValue) { if (!exists) { exists = true; @@ -3567,6 +3573,7 @@ public boolean exists() { return exists; } + @Override public void accept(String paramValue) { if (!exists) { exists = true; diff --git a/solr/modules/analytics/src/java/org/apache/solr/handler/AnalyticsHandler.java b/solr/modules/analytics/src/java/org/apache/solr/handler/AnalyticsHandler.java index 6da7ca79ddf..2e17e373d3b 100644 --- a/solr/modules/analytics/src/java/org/apache/solr/handler/AnalyticsHandler.java +++ b/solr/modules/analytics/src/java/org/apache/solr/handler/AnalyticsHandler.java @@ -72,6 +72,7 @@ public void inform(SolrCore core) { AnalyticsRequestParser.init(); } + @Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { SolrQueryTimeoutImpl.set(req); diff --git a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java index 7ad3b1a89ba..2d18ddbf605 100644 --- a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java +++ b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java @@ -40,18 +40,22 @@ public void setAuthHandler(AuthenticationHandler authHandler) { this.authHandler = authHandler; } + @Override public String getType() { return authHandler.getType(); } + @Override public void init(Properties config) throws ServletException { // authHandler has already been init'ed, nothing to do here } + @Override public void destroy() { authHandler.destroy(); } + @Override public boolean managementOperation( AuthenticationToken token, HttpServletRequest request, HttpServletResponse response) throws IOException, AuthenticationException { @@ -62,6 +66,7 @@ public boolean managementOperation( return result; } + @Override public AuthenticationToken authenticate(HttpServletRequest request, HttpServletResponse response) throws IOException, AuthenticationException { return authHandler.authenticate(request, response); diff --git a/solr/modules/hadoop-auth/src/java/org/apache/solr/util/configuration/providers/hadoop/HadoopSSLCredentialProvider.java b/solr/modules/hadoop-auth/src/java/org/apache/solr/util/configuration/providers/hadoop/HadoopSSLCredentialProvider.java index 1b51d558134..2c37615fc57 100644 --- a/solr/modules/hadoop-auth/src/java/org/apache/solr/util/configuration/providers/hadoop/HadoopSSLCredentialProvider.java +++ b/solr/modules/hadoop-auth/src/java/org/apache/solr/util/configuration/providers/hadoop/HadoopSSLCredentialProvider.java @@ -56,6 +56,7 @@ protected EnumMap getCredentialKeyMap() { return DEFAULT_CREDENTIAL_KEY_MAP; } + @Override protected String getCredential(String keystoreKey) { try { char[] password = hadoopConfigurationProvider.getPassword(keystoreKey); diff --git a/solr/modules/hadoop-auth/src/test/org/apache/solr/client/solrj/impl/Krb5HttpClientUtils.java b/solr/modules/hadoop-auth/src/test/org/apache/solr/client/solrj/impl/Krb5HttpClientUtils.java index 7a7733fc039..d98e9677a7a 100644 --- a/solr/modules/hadoop-auth/src/test/org/apache/solr/client/solrj/impl/Krb5HttpClientUtils.java +++ b/solr/modules/hadoop-auth/src/test/org/apache/solr/client/solrj/impl/Krb5HttpClientUtils.java @@ -46,6 +46,7 @@ private static SPNEGOAuthentication createSPNEGOAuthentication(String principalN SPNEGOAuthentication authentication = new SPNEGOAuthentication(null) { + @Override public boolean matches(String type, URI uri, String realm) { return this.getType().equals(type); } diff --git a/solr/modules/hadoop-auth/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java b/solr/modules/hadoop-auth/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java index 12ee42ed58d..140c726802c 100644 --- a/solr/modules/hadoop-auth/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java +++ b/solr/modules/hadoop-auth/src/test/org/apache/solr/util/configuration/SSLConfigurationsTest.java @@ -56,6 +56,7 @@ public class SSLConfigurationsTest extends SolrTestCaseJ4 { SSLConfigurations.SysProps.SSL_CLIENT_KEY_STORE_PASSWORD, CREDENTIAL_PROVIDER_PATH); + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/HdfsDirectoryFactory.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/HdfsDirectoryFactory.java index 9ad61417706..89336902226 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/HdfsDirectoryFactory.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/HdfsDirectoryFactory.java @@ -418,6 +418,7 @@ public Configuration getConf(Path path) { return conf; } + @Override protected synchronized void removeDirectory(final CacheValue cacheValue) { FileSystem fileSystem = getCachedFileSystem(cacheValue.path); @@ -691,6 +692,7 @@ public boolean accept(Path path) { } // perform an atomic rename if possible + @Override public void renameWithOverwrite(Directory dir, String fileName, String toName) throws IOException { String hdfsDirPath = getPath(dir); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/backup/repository/HdfsBackupRepository.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/backup/repository/HdfsBackupRepository.java index a4bee9d6817..bb0feff5266 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/backup/repository/HdfsBackupRepository.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/backup/repository/HdfsBackupRepository.java @@ -104,6 +104,7 @@ public void init(NamedList args) { } } + @Override public void close() throws IOException { if (this.fileSystem != null) { this.fileSystem.close(); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/snapshots/SolrSnapshotsTool.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/snapshots/SolrSnapshotsTool.java index 4b17fbacbf0..4ff0fde9c80 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/snapshots/SolrSnapshotsTool.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/snapshots/SolrSnapshotsTool.java @@ -599,6 +599,7 @@ private static void printHelp(Options options) { private static class OptionComarator implements Comparator { + @Override public int compare(T o1, T o2) { String s1 = o1.hasLongOpt() ? o1.getLongOpt() : o1.getOpt(); String s2 = o2.hasLongOpt() ? o2.getLongOpt() : o2.getOpt(); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/blockcache/BlockDirectory.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/blockcache/BlockDirectory.java index 51e7877c656..a86bcee029f 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/blockcache/BlockDirectory.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/blockcache/BlockDirectory.java @@ -377,6 +377,7 @@ public IndexOutput createOutput(String name, IOContext context) throws IOExcepti return dest; } + @Override public void deleteFile(String name) throws IOException { cache.delete(getFileCacheName(name)); super.deleteFile(name); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java index dd11e4b4be9..83664b30670 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java @@ -352,6 +352,7 @@ public void close() { } } + @Override public String toString() { return "hdfs tlog{file=" + tlogFile.toString() + " refcount=" + refcount.get() + "}"; } @@ -365,6 +366,7 @@ public LogReader getReader(long startingPos) { return new HDFSLogReader(startingPos); } + @Override public LogReader getSortedReader(long startingPos) { return new HDFSSortedLogReader(startingPos); } @@ -407,6 +409,7 @@ private void initStream(long pos) { * @return The log record, or null if EOF * @throws IOException If there is a low-level I/O error. */ + @Override public Object next() throws IOException, InterruptedException { long pos = fis.position(); @@ -451,6 +454,7 @@ public Object next() throws IOException, InterruptedException { return o; } + @Override public void close() { try { fis.close(); @@ -570,6 +574,7 @@ public HDFSReverseReader() throws IOException { * @return The log record, or null if EOF * @throws IOException If there is a low-level I/O error. */ + @Override public Object next() throws IOException { if (prevPos <= 0) return null; @@ -611,10 +616,12 @@ public Object next() throws IOException { } /* returns the position in the log file of the last record returned by next() */ + @Override public long position() { return prevPos + 4; // skip the length } + @Override public void close() { try { fis.close(); diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java index 19c6a13fcc5..f42b07a824a 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java @@ -437,6 +437,7 @@ public boolean accept(Path name) { // return true; // } + @Override public String toString() { return "HDFSUpdateLog{state=" + getState() + ", tlog=" + tlog + "}"; } diff --git a/solr/modules/hdfs/src/test/org/apache/hadoop/fs/RawLocalFileSystem.java b/solr/modules/hdfs/src/test/org/apache/hadoop/fs/RawLocalFileSystem.java index 3c8a819cf9f..c59c9079a1c 100644 --- a/solr/modules/hdfs/src/test/org/apache/hadoop/fs/RawLocalFileSystem.java +++ b/solr/modules/hdfs/src/test/org/apache/hadoop/fs/RawLocalFileSystem.java @@ -990,6 +990,7 @@ public void setTimes(Path p, long mtime, long atime) throws IOException { * @param opts Constraints that determine the validity of the * {@link PathHandle} reference. */ + @Override protected PathHandle createPathHandle(FileStatus stat, Options.HandleOpt... opts) { if (stat.isDirectory() || stat.isSymlink()) { diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsChaosMonkeySafeLeaderTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsChaosMonkeySafeLeaderTest.java index dbeebf95ffe..e7dbee6b96f 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsChaosMonkeySafeLeaderTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsChaosMonkeySafeLeaderTest.java @@ -73,6 +73,7 @@ protected String getDataDir(String dataDir) throws IOException { return HdfsTestUtil.getDataDir(dfsCluster, dataDir); } + @Override protected String getDirectoryFactory() { return HdfsDirectoryFactory.class.getCanonicalName(); } diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsNameNodeFailoverTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsNameNodeFailoverTest.java index dd7721d7ed4..c77fe3c1d52 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsNameNodeFailoverTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsNameNodeFailoverTest.java @@ -68,6 +68,7 @@ public HdfsNameNodeFailoverTest() { fixShardCount(TEST_NIGHTLY ? 7 : random().nextInt(2) + 1); } + @Override protected String getSolrXml() { return "solr.xml"; } diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java index c69b6ad7571..e0d2691b22c 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java @@ -65,11 +65,13 @@ public static void afterClass() throws Exception { } } + @Override @Before public void setUp() throws Exception { super.setUp(); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsWriteToMultipleCollectionsTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsWriteToMultipleCollectionsTest.java index 6eab88e1563..ae8a103ad67 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsWriteToMultipleCollectionsTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsWriteToMultipleCollectionsTest.java @@ -93,6 +93,7 @@ public HdfsWriteToMultipleCollectionsTest() { fixShardCount(3); } + @Override protected String getSolrXml() { return "solr.xml"; } diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java index 71a16a006cd..98a1d771df9 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java @@ -135,6 +135,7 @@ public void distribSetUp() throws Exception { useJettyDataDir = false; } + @Override protected String getSolrXml() { return "solr.xml"; } diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/StressHdfsTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/StressHdfsTest.java index 68cee00598b..b437e77c30c 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/StressHdfsTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/StressHdfsTest.java @@ -95,6 +95,7 @@ public StressHdfsTest() { testRestartIntoSafeMode = random().nextBoolean(); } + @Override protected String getSolrXml() { return "solr.xml"; } diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/api/collections/TestHdfsCloudBackupRestore.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/api/collections/TestHdfsCloudBackupRestore.java index 5afb9cbdb72..dcd2c73f8ac 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/api/collections/TestHdfsCloudBackupRestore.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/api/collections/TestHdfsCloudBackupRestore.java @@ -195,6 +195,7 @@ public String getBackupLocation() { return null; } + @Override protected void testConfigBackupOnly(String configName, String collectionName) throws Exception { String backupName = "configonlybackup"; CloudSolrClient solrClient = cluster.getSolrClient(); diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/HdfsDirectoryTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/HdfsDirectoryTest.java index b28a510535c..780d4c566e4 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/HdfsDirectoryTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/HdfsDirectoryTest.java @@ -79,6 +79,7 @@ public static void afterClass() throws Exception { } } + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -94,6 +95,7 @@ public void setUp() throws Exception { random = random(); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/blockcache/BlockDirectoryTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/blockcache/BlockDirectoryTest.java index 69284441ac5..6c2db998113 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/blockcache/BlockDirectoryTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/store/blockcache/BlockDirectoryTest.java @@ -99,6 +99,7 @@ public void releaseResources() {} private Random random; private MapperCache mapperCache; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -121,6 +122,7 @@ public void setUp() throws Exception { random = random(); } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java index 4b58b558ec5..793093d4e30 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/update/TestHdfsUpdateLog.java @@ -102,6 +102,7 @@ public void testFSThreadSafety() throws Exception { Thread thread = new Thread() { + @Override public void run() { int cnt = 0; while (true) { @@ -120,6 +121,7 @@ public void run() { Thread thread2 = new Thread() { + @Override public void run() { int cnt = 0; while (true) { diff --git a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTAuthPluginTest.java b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTAuthPluginTest.java index ebbfcd2a114..9fa5e09d252 100644 --- a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTAuthPluginTest.java +++ b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTAuthPluginTest.java @@ -156,6 +156,7 @@ protected static JwtClaims generateClaims() { return claims; } + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTIssuerConfigTest.java b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTIssuerConfigTest.java index d51ae820d92..29e70780f80 100644 --- a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTIssuerConfigTest.java +++ b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTIssuerConfigTest.java @@ -43,6 +43,7 @@ public class JWTIssuerConfigTest extends SolrTestCase { private Map testIssuerConfigMap; private String testIssuerJson; + @Override @Before public void setUp() throws Exception { super.setUp(); @@ -68,6 +69,7 @@ public void setUp() throws Exception { + " \"authorizationEndpoint\":\"https://issuer/authz\"}"; } + @Override @After public void tearDown() throws Exception { super.tearDown(); diff --git a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTVerificationkeyResolverTest.java b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTVerificationkeyResolverTest.java index 3de70e6b9d2..216154efbb6 100644 --- a/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTVerificationkeyResolverTest.java +++ b/solr/modules/jwt-auth/src/test/org/apache/solr/security/jwt/JWTVerificationkeyResolverTest.java @@ -60,6 +60,7 @@ public class JWTVerificationkeyResolverTest extends SolrTestCaseJ4 { private List keysToReturnFromSecondJwk; private Iterator> refreshSequenceForSecondJwk; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/modules/langid/src/test/org/apache/solr/update/processor/SolrInputDocumentReaderTest.java b/solr/modules/langid/src/test/org/apache/solr/update/processor/SolrInputDocumentReaderTest.java index 8bacd60b805..1a55cd2d0c8 100644 --- a/solr/modules/langid/src/test/org/apache/solr/update/processor/SolrInputDocumentReaderTest.java +++ b/solr/modules/langid/src/test/org/apache/solr/update/processor/SolrInputDocumentReaderTest.java @@ -26,6 +26,7 @@ public class SolrInputDocumentReaderTest extends SolrTestCase { private SolrInputDocument doc; private String[] allFields; + @Override @Before public void setUp() throws Exception { super.setUp(); diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/interleaving/algorithms/TeamDraftInterleaving.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/interleaving/algorithms/TeamDraftInterleaving.java index ab500be79c2..af96259660c 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/interleaving/algorithms/TeamDraftInterleaving.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/interleaving/algorithms/TeamDraftInterleaving.java @@ -78,6 +78,7 @@ public class TeamDraftInterleaving implements Interleaving { * @param rerankedB a ranked list of search results produced by a ranking model B * @return the interleaved ranking list */ + @Override public InterleavingResult interleave(ScoreDoc[] rerankedA, ScoreDoc[] rerankedB) { List interleavedResults = new ArrayList<>(); HashSet alreadyAdded = new HashSet<>(); diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/model/NeuralNetworkModel.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/model/NeuralNetworkModel.java index de769586c67..c4d4f201277 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/model/NeuralNetworkModel.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/model/NeuralNetworkModel.java @@ -212,6 +212,7 @@ public float apply(float in) { } } + @Override public float[] calculateOutput(float[] inputVec) { float[] outputVec = new float[this.matrixRows]; @@ -227,6 +228,7 @@ public float[] calculateOutput(float[] inputVec) { return outputVec; } + @Override public int validate(int inputDim) throws ModelException { if (this.numUnits != this.matrixRows) { throw new ModelException( @@ -279,6 +281,7 @@ public int validate(int inputDim) throws ModelException { return this.matrixRows; } + @Override public String describe() { final StringBuilder sb = new StringBuilder(); sb.append("(matrix=") diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/model/TestAdapterModel.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/model/TestAdapterModel.java index bc992cfeb1b..96a68e67f66 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/model/TestAdapterModel.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/model/TestAdapterModel.java @@ -134,6 +134,7 @@ protected void validate() throws ModelException { } } + @Override public void init(SolrResourceLoader solrResourceLoader) throws ModelException { super.init(solrResourceLoader); try (InputStream is = solrResourceLoader.openResource(answerFileName); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/LimitStream.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/LimitStream.java index 1ff4362da40..86f87f3b6d3 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/LimitStream.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/LimitStream.java @@ -45,24 +45,29 @@ class LimitStream extends TupleStream { this.count = 0; } + @Override public void open() throws IOException { this.stream.open(); } + @Override public void close() throws IOException { this.stream.close(); } + @Override public List children() { List children = new ArrayList<>(); children.add(stream); return children; } + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public void setStreamContext(StreamContext context) { stream.setStreamContext(context); } @@ -78,6 +83,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpressionType(Explanation.ExpressionType.STREAM_DECORATOR); } + @Override public Tuple read() throws IOException { if (count == 0 && offset > 0) { diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SQLHandler.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SQLHandler.java index 4f7533f289c..1870d21824d 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SQLHandler.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SQLHandler.java @@ -59,6 +59,7 @@ public class SQLHandler extends RequestHandlerBase private boolean isCloud = false; + @Override public void inform(SolrCore core) { CoreContainer coreContainer = core.getCoreContainer(); @@ -76,6 +77,7 @@ public PermissionNameProvider.Name getPermissionName(AuthorizationContext reques return PermissionNameProvider.Name.READ_PERM; } + @Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { ModifiableSolrParams params = new ModifiableSolrParams(req.getParams()); params = adjustParams(params); @@ -133,6 +135,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw } } + @Override public String getDescription() { return "SQLHandler"; } diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrAggregate.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrAggregate.java index 7c29ddca609..6ff6ff95a84 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrAggregate.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrAggregate.java @@ -89,6 +89,7 @@ public Aggregate copy( return new SolrAggregate(getCluster(), traitSet, hints, input, groupSet, groupSets, aggCalls); } + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrEnumerator.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrEnumerator.java index 8bf3f82faf2..6ec89172b2d 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrEnumerator.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrEnumerator.java @@ -58,6 +58,7 @@ class SolrEnumerator implements Enumerator { * * @return A new row from the results */ + @Override public Object current() { if (fields.size() == 1) { return this.getter(current, fields.get(0)); @@ -111,6 +112,7 @@ private Object getRealVal(Object val) { return val; } + @Override public boolean moveNext() { try { Tuple tuple = this.tupleStream.read(); @@ -126,10 +128,12 @@ public boolean moveNext() { } } + @Override public void reset() { throw new UnsupportedOperationException(); } + @Override public void close() { if (this.tupleStream != null) { try { diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java index 464a3788cdd..8c2afc51a76 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrFilter.java @@ -89,10 +89,12 @@ public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq).multiplyBy(0.1); } + @Override public SolrFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new SolrFilter(getCluster(), traitSet, input, condition); } + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); if (getInput() instanceof SolrAggregate) { diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrProject.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrProject.java index 23edfeb3c65..835d4fea03a 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrProject.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrProject.java @@ -53,6 +53,7 @@ public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq).multiplyBy(0.1); } + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); final SolrRules.RexToSolrTranslator translator = diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java index 5b6dac64584..ea5ceecd6a4 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java @@ -146,6 +146,7 @@ private SolrFilterRule() { super(LogicalFilter.class, SolrFilterRule::filter, "SolrFilterRule"); } + @Override public RelNode convert(RelNode rel) { final LogicalFilter filter = (LogicalFilter) rel; final RelTraitSet traitSet = filter.getTraitSet().replace(out); @@ -162,6 +163,7 @@ private SolrProjectRule() { super(LogicalProject.class, "SolrProjectRule"); } + @Override public RelNode convert(RelNode rel) { final LogicalProject project = (LogicalProject) rel; final RelNode converted = convert(project.getInput(), out); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrSort.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrSort.java index 42ada8e8c40..82799d864a7 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrSort.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrSort.java @@ -61,6 +61,7 @@ public Sort copy( return new SolrSort(getCluster(), traitSet, input, collation, offset, fetch); } + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java index 577585d80d6..6b3cb67b96b 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java @@ -102,10 +102,12 @@ class SolrTable extends AbstractQueryableTable implements TranslatableTable { this.collection = collection; } + @Override public String toString() { return "SolrTable {" + collection + "}"; } + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType == null) { protoRowType = schema.getRelDataType(collection); @@ -211,6 +213,7 @@ private Enumerable query( return new AbstractEnumerable<>() { // Use original fields list to make sure only the fields specified are enumerated + @Override public Enumerator enumerator() { return new SolrEnumerator(finalStream, fields); } @@ -910,11 +913,13 @@ private TupleStream handleStats( return new StatsStream(zk, collection, solrParams, metrics); } + @Override public Queryable asQueryable( QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new SolrQueryable<>(queryProvider, schema, this, tableName); } + @Override public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) { final RelOptCluster cluster = context.getCluster(); return new SolrTableScan( @@ -928,6 +933,7 @@ public static class SolrQueryable extends AbstractTableQueryable { super(queryProvider, schema, table, tableName); } + @Override public Enumerator enumerator() { @SuppressWarnings("unchecked") final Enumerable enumerable = (Enumerable) getTable().query(getProperties()); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTableScan.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTableScan.java index 92d2f9c4134..f2ae04e33fb 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTableScan.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTableScan.java @@ -90,6 +90,7 @@ public void register(RelOptPlanner planner) { .FILTER_REDUCE_EXPRESSIONS); // prevent AND NOT from being reduced away, see SOLR-15461 } + @Override public void implement(Implementor implementor) { implementor.solrTable = solrTable; implementor.table = table; diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java index 29b0f4c4679..5bf837d6fb3 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java @@ -59,6 +59,7 @@ public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq).multiplyBy(.1); } + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Generates a call to "query" with the appropriate fields final BlockBuilder list = new BlockBuilder(); diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java index 05df58bac00..c85719116cd 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java @@ -780,6 +780,7 @@ public void printLayoutToStream(PrintStream out) throws KeeperException, Interru out.println(sb.toString()); } + @Override public void close() { if (isClosed) return; // it's okay if we over close - same as solrcore isClosed = true; diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java index 26239784115..f11eccb5430 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -935,6 +935,7 @@ public Object getUpdateLock() { return this; } + @Override public void close() { this.closed = true; @@ -2394,6 +2395,7 @@ public void run() { } private class CacheCleaner implements Runnable { + @Override public void run() { while (!Thread.interrupted()) { try { @@ -2421,10 +2423,12 @@ private final class DocCollectionAndLiveNodesWatcherWrapper private final String collectionName; private final CollectionStateWatcher delegate; + @Override public int hashCode() { return collectionName.hashCode() * delegate.hashCode(); } + @Override public boolean equals(Object other) { if (other instanceof DocCollectionAndLiveNodesWatcherWrapper) { DocCollectionAndLiveNodesWatcherWrapper that = diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/RoutedAliasTypes.java b/solr/solrj/src/java/org/apache/solr/client/solrj/RoutedAliasTypes.java index 96490520012..547d0ca2603 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/RoutedAliasTypes.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/RoutedAliasTypes.java @@ -37,6 +37,7 @@ public String getSeparatorPrefix() { } }, DIMENSIONAL { + @Override public String getSeparatorPrefix() { throw new UnsupportedOperationException("dimensions within dimensions are not allowed"); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java index 73f3b92ad6a..11bd3cf3f7c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java @@ -1336,6 +1336,7 @@ public ORDER getOrder() { return order; } + @Override public boolean equals(Object other) { if (this == other) return true; if (!(other instanceof SortClause)) return false; @@ -1343,6 +1344,7 @@ public boolean equals(Object other) { return this.getItem().equals(that.getItem()) && this.getOrder().equals(that.getOrder()); } + @Override public int hashCode() { return this.getItem().hashCode(); } @@ -1355,6 +1357,7 @@ public int hashCode() { * * @return a description of the current sort clause */ + @Override public String toString() { return "[" + getClass().getSimpleName() diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java index 6d693bc3d43..5dd5d1268f6 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java @@ -95,6 +95,7 @@ public void open(URI uri) throws Exception { doOpen(); } + @Override public String toString() { return "SocketyProxy: port=" + listenPort + "; target=" + target; } @@ -349,6 +350,7 @@ public void goOn() { pause.get().countDown(); } + @Override public void run() { byte[] buf = new byte[1024]; @@ -436,6 +438,7 @@ public void goOn() { pause.get().countDown(); } + @Override public void run() { try { while (!socket.isClosed()) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java index 376dc29d96e..5f2aa19fa15 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java @@ -102,6 +102,7 @@ public void close() throws IOException { super.close(); } + @Override public LBHttp2SolrClient getLbClient() { return lbClient; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudLegacySolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudLegacySolrClient.java index 9a65997729a..16050935945 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudLegacySolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudLegacySolrClient.java @@ -112,6 +112,7 @@ private void propagateLBClientConfigOptions(Builder builder) { } } + @Override protected Map createRoutes( UpdateRequest updateRequest, ModifiableSolrParams routableParams, @@ -124,6 +125,7 @@ protected Map createRoutes( : updateRequest.getRoutesToCollection(router, col, urlMap, routableParams, idField); } + @Override protected RouteException getRouteException( SolrException.ErrorCode serverError, NamedList exceptions, @@ -146,6 +148,7 @@ public void close() throws IOException { super.close(); } + @Override public LBHttpSolrClient getLbClient() { return lbClient; } @@ -154,6 +157,7 @@ public HttpClient getHttpClient() { return myClient; } + @Override public ClusterStateProvider getClusterStateProvider() { return stateProvider; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java index 76f46c2ceeb..ea4b4d41acb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java @@ -257,6 +257,7 @@ private HttpClient createHttpClient(Builder builder) { return httpClient; } + @Override public void close() { // we wait for async requests, so far devs don't want to give sugar for this asyncTracker.waitForComplete(); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java index d39f26c2058..d6298b67e4a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java @@ -75,6 +75,7 @@ public SolrHttpClientBuilder getBuilder() { return getBuilder(HttpClientUtil.getHttpClientBuilder()); } + @Override public void close() { HttpClientUtil.removeRequestInterceptor(bufferedEntityInterceptor); } @@ -88,6 +89,7 @@ private SPNEGOAuthentication createSPNEGOAuthentication() { SPNEGOAuthentication authentication = new SPNEGOAuthentication(null) { + @Override public boolean matches(String type, URI uri, String realm) { return this.getType().equals(type); } @@ -174,10 +176,12 @@ public SolrHttpClientBuilder getBuilder(SolrHttpClientBuilder builder) { // Get the credentials from the JAAS configuration rather than here Credentials useJaasCreds = new Credentials() { + @Override public String getPassword() { return null; } + @Override public Principal getUserPrincipal() { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java index 9da118fd8b6..668fcd2ccea 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrPortAwareCookieSpecFactory.java @@ -83,6 +83,7 @@ public PortAwareCookieSpec() { */ public static class PortAwareDomainHandler extends NetscapeDomainHandler { + @Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (origin != null && origin.getHost() != null && cookie != null) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ModelCache.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ModelCache.java index eac3d187714..1f22acdde33 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ModelCache.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ModelCache.java @@ -125,6 +125,7 @@ public LRU(int maxSize) { this.maxSize = maxSize; } + @Override public boolean removeEldestEntry(Map.Entry eldest) { if (size() > maxSize) { return true; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java index 46701a5e50a..4a29e3fbb6d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/Tuple.java @@ -296,6 +296,7 @@ public void setMetrics(Map> metrics) { this.fields.put(StreamParams.METRICS, metrics); } + @Override public Tuple clone() { Tuple clone = new Tuple(this); return clone; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/ComparatorOrder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/ComparatorOrder.java index 1613d40de93..bb8d3405dd0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/ComparatorOrder.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/ComparatorOrder.java @@ -34,6 +34,7 @@ public static ComparatorOrder fromString(String order) { } } + @Override public String toString() { switch (this) { case DESCENDING: diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java index dc57ce74b29..9e2798c5c0b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/FieldComparator.java @@ -73,6 +73,7 @@ public boolean hasDifferentFieldNames() { return !leftFieldName.equals(rightFieldName); } + @Override public StreamExpressionParameter toExpression(StreamFactory factory) { StringBuilder sb = new StringBuilder(); @@ -151,6 +152,7 @@ private void assignComparator() { } } + @Override public int compare(Tuple leftTuple, Tuple rightTuple) { return comparator.compare(leftTuple, rightTuple); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/HashKey.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/HashKey.java index 9101a373b8a..43ad387c767 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/HashKey.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/HashKey.java @@ -36,6 +36,7 @@ public Object[] getParts() { return parts; } + @Override public int hashCode() { int h = 0; for (Object o : parts) { @@ -45,6 +46,7 @@ public int hashCode() { return h; } + @Override public boolean equals(Object o) { HashKey h = (HashKey) o; for (int i = 0; i < parts.length; i++) { @@ -56,6 +58,7 @@ public boolean equals(Object o) { return true; } + @Override public String toString() { StringBuilder buf = new StringBuilder(); for (int i = 0; i < parts.length; i++) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/MultipleFieldComparator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/MultipleFieldComparator.java index 84fae239296..087983e014c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/MultipleFieldComparator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/MultipleFieldComparator.java @@ -45,6 +45,7 @@ public StreamComparator[] getComps() { return comps; } + @Override public int compare(Tuple t1, Tuple t2) { for (StreamComparator comp : comps) { int i = comp.compare(t1, t2); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/SingleValueComparator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/SingleValueComparator.java index 3c1d47535f1..aa6db1aa7e7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/SingleValueComparator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/comp/SingleValueComparator.java @@ -33,6 +33,7 @@ public class SingleValueComparator implements StreamComparator { private static final long serialVersionUID = 1; private UUID comparatorNodeId = UUID.randomUUID(); + @Override public StreamExpressionParameter toExpression(StreamFactory factory) { return null; } @@ -42,6 +43,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return null; } + @Override public int compare(Tuple leftTuple, Tuple rightTuple) { return -1; // whatever, just keep everything in same order } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/FieldEqualitor.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/FieldEqualitor.java index e43770a1656..95dcb5bebfd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/FieldEqualitor.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/FieldEqualitor.java @@ -53,6 +53,7 @@ private void init(String leftFieldName, String rightFieldName) { this.rightFieldName = rightFieldName; } + @Override public StreamExpressionParameter toExpression(StreamFactory factory) { StringBuilder sb = new StringBuilder(); @@ -74,6 +75,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory).toString()); } + @Override @SuppressWarnings({"unchecked"}) public boolean test(Tuple leftTuple, Tuple rightTuple) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/MultipleFieldEqualitor.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/MultipleFieldEqualitor.java index 40ac74bf073..92765bae52b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/MultipleFieldEqualitor.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eq/MultipleFieldEqualitor.java @@ -110,6 +110,7 @@ public boolean isDerivedFrom(StreamComparator base) { return false; } + @Override public boolean test(Tuple t1, Tuple t2) { for (Equalitor eq : eqs) { if (!eq.test(t1, t2)) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/AndEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/AndEvaluator.java index d54618cc36e..05a17329c87 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/AndEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/AndEvaluator.java @@ -37,6 +37,7 @@ public AndEvaluator(StreamExpression expression, StreamFactory factory) throws I } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/CosineDistanceEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/CosineDistanceEvaluator.java index 8ce3453a75e..5e647bc416c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/CosineDistanceEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/CosineDistanceEvaluator.java @@ -55,6 +55,7 @@ public static class CosineDistance implements DistanceMeasure { private static final long serialVersionUID = -9108154600539125566L; + @Override public double compute(double[] v1, double[] v2) throws DimensionMismatchException { return Precision.round(1 - Math.abs(CosineSimilarityEvaluator.cosineSimilarity(v1, v2)), 8); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/DbscanEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/DbscanEvaluator.java index a66c66b4313..6880e68911c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/DbscanEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/DbscanEvaluator.java @@ -105,6 +105,7 @@ public ClusterPoint(String id, double[] point) { this.point = point; } + @Override public double[] getPoint() { return this.point; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/EqualToEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/EqualToEvaluator.java index 0548b739f85..6728df25c70 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/EqualToEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/EqualToEvaluator.java @@ -38,6 +38,7 @@ public EqualToEvaluator(StreamExpression expression, StreamFactory factory) thro } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { return new NullChecker() { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ExclusiveOrEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ExclusiveOrEvaluator.java index 65dc8706a29..98cdb312aae 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ExclusiveOrEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ExclusiveOrEvaluator.java @@ -40,6 +40,7 @@ public ExclusiveOrEvaluator(StreamExpression expression, StreamFactory factory) } } + @Override public Object doWork(Object... values) throws IOException { if (values.length < 2) { String message = null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEqualToEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEqualToEvaluator.java index b294c83e747..61378172b64 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEqualToEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEqualToEvaluator.java @@ -40,6 +40,7 @@ public GreaterThanEqualToEvaluator(StreamExpression expression, StreamFactory fa } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEvaluator.java index f4f94de510e..870e08710df 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/GreaterThanEvaluator.java @@ -39,6 +39,7 @@ public GreaterThanEvaluator(StreamExpression expression, StreamFactory factory) } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/IsNullEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/IsNullEvaluator.java index e940c002528..0d079f538e3 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/IsNullEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/IsNullEvaluator.java @@ -37,6 +37,7 @@ public IsNullEvaluator(StreamExpression expression, StreamFactory factory) throw } } + @Override public Object doWork(Object... values) throws IOException { if (values[0] == null) { @@ -54,6 +55,7 @@ public Object doWork(Object... values) throws IOException { return false; } + @Override protected Checker constructChecker(Object value) throws IOException { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KmeansEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KmeansEvaluator.java index 47f43617b14..56f9f0293a6 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KmeansEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KmeansEvaluator.java @@ -101,6 +101,7 @@ public ClusterPoint(String id, double[] point) { this.point = point; } + @Override public double[] getPoint() { return this.point; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KnnEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KnnEvaluator.java index 09ab6955cc3..80b96c0e3e0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KnnEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/KnnEvaluator.java @@ -141,6 +141,7 @@ public Double getDistance() { return distance; } + @Override public int compareTo(Neighbor neighbor) { if (this.distance.compareTo(neighbor.getDistance()) == 0) { return row - neighbor.getRow(); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEqualToEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEqualToEvaluator.java index 943a7e444e6..14057497f36 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEqualToEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEqualToEvaluator.java @@ -39,6 +39,7 @@ public LessThanEqualToEvaluator(StreamExpression expression, StreamFactory facto } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEvaluator.java index 99c8f60d7fb..8de1e12ba20 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/LessThanEvaluator.java @@ -38,6 +38,7 @@ public LessThanEvaluator(StreamExpression expression, StreamFactory factory) thr } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ManyValueWorker.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ManyValueWorker.java index 0a750f341cd..f9ff9c59c39 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ManyValueWorker.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ManyValueWorker.java @@ -20,5 +20,6 @@ public interface ManyValueWorker extends ValueWorker { + @Override Object doWork(Object... values) throws IOException; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MatchesEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MatchesEvaluator.java index a630d621d3f..ece522b70f5 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MatchesEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MatchesEvaluator.java @@ -40,6 +40,7 @@ public MatchesEvaluator(StreamExpression expression, StreamFactory factory) thro } } + @Override public Object doWork(Object... values) throws IOException { if (values[1] instanceof String) { String s = values[0].toString(); @@ -59,6 +60,7 @@ public Object doWork(Object... values) throws IOException { } } + @Override protected Checker constructChecker(Object value) throws IOException { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/Matrix.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/Matrix.java index e14752b50a3..9378661977d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/Matrix.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/Matrix.java @@ -34,14 +34,17 @@ public Matrix(double[][] data) { this.data = data; } + @Override public Map getAttributes() { return this.attributes; } + @Override public void setAttribute(String key, Object value) { this.attributes.put(key, value); } + @Override public Object getAttribute(String key) { return this.attributes.get(key); } @@ -74,6 +77,7 @@ public int getColumnCount() { return data[0].length; } + @Override public Iterator> iterator() { return new MatrixIterator(data); } @@ -87,6 +91,7 @@ public MatrixIterator(double[][] data) { d = data; } + @Override public List next() { double[] row = d[index++]; List list = new ArrayList<>(); @@ -97,6 +102,7 @@ public List next() { return list; } + @Override public boolean hasNext() { return index < d.length; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MemsetEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MemsetEvaluator.java index a1b03d91aa6..4a2cdd4c656 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MemsetEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/MemsetEvaluator.java @@ -122,6 +122,7 @@ public MemsetEvaluator( super(expression, factory, ignoredNamedParameters); } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotEvaluator.java index b3cf42bc39c..6263bd97263 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotEvaluator.java @@ -38,10 +38,12 @@ public NotEvaluator(StreamExpression expression, StreamFactory factory) throws I } } + @Override protected Checker constructChecker(Object value) throws IOException { return null; } + @Override public Object doWork(Object... values) throws IOException { if (1 != values.length) { throw new IOException( @@ -51,6 +53,7 @@ public Object doWork(Object... values) throws IOException { return doWork(values[0]); } + @Override public Object doWork(Object value) { if (null == value) { return null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotNullEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotNullEvaluator.java index 881517d4979..ab927a7fd84 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotNullEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/NotNullEvaluator.java @@ -37,6 +37,7 @@ public NotNullEvaluator(StreamExpression expression, StreamFactory factory) thro } } + @Override public Object doWork(Object... values) throws IOException { if (values[0] == null) { @@ -54,6 +55,7 @@ public Object doWork(Object... values) throws IOException { return true; } + @Override protected Checker constructChecker(Object value) throws IOException { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OneValueWorker.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OneValueWorker.java index fd47ec69513..967ebdb812b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OneValueWorker.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OneValueWorker.java @@ -23,6 +23,7 @@ public interface OneValueWorker extends ValueWorker { Object doWork(Object value) throws IOException; + @Override default Object doWork(Object... values) throws IOException { if (1 != values.length) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OrEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OrEvaluator.java index 9894e77b529..e311e99be5a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OrEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/OrEvaluator.java @@ -37,6 +37,7 @@ public OrEvaluator(StreamExpression expression, StreamFactory factory) throws IO } } + @Override protected Checker constructChecker(Object fromValue) throws IOException { if (null == fromValue) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/PairSortEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/PairSortEvaluator.java index 907420ef4f0..6a1b8e8efb2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/PairSortEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/PairSortEvaluator.java @@ -98,6 +98,7 @@ public Object doWork(Object first, Object second) throws IOException { } private class PairComp implements Comparator { + @Override public int compare(double[] a, double[] b) { if (a[0] > b[0]) { return 1; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveBooleanEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveBooleanEvaluator.java index bad8a8462e5..d42f2768be8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveBooleanEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveBooleanEvaluator.java @@ -33,6 +33,7 @@ public RecursiveBooleanEvaluator(StreamExpression expression, StreamFactory fact super(expression, factory); } + @Override public Object normalizeInputType(Object value) throws StreamEvaluatorException { if (null == value) { return null; @@ -41,6 +42,7 @@ public Object normalizeInputType(Object value) throws StreamEvaluatorException { } } + @Override public Object doWork(Object... values) throws IOException { if (values.length < 2) { String message = null; @@ -99,32 +101,38 @@ default boolean isNullAllowed() { } public interface NullChecker extends Checker { + @Override default boolean isNullAllowed() { return true; } + @Override default boolean isCorrectType(Object value) { return true; } + @Override default boolean test(Object left, Object right) { return null == left && null == right; } } public interface BooleanChecker extends Checker { + @Override default boolean isCorrectType(Object value) { return value instanceof Boolean; } } public interface NumberChecker extends Checker { + @Override default boolean isCorrectType(Object value) { return value instanceof Number; } } public interface StringChecker extends Checker { + @Override default boolean isCorrectType(Object value) { return value instanceof String; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveEvaluator.java index e9b2d0ad5b4..baa8bd592ca 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveEvaluator.java @@ -245,6 +245,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory).toString()); } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; @@ -253,6 +254,7 @@ public void setStreamContext(StreamContext context) { } } + @Override public StreamContext getStreamContext() { return streamContext; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericEvaluator.java index 0670fc6cdac..34e998b7091 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericEvaluator.java @@ -34,6 +34,7 @@ public RecursiveNumericEvaluator(StreamExpression expression, StreamFactory fact super(expression, factory); } + @Override public Object normalizeInputType(Object value) throws StreamEvaluatorException { if (null == value) { return null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericListEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericListEvaluator.java index 23c4c1fc6df..7a50c7eb6c6 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericListEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveNumericListEvaluator.java @@ -31,6 +31,7 @@ public RecursiveNumericListEvaluator(StreamExpression expression, StreamFactory super(expression, factory); } + @Override public Object normalizeInputType(Object value) throws StreamEvaluatorException { if (null == value) { return null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveTemporalEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveTemporalEvaluator.java index dd87179808e..385f3bf666b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveTemporalEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/RecursiveTemporalEvaluator.java @@ -58,6 +58,7 @@ public String getFunction() { protected abstract Object getDatePart(TemporalAccessor value); + @Override public Object normalizeInputType(Object value) throws StreamEvaluatorException { if (null == value) { return value; @@ -107,6 +108,7 @@ public Object normalizeInputType(Object value) throws StreamEvaluatorException { String.valueOf(value)))); } + @Override public Object doWork(Object value) { if (null == value) { return null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarDivideEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarDivideEvaluator.java index 16e7a286ec3..c11e4a8813e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarDivideEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarDivideEvaluator.java @@ -38,6 +38,7 @@ public ScalarDivideEvaluator(StreamExpression expression, StreamFactory factory) } } + @Override protected double operate(double value, double d) { return value / d; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarMultiplyEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarMultiplyEvaluator.java index 359fbac8188..c8722304928 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarMultiplyEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarMultiplyEvaluator.java @@ -38,6 +38,7 @@ public ScalarMultiplyEvaluator(StreamExpression expression, StreamFactory factor } } + @Override protected double operate(double value, double d) { return value * d; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarSubtractEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarSubtractEvaluator.java index 2f35c15fa2d..22797ae83c1 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarSubtractEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/ScalarSubtractEvaluator.java @@ -38,6 +38,7 @@ public ScalarSubtractEvaluator(StreamExpression expression, StreamFactory factor } } + @Override protected double operate(double value, double d) { return value - d; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/SourceEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/SourceEvaluator.java index b17b4cae80b..ad3dba8e4d9 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/SourceEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/SourceEvaluator.java @@ -25,10 +25,12 @@ public abstract class SourceEvaluator implements StreamEvaluator { protected UUID nodeId = UUID.randomUUID(); protected StreamContext streamContext; + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; } + @Override public StreamContext getStreamContext() { return streamContext; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TopFeaturesEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TopFeaturesEvaluator.java index 52bd17df339..c69ffd9091f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TopFeaturesEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TopFeaturesEvaluator.java @@ -103,6 +103,7 @@ public Pair(int _index, Number value) { this.value = value.doubleValue(); } + @Override public int compareTo(Pair pair) { int c = value.compareTo(pair.value); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TwoValueWorker.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TwoValueWorker.java index 9db674986ae..5ae9294893b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TwoValueWorker.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/TwoValueWorker.java @@ -23,6 +23,7 @@ public interface TwoValueWorker extends ValueWorker { Object doWork(Object value1, Object value2) throws IOException; + @Override default Object doWork(Object... values) throws IOException { if (2 != values.length) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/GatherNodesStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/GatherNodesStream.java index e59de3eccf9..f62b8e57fa7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/GatherNodesStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/GatherNodesStream.java @@ -470,6 +470,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.traversal = (Traversal) context.get("traversal"); if (traversal == null) { @@ -498,12 +499,14 @@ public void setStreamContext(StreamContext context) { } } + @Override public List children() { List l = new ArrayList<>(); l.add(tupleStream); return l; } + @Override public void open() throws IOException { tupleStream.open(); } @@ -517,6 +520,7 @@ public JoinRunner(List nodes) { this.nodes = nodes; } + @Override public List call() { Set flSet = new HashSet<>(); @@ -687,10 +691,12 @@ private String[] getWeekDayWindow(int size, int lag, String start) { } } + @Override public void close() throws IOException { tupleStream.close(); } + @Override public Tuple read() throws IOException { if (out == null) { @@ -840,6 +846,7 @@ public Tuple read() throws IOException { } } + @Override public int getCost() { return 0; } @@ -858,22 +865,28 @@ public NodeStream(List ids) { this.ids = ids; } + @Override public void open() { this.it = ids.iterator(); } + @Override public void close() {} + @Override public StreamComparator getStreamSort() { return null; } + @Override public List children() { return new ArrayList<>(); } + @Override public void setStreamContext(StreamContext context) {} + @Override public Tuple read() { if (it.hasNext()) { return new Tuple("node", it.next()); @@ -882,6 +895,7 @@ public Tuple read() { } } + @Override public String toString() { StringBuilder builder = new StringBuilder(); boolean comma = false; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java index 44e407f5f05..b506a79eee1 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/graph/ShortestPathStream.java @@ -324,15 +324,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException { List>> allVisited = new ArrayList<>(); @@ -470,6 +473,7 @@ public JoinRunner(List nodes) { this.nodes = nodes; } + @Override public List call() { ModifiableSolrParams joinParams = new ModifiableSolrParams(queryParams); @@ -543,10 +547,12 @@ private boolean cycle(String node, List>> allVisited) { return false; } + @Override public void close() throws IOException { this.found = false; } + @Override public Tuple read() throws IOException { if (shortestPaths.size() > 0) { found = true; @@ -561,6 +567,7 @@ public Tuple read() throws IOException { } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/DistinctOperation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/DistinctOperation.java index 76eddb66af4..367dcc59061 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/DistinctOperation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/DistinctOperation.java @@ -41,6 +41,7 @@ public DistinctOperation() { private void init() {} + @Override public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException { StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass())); return expression; @@ -55,6 +56,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory).toString()); } + @Override public Tuple reduce() { // Return the tuple after setting current to null. This will ensure the next call to // operate stores that tuple @@ -64,6 +66,7 @@ public Tuple reduce() { return toReturn; } + @Override public void operate(Tuple tuple) { // we only care about the first one seen. Drop all but the first if (null == current) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/GroupOperation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/GroupOperation.java index 7e722b7b058..1c58c01295d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/GroupOperation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/ops/GroupOperation.java @@ -95,6 +95,7 @@ private void init(StreamComparator streamComparator, int size) { this.priorityQueue = new PriorityQueue<>(size, this.comp); } + @Override public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException { StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass())); // n @@ -116,6 +117,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelpers(new Explanation[] {streamComparator.toExplanation(factory)}); } + @Override public Tuple reduce() { Deque> ll = new ArrayDeque<>(); while (priorityQueue.size() > 0) { @@ -130,6 +132,7 @@ public Tuple reduce() { return tuple; } + @Override public void operate(Tuple tuple) { if (priorityQueue.size() >= size) { Tuple peek = priorityQueue.peek(); @@ -149,6 +152,7 @@ public ReverseComp(StreamComparator comp) { this.comp = comp; } + @Override public int compare(Tuple t1, Tuple t2) { // Couldn't this be comp.compare(t2,t1) ? return comp.compare(t1, t2) * (-1); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/DriverImpl.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/DriverImpl.java index 2218b815ade..47366bb02dc 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/DriverImpl.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/sql/DriverImpl.java @@ -45,6 +45,7 @@ public class DriverImpl implements Driver { } } + @Override public Connection connect(String url, Properties props) throws SQLException { if (!acceptsURL(url)) { return null; @@ -76,27 +77,33 @@ public Connection connect(String url) throws SQLException { return connect(url, new Properties()); } + @Override public int getMajorVersion() { return 1; } + @Override public int getMinorVersion() { return 0; } + @Override public boolean acceptsURL(String url) { return url != null && url.startsWith("jdbc:solr"); } + @Override public boolean jdbcCompliant() { return false; } + @Override @SuppressForbidden(reason = "Required by jdbc") public Logger getParentLogger() { return null; } + @Override public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/BiJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/BiJoinStream.java index 099a19ae76b..5c8ecc3d8d9 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/BiJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/BiJoinStream.java @@ -72,6 +72,7 @@ private void init() throws IOException { rightStreamComparator = createSideComparator(eq, rightStream.getStreamSort()); } + @Override protected void validateTupleOrder() throws IOException { if (!isValidTupleOrder()) { throw new IOException( diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java index 5a3f21fa83a..d0d8e619b3f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java @@ -63,17 +63,22 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException {} + @Override public void close() throws IOException {} + @Override public Tuple read() throws IOException { if (finished) { @@ -85,10 +90,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java index 21558437c67..4884581b1b2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CartesianProductStream.java @@ -224,6 +224,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public Tuple read() throws IOException { if (generatedTuples.isEmpty()) { Tuple tuple = stream.read(); @@ -298,6 +299,7 @@ private boolean iterate( } /** Return the incoming sort + the sort applied to the generated tuples */ + @Override public StreamComparator getStreamSort() { if (null != orderBy) { return stream.getStreamSort().append(orderBy); @@ -305,6 +307,7 @@ public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); for (NamedEvaluator evaluator : evaluators) { @@ -312,22 +315,26 @@ public void setStreamContext(StreamContext context) { } } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); generatedTuples = new ArrayDeque<>(); } + @Override public void close() throws IOException { stream.close(); generatedTuples.clear(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java index 6a0b10eb1bb..92a0ffd37b9 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java @@ -101,10 +101,12 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); @@ -112,6 +114,7 @@ public List children() { return l; } + @Override public Tuple read() throws IOException { if (tuple.EOF) { return tuple; @@ -122,8 +125,10 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException {} + @Override public void open() throws IOException { try { stream.open(); @@ -146,10 +151,12 @@ public void open() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java index 0c552a77eb6..6cef1b2c9b6 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java @@ -278,11 +278,13 @@ public void setTrace(boolean trace) { this.trace = trace; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } /** Opens the CloudSolrStream */ + @Override public void open() throws IOException { this.tuples = new TreeSet<>(); this.solrStreams = new ArrayList<>(); @@ -295,6 +297,7 @@ public Map getEofTuples() { return this.eofTuples; } + @Override public List children() { return solrStreams; } @@ -431,6 +434,7 @@ private void openStreams() throws IOException { } /** Closes the CloudSolrStream */ + @Override public void close() throws IOException { if (solrStreams != null) { for (TupleStream solrStream : solrStreams) { @@ -440,10 +444,12 @@ public void close() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return comp; } + @Override public Tuple read() throws IOException { return _read(); } @@ -480,6 +486,7 @@ public TupleWrapper(SolrStream stream, StreamComparator comp) { this.comp = comp; } + @Override public int compareTo(TupleWrapper w) { if (this == w) { return 0; @@ -493,6 +500,7 @@ public int compareTo(TupleWrapper w) { } } + @Override public boolean equals(Object o) { return this == o; } @@ -527,6 +535,7 @@ public StreamOpener(SolrStream stream, StreamComparator comp) { this.comp = comp; } + @Override public TupleWrapper call() throws Exception { stream.open(); TupleWrapper wrapper = new TupleWrapper(stream, comp); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java index e8764da3461..1d589315a15 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java @@ -156,11 +156,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelper(eq.toExplanation(factory)); } + @Override public void setStreamContext(StreamContext context) { this.streamA.setStreamContext(context); this.streamB.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(streamA); @@ -168,16 +170,19 @@ public List children() { return l; } + @Override public void open() throws IOException { streamA.open(); streamB.open(); } + @Override public void close() throws IOException { streamA.close(); streamB.close(); } + @Override public Tuple read() throws IOException { while (true) { @@ -212,10 +217,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return streamA.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java index 452d3afd275..5fa7cec7cfa 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java @@ -106,24 +106,29 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) { this.originalStream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(originalStream); return l; } + @Override public void open() throws IOException { originalStream.open(); } + @Override public void close() throws IOException { originalStream.close(); } + @Override public Tuple read() throws IOException { Tuple tuple = originalStream.read(); ++lineNumber; @@ -183,10 +188,12 @@ protected String[] split(String line) { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return originalStream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java index 27163b7d520..414d2466a38 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DaemonStream.java @@ -199,10 +199,12 @@ public void init( } } + @Override public int hashCode() { return id.hashCode(); } + @Override public boolean equals(Object o) { if (o instanceof DaemonStream) { return id.equals(((DaemonStream) o).id); @@ -214,6 +216,7 @@ public String getId() { return id; } + @Override public void open() throws IOException { if (this.streamRunner != null && this.closed == false) { log.error("There is already a running daemon named '{}', no action taken", id); @@ -231,6 +234,7 @@ public void open() throws IOException { } } + @Override public Tuple read() throws IOException { try { return queue.take(); @@ -239,10 +243,12 @@ public Tuple read() throws IOException { } } + @Override public StreamComparator getStreamSort() { return tupleStream.getStreamSort(); } + @Override public void setStreamContext(StreamContext streamContext) { this.tupleStream.setStreamContext(streamContext); } @@ -251,6 +257,7 @@ public void shutdown() { streamRunner.setShutdown(true); } + @Override public void close() { if (closed) { return; @@ -261,6 +268,7 @@ public void close() { this.closed = true; } + @Override public List children() { List children = new ArrayList<>(); children.add(tupleStream); @@ -329,6 +337,7 @@ public State getState() { } } + @Override public void run() { executingThread = Thread.currentThread(); try { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DeepRandomStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DeepRandomStream.java index e97ffb17ec5..02bb701d5d3 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DeepRandomStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DeepRandomStream.java @@ -266,10 +266,12 @@ public void setTrace(boolean trace) { this.trace = trace; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } + @Override public void open() throws IOException { this.tuples = new ArrayDeque<>(); this.solrStreams = new ArrayList<>(); @@ -278,6 +280,7 @@ public void open() throws IOException { openStreams(); } + @Override public List children() { return solrStreams; } @@ -346,6 +349,7 @@ private void openStreams() throws IOException { } } + @Override public void close() throws IOException { if (solrStreams != null) { for (TupleStream solrStream : solrStreams) { @@ -355,10 +359,12 @@ public void close() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return comp; } + @Override public Tuple read() throws IOException { return _read(); } @@ -395,6 +401,7 @@ public TupleWrapper(SolrStream stream, StreamComparator comp) { this.comp = comp; } + @Override public int compareTo(TupleWrapper w) { if (this == w) { return 0; @@ -443,6 +450,7 @@ public StreamOpener(SolrStream stream, StreamComparator comp) { this.comp = comp; } + @Override public TupleWrapper call() throws Exception { stream.open(); TupleWrapper wrapper = new TupleWrapper(stream, comp); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DrillStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DrillStream.java index 6d1a9756dc8..355fb09c952 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DrillStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/DrillStream.java @@ -247,12 +247,14 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public List children() { List l = new ArrayList<>(); l.add(tupleStream); return l; } + @Override public Tuple read() throws IOException { Tuple tuple = _read(); @@ -263,6 +265,7 @@ public Tuple read() throws IOException { return tuple; } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; if (streamFactory == null) { @@ -271,6 +274,7 @@ public void setStreamContext(StreamContext streamContext) { this.tupleStream.setStreamContext(streamContext); } + @Override protected void constructStreams() throws IOException { try { Object pushStream = ((Expressible) tupleStream).toExpression(streamFactory); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java index 002170a0bb2..c12bbcddca0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java @@ -77,17 +77,22 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException {} + @Override public void close() throws IOException {} + @Override public Tuple read() throws IOException { if (finished) { @@ -99,10 +104,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EvalStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EvalStream.java index b82ce0ee251..cc055318100 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EvalStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EvalStream.java @@ -100,17 +100,20 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; this.stream.setStreamContext(streamContext); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { try { stream.open(); @@ -129,18 +132,22 @@ public void open() throws IOException { } } + @Override public void close() throws IOException { evalStream.close(); } + @Override public Tuple read() throws IOException { return evalStream.read(); } + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExceptionStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExceptionStream.java index 70e37e6a5db..f6dec46bdf0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExceptionStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExceptionStream.java @@ -42,10 +42,12 @@ public ExceptionStream(TupleStream stream) { this.stream = stream; } + @Override public List children() { return null; } + @Override public void open() { try { stream.open(); @@ -54,6 +56,7 @@ public void open() { } } + @Override public Tuple read() { if (openException != null) { // There was an exception during the open. @@ -79,14 +82,17 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression("non-expressible"); } + @Override public StreamComparator getStreamSort() { return this.stream.getStreamSort(); } + @Override public void close() throws IOException { stream.close(); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java index 122eceef98a..0a5dbb9d828 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ExecutorStream.java @@ -134,17 +134,20 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; this.stream.setStreamContext(streamContext); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { executorService = ExecutorUtil.newMDCAwareFixedThreadPool( @@ -152,6 +155,7 @@ public void open() throws IOException { stream.open(); } + @Override public void close() throws IOException { stream.close(); executorService.shutdown(); @@ -162,6 +166,7 @@ public void close() throws IOException { } } + @Override public Tuple read() throws IOException { ArrayBlockingQueue queue = new ArrayBlockingQueue<>(10000); while (true) { @@ -179,10 +184,12 @@ public Tuple read() throws IOException { } } + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } @@ -203,6 +210,7 @@ public StreamTask( this.streamContext.setModelCache(streamContext.getModelCache()); } + @Override public void run() { Tuple tuple = null; try { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/Facet2DStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/Facet2DStream.java index fbba51a9305..23e3f780d7f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/Facet2DStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/Facet2DStream.java @@ -309,14 +309,17 @@ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOEx return expression; } + @Override public void setStreamContext(StreamContext context) { cache = context.getSolrClientCache(); } + @Override public List children() { return new ArrayList<>(); } + @Override public void open() throws IOException { if (cache != null) { cloudSolrClient = cache.getCloudSolrClient(zkHost); @@ -349,6 +352,7 @@ public void open() throws IOException { } } + @Override public Tuple read() throws IOException { if (out.hasNext()) { return out.next(); @@ -359,6 +363,7 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException { if (cache == null) { if (cloudSolrClient != null) { @@ -513,6 +518,7 @@ private void fillTuples( } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java index c09a97d1af8..49534b3237b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java @@ -643,15 +643,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.context = context; cache = context.getSolrClientCache(); } + @Override public List children() { return new ArrayList<>(); } + @Override public void open() throws IOException { if (cache != null) { cloudSolrClient = cache.getCloudSolrClient(zkHost); @@ -755,6 +758,7 @@ private boolean expectedJson(String json) { return true; } + @Override public void close() throws IOException { if (cache == null) { if (cloudSolrClient != null) { @@ -763,6 +767,7 @@ public void close() throws IOException { } } + @Override public Tuple read() throws IOException { // if we're parallelizing the facet expression over multiple collections with plist, // then delegate the read operation to that stream instead @@ -992,6 +997,7 @@ private void fillTuples( } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FeaturesSelectionStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FeaturesSelectionStream.java index 6ba0048b876..d4990800cd4 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FeaturesSelectionStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FeaturesSelectionStream.java @@ -252,12 +252,14 @@ private void init( this.numTerms = numTopTerms; } + @Override public void setStreamContext(StreamContext context) { this.cache = context.getSolrClientCache(); this.streamContext = context; } /** Opens the CloudSolrStream */ + @Override public void open() throws IOException { if (cache == null) { isCloseCache = true; @@ -272,6 +274,7 @@ public void open() throws IOException { new SolrNamedThreadFactory("FeaturesSelectionStream")); } + @Override public List children() { return null; } @@ -320,6 +323,7 @@ private List>> callShards(List baseUrls) throws IOEx return futures; } + @Override public void close() throws IOException { if (isCloseCache && cache != null) { cache.close(); @@ -331,6 +335,7 @@ public void close() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } @@ -344,6 +349,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory).toString()); } + @Override public Tuple read() throws IOException { try { if (tupleIterator == null) { @@ -427,6 +433,7 @@ public FeaturesSelectionCall( this.paramsMap = paramsMap; } + @Override public NamedList call() throws Exception { ModifiableSolrParams params = new ModifiableSolrParams(); SolrClient solrClient = cache.getHttpSolrClient(baseUrl); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FetchStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FetchStream.java index 7afbb5dd6e0..39931bdb021 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FetchStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FetchStream.java @@ -218,17 +218,20 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; this.stream.setStreamContext(streamContext); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { tuples = Collections.emptyIterator(); stream.open(); @@ -303,10 +306,12 @@ private void fetchBatch() throws IOException { this.tuples = batch.iterator(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { if (!tuples.hasNext()) { fetchBatch(); @@ -315,10 +320,12 @@ public Tuple read() throws IOException { return tuples.next(); } + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/GetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/GetStream.java index af5cc45eeef..c149ebc819d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/GetStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/GetStream.java @@ -78,15 +78,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public Tuple read() throws IOException { if (tupleIterator.hasNext()) { Tuple t = tupleIterator.next(); @@ -96,8 +99,10 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException {} + @Override public void open() throws IOException { Map lets = streamContext.getLets(); Object o = lets.get(name); @@ -109,10 +114,12 @@ public void open() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java index 47ff6477e8c..53cc4678010 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java @@ -207,11 +207,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) { this.hashStream.setStreamContext(context); this.fullStream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(hashStream); @@ -219,6 +221,7 @@ public List children() { return l; } + @Override public void open() throws IOException { hashStream.open(); fullStream.open(); @@ -253,11 +256,13 @@ protected String computeHash(Tuple tuple, List hashOn) { return sb.toString(); } + @Override public void close() throws IOException { hashStream.close(); fullStream.close(); } + @Override public Tuple read() throws IOException { findNextWorkingFullTuple: @@ -305,6 +310,7 @@ public StreamComparator getStreamSort() { return fullStream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java index 2c6089d7e25..adacba5578d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java @@ -186,25 +186,30 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.tupleStream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(tupleStream); return l; } + @Override public void open() throws IOException { tupleStream.open(); } + @Override public void close() throws IOException { tupleStream.close(); tupleIterator = null; } + @Override public Tuple read() throws IOException { // On the first call to read build the tupleIterator. if (tupleIterator == null) { @@ -258,6 +263,7 @@ public Tuple read() throws IOException { return tupleIterator.next(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java index 834b69d1b7c..e151aaa19f7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java @@ -134,26 +134,31 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelpers(new Explanation[] {evaluator.toExplanation(factory)}); } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; this.stream.setStreamContext(context); this.evaluator.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { while (true) { Tuple tuple = stream.read(); @@ -169,10 +174,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java index a01ec94cbbb..4bcf0aeef1d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java @@ -50,6 +50,7 @@ public InnerJoinStream(StreamExpression expression, StreamFactory factory) throw super(expression, factory); } + @Override public Tuple read() throws IOException { // if we've already figured out the next joined tuple then just return it if (joinedTuples.size() > 0) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java index 61692a9486d..04f32dcf72b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java @@ -156,11 +156,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelper(eq.toExplanation(factory)); } + @Override public void setStreamContext(StreamContext context) { this.streamA.setStreamContext(context); this.streamB.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(streamA); @@ -168,16 +170,19 @@ public List children() { return l; } + @Override public void open() throws IOException { streamA.open(); streamB.open(); } + @Override public void close() throws IOException { streamA.close(); streamB.close(); } + @Override public Tuple read() throws IOException { while (true) { @@ -214,10 +219,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return streamA.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JDBCStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JDBCStream.java index 90de36458e9..3d0faed094c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JDBCStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JDBCStream.java @@ -272,6 +272,7 @@ private void init( this.fetchSize = fetchSize; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } @@ -315,6 +316,7 @@ protected Driver getDriver() throws IOException { } /** Opens the JDBCStream */ + @Override public void open() throws IOException { try { connection = getDriver().connect(connectionUrl, connectionProperties); @@ -614,6 +616,7 @@ public String getColumnName() { } /** Closes the JDBCStream */ + @Override public void close() throws IOException { try { if (null != resultSet) { // it's not required in JDBC that ResultSet implements isClosed() @@ -630,6 +633,7 @@ public void close() throws IOException { } } + @Override public Tuple read() throws IOException { try { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JSONTupleStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JSONTupleStream.java index e5f67802868..781fcc3d10c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JSONTupleStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JSONTupleStream.java @@ -89,6 +89,7 @@ public Map next() throws IOException { return (Map) o; } + @Override public void close() throws IOException { reader.close(); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java index c281e270265..b07f52e1500 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java @@ -148,24 +148,28 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { for (PushBackStream stream : streams) { stream.setStreamContext(context); } } + @Override public void open() throws IOException { for (PushBackStream stream : streams) { stream.open(); } } + @Override public void close() throws IOException { for (PushBackStream stream : streams) { stream.close(); } } + @Override public List children() { List list = new ArrayList<>(); for (TupleStream stream : streams) { @@ -234,6 +238,7 @@ protected Tuple loadEqualTupleGroup( return firstMember; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java index 2a2150c1a57..fb1d2ba6e63 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java @@ -191,15 +191,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { cache = context.getSolrClientCache(); } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException { cloudSolrClient = cache.getCloudSolrClient(zkHost); ModifiableSolrParams params = getParams(this.props); @@ -232,8 +235,10 @@ public void open() throws IOException { } } + @Override public void close() throws IOException {} + @Override public Tuple read() throws IOException { if (documentIterator.hasNext()) { Tuple tuple = new Tuple(); @@ -256,6 +261,7 @@ private ModifiableSolrParams getParams(Map props) { return params; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java index 8b44fd96be3..8d61828c2f1 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java @@ -52,6 +52,7 @@ public LeftOuterJoinStream(StreamExpression expression, StreamFactory factory) super(expression, factory); } + @Override public Tuple read() throws IOException { // if we've already figured out the next joined tuple then just return it if (joinedTuples.size() > 0) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java index 74057a9da4e..e5a6c4113ab 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java @@ -140,11 +140,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); @@ -152,14 +154,17 @@ public List children() { return l; } + @Override public Tuple read() throws IOException { return stream.read(); } + @Override public void close() throws IOException { stream.close(); } + @Override public void open() throws IOException { Map lets = streamContext.getLets(); Set> entries = letParams.entrySet(); @@ -210,10 +215,12 @@ public void open() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java index 13b24129892..7d0f16a9a6c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java @@ -90,12 +90,14 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { for (TupleStream stream : streams) { stream.setStreamContext(context); } } + @Override public List children() { List l = new ArrayList<>(); for (TupleStream stream : streams) { @@ -104,6 +106,7 @@ public List children() { return l; } + @Override public Tuple read() throws IOException { while (true) { if (currentStream == null) { @@ -130,15 +133,19 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException {} + @Override public void open() throws IOException {} /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java index 82d97b86a0f..cb915119543 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java @@ -156,12 +156,14 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { for (PushBackStream stream : streams) { stream.setStreamContext(context); } } + @Override public List children() { List l = new ArrayList<>(); for (PushBackStream stream : streams) { @@ -170,18 +172,21 @@ public List children() { return l; } + @Override public void open() throws IOException { for (PushBackStream stream : streams) { stream.open(); } } + @Override public void close() throws IOException { for (PushBackStream stream : streams) { stream.close(); } } + @Override public Tuple read() throws IOException { // might be able to optimize this by sorting the streams based on the next to read tuple from @@ -254,10 +259,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return comp; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java index e716628b4c7..727df5560a5 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java @@ -160,23 +160,28 @@ private void init(String collectionName, String zkHost, String modelID, long cac this.cacheMillis = cacheMillis; } + @Override public void setStreamContext(StreamContext context) { this.solrClientCache = context.getSolrClientCache(); this.modelCache = context.getModelCache(); } + @Override public void open() throws IOException { this.model = modelCache.getModel(collection, modelID, cacheMillis); } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void close() throws IOException {} /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } @@ -192,6 +197,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public Tuple read() throws IOException { Tuple tuple = null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java index 300595c7e78..bf83ed40340 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java @@ -66,26 +66,33 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) {} + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException {} + @Override public void close() throws IOException {} + @Override public Tuple read() throws IOException { return Tuple.EOF(); } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java index b43f7dfc7d0..ba3fc0b9126 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java @@ -99,26 +99,31 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { start = new Date().getTime(); count = 0; stream.open(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { if (eof != null) { @@ -141,10 +146,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/OuterHashJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/OuterHashJoinStream.java index fe0ec1b2d42..417bf464271 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/OuterHashJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/OuterHashJoinStream.java @@ -92,6 +92,7 @@ public StreamExpression toExpression(StreamFactory factory) throws IOException { return expression; } + @Override public Tuple read() throws IOException { if (null == workingFullTuple) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelListStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelListStream.java index 37b56df8dea..e16daa27f70 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelListStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelListStream.java @@ -93,12 +93,14 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { for (TupleStream stream : streams) { stream.setStreamContext(context); } } + @Override public List children() { List l = new ArrayList(); for (TupleStream stream : streams) { @@ -107,6 +109,7 @@ public List children() { return l; } + @Override public Tuple read() throws IOException { while (true) { if (currentStream == null) { @@ -128,8 +131,10 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException {} + @Override public void open() throws IOException { openStreams(); } @@ -167,6 +172,7 @@ public StreamOpener(StreamIndex streamIndex) { this.streamIndex = streamIndex; } + @Override public StreamIndex call() throws Exception { streamIndex.getTupleStream().open(); return streamIndex; @@ -192,10 +198,12 @@ public TupleStream getTupleStream() { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelStream.java index 580c28bfcd4..bc385c72354 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ParallelStream.java @@ -243,12 +243,14 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public List children() { List l = new ArrayList<>(); l.add(tupleStream); return l; } + @Override public Tuple read() throws IOException { Tuple tuple = _read(); @@ -273,6 +275,7 @@ public Tuple read() throws IOException { return tuple; } + @Override public void setStreamContext(StreamContext streamContext) { this.streamContext = streamContext; if (streamFactory == null) { @@ -281,6 +284,7 @@ public void setStreamContext(StreamContext streamContext) { this.tupleStream.setStreamContext(streamContext); } + @Override protected void constructStreams() throws IOException { try { Object pushStream = ((Expressible) tupleStream).toExpression(streamFactory); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java index a0f03c8d019..a1ae5326bce 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java @@ -137,6 +137,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; @@ -150,11 +151,13 @@ public void setStreamContext(StreamContext context) { } } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public Tuple read() throws IOException { if (finished) { @@ -209,19 +212,23 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException { // Nothing to do here } + @Override public void open() throws IOException { // nothing to do here } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return new SingleValueComparator(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PriorityStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PriorityStream.java index c9d034d4003..87e90a18de2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PriorityStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PriorityStream.java @@ -125,11 +125,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext streamContext) { this.highPriorityTasks.setStreamContext(streamContext); tasks.setStreamContext(streamContext); } + @Override public List children() { List l = new ArrayList<>(); l.add(highPriorityTasks); @@ -137,6 +139,7 @@ public List children() { return l; } + @Override public void open() throws IOException { highPriorityTasks.open(); Tuple tuple = highPriorityTasks.read(); @@ -150,18 +153,22 @@ public void open() throws IOException { } } + @Override public void close() throws IOException { currentStream.close(); } + @Override public Tuple read() throws IOException { return currentStream.read(); } + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java index 07280543d4e..7698dde2252 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java @@ -44,6 +44,7 @@ public PushBackStream(TupleStream stream) { this.stream = stream; } + @Override public StreamExpressionParameter toExpression(StreamFactory factory) throws IOException { if (stream instanceof Expressible) { return ((Expressible) stream).toExpression(factory); @@ -53,24 +54,29 @@ public StreamExpressionParameter toExpression(StreamFactory factory) throws IOEx "This PushBackStream contains a non-expressible TupleStream - it cannot be converted to an expression"); } + @Override public Explanation toExplanation(StreamFactory factory) throws IOException { return stream.toExplanation(factory); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); } + @Override public void close() throws IOException { stream.close(); } @@ -79,6 +85,7 @@ public void pushBack(Tuple tuple) { this.tuple = tuple; } + @Override public Tuple read() throws IOException { if (tuple != null) { Tuple t = tuple; @@ -93,10 +100,12 @@ public Tuple read() throws IOException { * Return the stream sort - ie, the order in which records are returned This returns the * streamSort of the substream */ + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java index 963ed9940d0..2b0ddaba92b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java @@ -135,26 +135,32 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return innerStream.toExplanation(factory); } + @Override public void setStreamContext(StreamContext context) { this.innerStream.setStreamContext(context); } + @Override public List children() { return innerStream.children(); } + @Override public void open() throws IOException { innerStream.open(); } + @Override public void close() throws IOException { innerStream.close(); } + @Override public Tuple read() throws IOException { return innerStream.read(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java index 49cc065aaa7..48538d20d8b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java @@ -197,15 +197,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { cache = context.getSolrClientCache(); } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException { if (cache != null) { cloudSolrClient = cache.getCloudSolrClient(zkHost); @@ -239,12 +242,14 @@ public void open() throws IOException { } } + @Override public void close() throws IOException { if (cache == null) { cloudSolrClient.close(); } } + @Override public Tuple read() throws IOException { if (documentIterator.hasNext()) { Tuple tuple = new Tuple(); @@ -274,6 +279,7 @@ private ModifiableSolrParams getParams(Map props) { return params; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java index e9989cd6b90..1728b6c1b1e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java @@ -180,22 +180,26 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelper(comp.toExplanation(factory)); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { this.top = new PriorityQueue<>(size, new ReverseComp(comp)); this.topList = new ArrayDeque<>(); stream.open(); } + @Override public void close() throws IOException { stream.close(); } @@ -204,6 +208,7 @@ public StreamComparator getComparator() { return this.comp; } + @Override public Tuple read() throws IOException { if (!finished) { while (true) { @@ -235,10 +240,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return comp; } + @Override public int getCost() { return 0; } @@ -252,6 +259,7 @@ public ReverseComp(StreamComparator comp) { this.comp = comp; } + @Override public int compare(Tuple t1, Tuple t2) { return comp.compare(t1, t2) * (-1); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java index 460fd2e5d50..75d185d29bf 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java @@ -198,24 +198,29 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelpers(new Explanation[] {eq.toExplanation(factory), op.toExplanation(factory)}); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { while (true) { @@ -250,10 +255,12 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return stream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java index afa5a587bb9..91eb8771ceb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java @@ -188,20 +188,24 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.tupleStream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(tupleStream); return l; } + @Override public void open() throws IOException { tupleStream.open(); } + @Override public void close() throws IOException { tupleStream.close(); this.currentMetrics = null; @@ -209,6 +213,7 @@ public void close() throws IOException { this.finished = false; } + @Override public Tuple read() throws IOException { while (true) { @@ -277,6 +282,7 @@ public Tuple read() throws IOException { } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java index 91e6391bacd..ea10185f730 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java @@ -161,17 +161,20 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void setStreamContext(StreamContext context) { this.clientCache = context.getSolrClientCache(); this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); Tuple node = null; @@ -256,6 +259,7 @@ public void open() throws IOException { tuples = nodes.values().iterator(); } + @Override public void close() throws IOException { stream.close(); } @@ -264,6 +268,7 @@ public StreamComparator getComparator() { return null; } + @Override public Tuple read() throws IOException { if (tuples.hasNext()) { return tuples.next(); @@ -272,10 +277,12 @@ public Tuple read() throws IOException { } } + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchFacadeStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchFacadeStream.java index 027d04ea957..f5702ed4034 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchFacadeStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchFacadeStream.java @@ -114,28 +114,34 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return innerStream.toExplanation(factory); } + @Override public void setStreamContext(StreamContext context) { this.innerStream.setStreamContext(context); } /** Opens the CloudSolrStream */ + @Override public void open() throws IOException { innerStream.open(); } + @Override public List children() { return innerStream.children(); } /** Closes the CloudSolrStream */ + @Override public void close() throws IOException { innerStream.close(); } + @Override public Tuple read() throws IOException { return innerStream.read(); } + @Override public StreamComparator getStreamSort() { return innerStream.getStreamSort(); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchStream.java index 87e8d6c3a8a..1e6226b7536 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SearchStream.java @@ -182,15 +182,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { cache = context.getSolrClientCache(); } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException { if (cache != null) { cloudSolrClient = cache.getCloudSolrClient(zkHost); @@ -210,12 +213,14 @@ public void open() throws IOException { } } + @Override public void close() throws IOException { if (cache == null) { cloudSolrClient.close(); } } + @Override public Tuple read() throws IOException { if (documentIterator.hasNext()) { Tuple tuple = new Tuple(); @@ -229,6 +234,7 @@ public Tuple read() throws IOException { } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java index edbb22f3d67..80219e797bb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java @@ -256,6 +256,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; this.stream.setStreamContext(context); @@ -266,20 +267,24 @@ public void setStreamContext(StreamContext context) { } } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { Tuple original = stream.read(); @@ -325,11 +330,13 @@ public Tuple read() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { // apply aliasing to comparator return stream.getStreamSort().copyAliased(selectedFields); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ShuffleStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ShuffleStream.java index 10dc68a77c0..f315b4af1eb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ShuffleStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ShuffleStream.java @@ -192,6 +192,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public ModifiableSolrParams adjustParams(ModifiableSolrParams mParams) { mParams.set(CommonParams.QT, "/export"); return mParams; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java index a7aa7c836a4..7e47003fa63 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java @@ -237,11 +237,13 @@ private void init( this.minTermLength = minTermLength; } + @Override public void setStreamContext(StreamContext context) { this.cache = context.getSolrClientCache(); this.streamContext = context; } + @Override public void open() throws IOException { if (cache == null) { isCloseCache = true; @@ -255,6 +257,7 @@ public void open() throws IOException { new SolrNamedThreadFactory("SignificantTermsStream")); } + @Override public List children() { return null; } @@ -280,6 +283,7 @@ private List>> callShards(List baseUrls) throws IOEx return futures; } + @Override public void close() throws IOException { if (isCloseCache) { cache.close(); @@ -289,6 +293,7 @@ public void close() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } @@ -302,6 +307,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory).toString()); } + @Override public Tuple read() throws IOException { try { if (tupleIterator == null) { @@ -373,6 +379,7 @@ public Tuple read() throws IOException { } private static class ScoreComp implements Comparator> { + @Override public int compare(Map a, Map b) { Float scorea = (Float) a.get("score"); Float scoreb = (Float) b.get("score"); @@ -408,6 +415,7 @@ public SignificantTermsCall( this.minTermLength = minTermLength; } + @Override public NamedList call() throws Exception { ModifiableSolrParams params = new ModifiableSolrParams(); SolrClient solrClient = cache.getHttpSolrClient(baseUrl); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java index eb9d220df4b..8f019c36e61 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java @@ -90,6 +90,7 @@ public void setFieldMappings(Map fieldMappings) { this.fieldMappings = fieldMappings; } + @Override public List children() { return new ArrayList<>(); } @@ -98,6 +99,7 @@ public String getBaseUrl() { return baseUrl; } + @Override public void setStreamContext(StreamContext context) { this.distrib = !context.isLocal(); this.numWorkers = context.numWorkers; @@ -111,6 +113,7 @@ public void setCredentials(String user, String password) { } /** Opens the stream to a single Solr instance. */ + @Override public void open() throws IOException { // Reuse the same client per node vs. having one per replica @@ -185,6 +188,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { } /** Closes the Stream to a single Solr Instance */ + @Override public void close() throws IOException { if (closeableHttpResponse != null) { closeableHttpResponse.close(); @@ -195,6 +199,7 @@ public void close() throws IOException { } /** Reads a Tuple from the stream. The Stream is completed when Tuple.EOF == true. */ + @Override public Tuple read() throws IOException { try { Map fields = tupleStreamParser.next(); @@ -250,6 +255,7 @@ public HandledException(String msg) { } /** There is no known sort applied to a SolrStream */ + @Override public StreamComparator getStreamSort() { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java index 8bbae8b95a9..ea95ca1cd69 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java @@ -100,6 +100,7 @@ private void init(TupleStream stream, StreamComparator comp) throws IOException private Tuple eofTuple; + @Override public void readStream(TupleStream stream) throws IOException { Tuple tuple = stream.read(); while (!tuple.EOF) { @@ -109,10 +110,12 @@ public void readStream(TupleStream stream) throws IOException { eofTuple = tuple; } + @Override public void sort() { tuples.sort(comparator); } + @Override public Tuple read() { if (tuples.isEmpty()) { return eofTuple; @@ -168,16 +171,19 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelper(comparator.toExplanation(factory)); } + @Override public void setStreamContext(StreamContext context) { this.stream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void open() throws IOException { stream.open(); @@ -185,20 +191,24 @@ public void open() throws IOException { worker.sort(); } + @Override public void close() throws IOException { stream.close(); } + @Override public Tuple read() throws IOException { // return next from sorted order return worker.read(); } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return comparator; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java index c55504c653e..a0419567d1d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SqlStream.java @@ -185,15 +185,18 @@ protected void init(String collectionName, String zkHost, SolrParams params) thr } } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } + @Override public void open() throws IOException { constructStream(); tupleStream.open(); } + @Override public List children() { return null; } @@ -218,15 +221,18 @@ protected void constructStream() throws IOException { } } + @Override public void close() throws IOException { tupleStream.close(); } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public Tuple read() throws IOException { return tupleStream.read(); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StatsStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StatsStream.java index c4338b3c690..275482dda89 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StatsStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StatsStream.java @@ -213,15 +213,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.context = context; cache = context.getSolrClientCache(); } + @Override public List children() { return new ArrayList<>(); } + @Override public void open() throws IOException { @SuppressWarnings({"unchecked"}) @@ -290,8 +293,10 @@ private String getShardString(List shards) { return builder.toString(); } + @Override public void close() throws IOException {} + @Override public Tuple read() throws IOException { if (parallelizedStream != null) { return parallelizedStream.read(); @@ -383,6 +388,7 @@ private void fillTuple(Tuple t, NamedList nl, Metric[] _metrics) { } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java index 57c370e7b9b..1f746ef35f8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java @@ -353,6 +353,7 @@ private void init( this.iteration = iteration; } + @Override public void setStreamContext(StreamContext context) { this.cache = context.getSolrClientCache(); this.streamContext = context; @@ -360,6 +361,7 @@ public void setStreamContext(StreamContext context) { } /** Opens the CloudSolrStream */ + @Override public void open() throws IOException { if (cache == null) { isCloseCache = true; @@ -373,6 +375,7 @@ public void open() throws IOException { ExecutorUtil.newMDCAwareCachedThreadPool(new SolrNamedThreadFactory("TextLogitSolrStream")); } + @Override public List children() { List l = new ArrayList<>(); l.add(termsStream); @@ -432,6 +435,7 @@ private List> callShards(List baseUrls) throws IOException return futures; } + @Override public void close() throws IOException { if (isCloseCache && cache != null) { cache.close(); @@ -444,6 +448,7 @@ public void close() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } @@ -480,6 +485,7 @@ public void loadTerms() throws IOException { } } + @Override public Tuple read() throws IOException { try { @@ -670,6 +676,7 @@ public LogitCall( this.paramsMap = paramsMap; } + @Override public Tuple call() throws Exception { ModifiableSolrParams params = new ModifiableSolrParams(); SolrClient solrClient = cache.getHttpSolrClient(baseUrl); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TimeSeriesStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TimeSeriesStream.java index cf239fc1c9f..a7c3c79bb76 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TimeSeriesStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TimeSeriesStream.java @@ -336,14 +336,17 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { cache = context.getSolrClientCache(); } + @Override public List children() { return new ArrayList<>(); } + @Override public void open() throws IOException { if (cache != null) { cloudSolrClient = cache.getCloudSolrClient(zkHost); @@ -368,12 +371,14 @@ public void open() throws IOException { } } + @Override public void close() throws IOException { if (cache == null) { cloudSolrClient.close(); } } + @Override public Tuple read() throws IOException { if (index < tuples.size()) { Tuple tuple = tuples.get(index); @@ -595,6 +600,7 @@ private void fillTuples( } } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java index cc4175c9036..54dc364fcf3 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java @@ -302,11 +302,13 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public void open() throws IOException { this.tuples = new TreeSet<>(); this.solrStreams = new ArrayList<>(); @@ -364,6 +366,7 @@ private void openStreams() throws IOException { } } + @Override public void close() throws IOException { try { @@ -387,6 +390,7 @@ public void close() throws IOException { } } + @Override public Tuple read() throws IOException { Tuple tuple = _read(); @@ -416,6 +420,7 @@ public Tuple read() throws IOException { return tuple; } + @Override public int getCost() { return 0; } @@ -530,6 +535,7 @@ private void getPersistedCheckpoints() throws IOException { } } + @Override protected void constructStreams() throws IOException { try { Slice[] slices = CloudSolrStream.getSlices(this.collection, cloudSolrClient, false); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TsvStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TsvStream.java index ef10761a9ad..7a55a8f5466 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TsvStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TsvStream.java @@ -72,6 +72,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override protected String[] split(String line) { String[] parts = line.split("\\t", -1); return parts; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java index a755932bac4..bf982011f6a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java @@ -136,6 +136,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; @@ -149,11 +150,13 @@ public void setStreamContext(StreamContext context) { } } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public Tuple read() throws IOException { if (unnestedTuples == null) { @@ -176,10 +179,12 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException { // Nothing to do here } + @Override public void open() throws IOException { Map values = new HashMap<>(); @@ -241,10 +246,12 @@ public void open() throws IOException { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return new SingleValueComparator(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupleStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupleStream.java index 6d848c24106..13faf73acde 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupleStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupleStream.java @@ -60,6 +60,7 @@ public TupleStream() {} public abstract void open() throws IOException; + @Override public abstract void close() throws IOException; public abstract Tuple read() throws IOException; @@ -217,10 +218,12 @@ public static List getShards( } public static class IgnoreException extends IOException { + @Override public void printStackTrace(PrintWriter pw) { pw.print("Early Client Disconnect"); } + @Override public String getMessage() { return "Early Client Disconnect"; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java index 704f35d5297..c63e3bf87cc 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java @@ -154,36 +154,43 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withHelper(originalEqualitor.toExplanation(factory)); } + @Override public void setStreamContext(StreamContext context) { this.originalStream.setStreamContext(context); this.reducerStream.setStreamContext(context); } + @Override public List children() { List l = new ArrayList<>(); l.add(originalStream); return l; } + @Override public void open() throws IOException { reducerStream.open(); // opens originalStream as well } + @Override public void close() throws IOException { reducerStream.close(); // closes originalStream as well } + @Override public Tuple read() throws IOException { return reducerStream.read(); } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return reducerStream.getStreamSort(); } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java index 37a62180336..d79534849ab 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java @@ -101,15 +101,18 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { return explanation; } + @Override public void setStreamContext(StreamContext context) { this.streamContext = context; } + @Override public List children() { List l = new ArrayList<>(); return l; } + @Override public Tuple read() throws IOException { if (out.hasNext()) { return out.next(); @@ -118,8 +121,10 @@ public Tuple read() throws IOException { } } + @Override public void close() throws IOException {} + @Override public void open() throws IOException { Map lets = streamContext.getLets(); Set> entries = letParams.entrySet(); @@ -423,10 +428,12 @@ private static String prepend(String v, int length) { } /** Return the stream sort - ie, the order in which records are returned */ + @Override public StreamComparator getStreamSort() { return null; } + @Override public int getCost() { return 0; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java index 521e107024a..027a1b94878 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java @@ -57,6 +57,7 @@ public void addChild(Explanation child) { children.add(child); } + @Override public Map toMap(Map map) { map = super.toMap(map); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamFactory.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamFactory.java index 970a0ab75e7..ec3615fbbcc 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamFactory.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamFactory.java @@ -73,6 +73,7 @@ public StreamFactory withDefaultZkHost(String zkHost) { return this; } + @Override public Object clone() { // Shallow copy StreamFactory clone = new StreamFactory(functionNames); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/Bucket.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/Bucket.java index 2013894f02a..35a32b3b66b 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/Bucket.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/Bucket.java @@ -37,6 +37,7 @@ public Object getBucketValue(Tuple tuple) { } } + @Override public String toString() { return bucketKey; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountDistinctMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountDistinctMetric.java index fd207f5045e..678f6eea84c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountDistinctMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountDistinctMetric.java @@ -64,18 +64,22 @@ private void init(String functionName, String columnName) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public void update(Tuple tuple) { // Nop for now } + @Override public Metric newInstance() { return new CountDistinctMetric(columnName); } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public Number getValue() { // No op for now return null; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountMetric.java index 40d81e8915c..203b3b3d043 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/CountMetric.java @@ -49,6 +49,7 @@ public CountMetric(StreamExpression expression, StreamFactory factory) throws IO init(functionName, columnName); } + @Override public String[] getColumns() { if (isAllColumns()) { return new String[0]; @@ -68,16 +69,19 @@ private boolean isAllColumns() { return isAllColumns; } + @Override public void update(Tuple tuple) { if (isAllColumns() || tuple.get(columnName) != null) { ++count; } } + @Override public Long getValue() { return count; } + @Override public Metric newInstance() { return new CountMetric(columnName); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MaxMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MaxMetric.java index bfe47fdde9e..20958de16f2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MaxMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MaxMetric.java @@ -60,6 +60,7 @@ private void init(String functionName, String columnName) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public Number getValue() { if (longMax == Long.MIN_VALUE) { return doubleMax; @@ -68,10 +69,12 @@ public Number getValue() { } } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public void update(Tuple tuple) { Object o = tuple.get(columnName); if (o instanceof Double) { @@ -99,6 +102,7 @@ public void update(Tuple tuple) { } } + @Override public Metric newInstance() { return new MaxMetric(columnName); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MeanMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MeanMetric.java index e95add92172..44eb2119b60 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MeanMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MeanMetric.java @@ -74,6 +74,7 @@ private void init(String functionName, String columnName, boolean outputLong) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public void update(Tuple tuple) { ++count; Object o = tuple.get(columnName); @@ -92,14 +93,17 @@ public void update(Tuple tuple) { } } + @Override public Metric newInstance() { return new MeanMetric(columnName, outputLong); } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public Number getValue() { double dcount = (double) count; if (longSum == 0) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MinMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MinMetric.java index b551d1b6e65..a36c5b5768c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MinMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/MinMetric.java @@ -61,10 +61,12 @@ private void init(String functionName, String columnName) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public Number getValue() { if (longMin == Long.MAX_VALUE) { return doubleMin; @@ -73,6 +75,7 @@ public Number getValue() { } } + @Override public void update(Tuple tuple) { Object o = tuple.get(columnName); if (o instanceof Double) { @@ -100,6 +103,7 @@ public void update(Tuple tuple) { } } + @Override public Metric newInstance() { return new MinMetric(columnName); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/PercentileMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/PercentileMetric.java index 0305f9e7065..c4784cd9276 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/PercentileMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/PercentileMetric.java @@ -62,6 +62,7 @@ private void init(String functionName, String columnName, int percentile) { setIdentifier(functionName, "(", columnName, "," + percentile, ")"); } + @Override public Number getValue() { if (longMax == Long.MIN_VALUE) { return doubleMax; @@ -70,12 +71,15 @@ public Number getValue() { } } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public void update(Tuple tuple) {} + @Override public Metric newInstance() { return new MaxMetric(columnName); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java index 1c3618e6118..57ca2b08cac 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/StdMetric.java @@ -74,16 +74,20 @@ private void init(String functionName, String columnName, boolean outputLong) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public void update(Tuple tuple) {} + @Override public Metric newInstance() { return new MeanMetric(columnName, outputLong); } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public Number getValue() { return null; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/SumMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/SumMetric.java index 345a5e75904..61d533a0dfd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/SumMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/SumMetric.java @@ -60,10 +60,12 @@ private void init(String functionName, String columnName) { setIdentifier(functionName, "(", columnName, ")"); } + @Override public String[] getColumns() { return new String[] {columnName}; } + @Override public void update(Tuple tuple) { Object o = tuple.get(columnName); if (o instanceof Double) { @@ -81,10 +83,12 @@ public void update(Tuple tuple) { } } + @Override public Metric newInstance() { return new SumMetric(columnName); } + @Override public Number getValue() { if (longSum == 0) { return doubleSum; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/WeightedSumMetric.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/WeightedSumMetric.java index e9fbabcd12d..62a5625f7f2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/WeightedSumMetric.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/metrics/WeightedSumMetric.java @@ -76,6 +76,7 @@ private void init(String valueCol, String countCol, boolean outputLong) { setIdentifier(FUNC, "(", valueCol, ", " + countCol + ", " + outputLong + ")"); } + @Override public void update(Tuple tuple) { Object c = tuple.get(countCol); Object o = tuple.get(valueCol); @@ -89,14 +90,17 @@ public void update(Tuple tuple) { } } + @Override public Metric newInstance() { return new WeightedSumMetric(valueCol, countCol, outputLong); } + @Override public String[] getColumns() { return new String[] {valueCol, countCol}; } + @Override public Number getValue() { long total = sumCounts(); double wavg = 0d; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java index e24ba660f62..3cc4700cfa8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java @@ -1410,6 +1410,7 @@ public CreateSnapshot(String collection, String commitName) { this.commitName = checkNotNull(CoreAdminParams.COMMIT_NAME, commitName); } + @Override public String getCollectionName() { return collection; } @@ -1436,6 +1437,7 @@ public DeleteSnapshot(String collection, String commitName) { this.commitName = checkNotNull(CoreAdminParams.COMMIT_NAME, commitName); } + @Override public String getCollectionName() { return collection; } @@ -1459,6 +1461,7 @@ public ListSnapshots(String collection) { super(CollectionAction.LISTSNAPSHOTS, checkNotNull(CoreAdminParams.COLLECTION, collection)); } + @Override public String getCollectionName() { return collection; } @@ -3289,6 +3292,7 @@ public BalanceShardUnique setShardUnique(Boolean shardUnique) { return this; } + @Override public String getCollection() { return collection; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java index ea2ff9a634d..987f514f05e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java @@ -150,6 +150,7 @@ public String getConfigSet() { return configSet; } + @Override public String getCollection() { return collection; } @@ -344,6 +345,7 @@ public SolrParams getParams() { return params; } + @Override public String toString() { if (action != null) { return "WaitForState: " + getParams(); @@ -402,6 +404,7 @@ public void setShard(String shard) { this.shard = shard; } + @Override public String getCollection() { return collection; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequest.java index e947d959dd0..39c5c931fa3 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/DirectJsonQueryRequest.java @@ -47,6 +47,7 @@ public DirectJsonQueryRequest(String jsonString, SolrParams params) { this.jsonString = jsonString; } + @Override public RequestWriter.ContentWriter getContentWriter(String expectedType) { return new RequestWriter.StringPayloadContentWriter(jsonString, ClientUtils.TEXT_JSON); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/JsonQueryRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/JsonQueryRequest.java index 8ec3e4bb2bf..421edc72bc8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/JsonQueryRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/JsonQueryRequest.java @@ -422,6 +422,7 @@ public JsonQueryRequest withParam(String name, Object value) { return this; } + @Override public RequestWriter.ContentWriter getContentWriter(String expectedType) { return new RequestWriter.ContentWriter() { @Override diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/RangeFacetMap.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/RangeFacetMap.java index 9e3a7d261dd..b6917559f58 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/RangeFacetMap.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/RangeFacetMap.java @@ -119,6 +119,7 @@ public enum OtherBuckets { this.value = value; } + @Override public String toString() { return value; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/TermsFacetMap.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/TermsFacetMap.java index 390ad1f5755..ef1b66e5971 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/TermsFacetMap.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/json/TermsFacetMap.java @@ -228,6 +228,7 @@ public enum FacetMethod { this.value = value; } + @Override public String toString() { return value; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrResponseBase.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrResponseBase.java index 0e4de496ced..85818b78a98 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrResponseBase.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrResponseBase.java @@ -39,6 +39,7 @@ public long getElapsedTime() { return elapsedTime; } + @Override public void setElapsedTime(long elapsedTime) { this.elapsedTime = elapsedTime; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/NoOpReplicaListTransformer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/NoOpReplicaListTransformer.java index 8b968e12a5f..6e94b2cac92 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/NoOpReplicaListTransformer.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/NoOpReplicaListTransformer.java @@ -24,5 +24,6 @@ public final class NoOpReplicaListTransformer implements ReplicaListTransformer private NoOpReplicaListTransformer() {} + @Override public void transform(List choices) {} } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/ShufflingReplicaListTransformer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/ShufflingReplicaListTransformer.java index e5fab81721e..3fa3c6da5c4 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/ShufflingReplicaListTransformer.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/ShufflingReplicaListTransformer.java @@ -28,6 +28,7 @@ public ShufflingReplicaListTransformer(Random r) { this.r = r; } + @Override public void transform(List choices) { if (choices.size() > 1) { Collections.shuffle(choices, r); diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java index b5488afc4bd..b57bef187f9 100644 --- a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java +++ b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java @@ -89,6 +89,7 @@ public boolean removeFields(String name) { * Set a field with the given object. If the object is an Array, it will set multiple fields with * the included contents. This will replace any existing field with the given name */ + @Override public void setField(String name, Object value) { if (value instanceof Object[]) { value = new ArrayList<>(Arrays.asList((Object[]) value)); diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java b/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java index db99bc0e75f..0b2886c0470 100644 --- a/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java +++ b/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java @@ -95,6 +95,7 @@ public void clear() { * @param value Value of the field, should be of same class type as defined by "type" attribute of * the corresponding field in schema.xml. */ + @Override public void addField(String name, Object value) { SolrInputField field = _fields.get(name); if (field == null || field.value == null) { @@ -149,6 +150,7 @@ public Collection getFieldNames() { * @param name name of the field to set * @param value value of the field */ + @Override public void setField(String name, Object value) { SolrInputField field = new SolrInputField(name); _fields.put(name, field); @@ -271,6 +273,7 @@ public void addChildDocument(SolrInputDocument child) { _childDocuments.add(child); } + @Override public void addChildDocuments(Collection children) { for (SolrInputDocument child : children) { addChildDocument(child); @@ -305,10 +308,12 @@ public void visitSelfAndNestedDocs(BiConsumer consume } /** Returns the list of child documents, or null if none. */ + @Override public List getChildDocuments() { return _childDocuments; } + @Override public boolean hasChildDocuments() { boolean isEmpty = (_childDocuments == null || _childDocuments.isEmpty()); return !isEmpty; diff --git a/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java b/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java index fa8ec2e8807..a99605f12f3 100644 --- a/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java +++ b/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java @@ -177,10 +177,12 @@ public SimpleOrderedMap getSimpleMap() { return entry; } + @Override public String toString() { return getMetadataKey() + "=>" + getMetadataValue(); } + @Override public int hashCode() { int h = this.getClass().hashCode(); h = h * 31 + type.hashCode(); @@ -189,6 +191,7 @@ public int hashCode() { return h; } + @Override public boolean equals(Object o) { if (o instanceof ToleratedUpdateError) { ToleratedUpdateError that = (ToleratedUpdateError) o; diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java index 77487753df5..e3ec561cd80 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java @@ -109,6 +109,7 @@ public int max() { return max; } + @Override public boolean includes(int hash) { return hash >= min && hash <= max; } diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java b/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java index 308d37faeca..adbf57ecc32 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java @@ -362,6 +362,7 @@ public PerReplicaStates.State getReplicaState() { return replicaState; } + @Override public Object clone() { return new Replica(name, node, collection, shard, core, state, type, propMap); } diff --git a/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java b/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java index e6cd3fbd6cc..6eafa7086c9 100644 --- a/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java +++ b/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java @@ -66,6 +66,7 @@ public String getDisplay() { return display; } + @Override public String toString() { return abbreviation + " - " + display; } diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java index 697b3d56998..abe9c9d8619 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java @@ -496,6 +496,7 @@ public BiConsumer getBiConsumer() { public final BinEntryWriter ew = new BinEntryWriter(); + @Override public void writeMap(MapWriter val) throws IOException { writeTag(MAP_ENTRY_ITER); val.writeMap(ew); diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java b/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java index 12fe925ea1c..f506cb56b81 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java @@ -67,10 +67,12 @@ default void writeArrayCloser() throws IOException { _writeChar(']'); } + @Override default void writeStrRaw(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeStr(String name, String val, boolean needsEscaping) throws IOException { // it might be more efficient to use a stringbuilder or write substrings // if writing chars to the stream is slow. @@ -140,6 +142,7 @@ default void writeStr(String name, String val, boolean needsEscaping) throws IOE } } + @Override default void writeIterator(IteratorWriter val) throws IOException { writeArrayOpener(-1); incLevel(); @@ -162,6 +165,7 @@ public IteratorWriter.ItemWriter add(Object o) throws IOException { writeArrayCloser(); } + @Override default void writeMap(MapWriter val) throws IOException { writeMapOpener(-1); incLevel(); @@ -209,34 +213,42 @@ default void writeJsonIter(Iterator val, boolean raw) throws IOException { // // Primitive types // + @Override default void writeNull(String name) throws IOException { _writeStr("null"); } + @Override default void writeInt(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeLong(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeBool(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeFloat(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeDouble(String name, String val) throws IOException { _writeStr(val); } + @Override default void writeDate(String name, String val) throws IOException { writeStr(name, val, false); } + @Override default void writeMap(String name, Map val, boolean excludeOuter, boolean isFirstVal) throws IOException { if (!excludeOuter) { @@ -269,12 +281,14 @@ default void writeMap(String name, Map val, boolean excludeOuter, boolean } } + @Override default void writeArray(String name, List l, boolean raw) throws IOException { writeArrayOpener(l.size()); writeJsonIter(l.iterator(), raw); writeArrayCloser(); } + @Override default void writeArray(String name, Iterator val, boolean raw) throws IOException { writeArrayOpener(-1); // no trivial way to determine array size writeJsonIter(val, raw); @@ -290,6 +304,7 @@ default void unicodeEscape(Appendable out, int ch) throws IOException { out.append(hexdigits[(ch) & 0xf]); } + @Override default void writeNamedList(String name, NamedList val) throws IOException { String namedListStyle = getNamedListStyle(); if (val instanceof SimpleOrderedMap) { diff --git a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java index c7368e5329a..86bc81a1318 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java @@ -156,6 +156,7 @@ private List nameValueMapToList(Map.Entry[] nameVal } /** The total number of name/value pairs */ + @Override public int size() { return nvPairs.size() >> 1; } @@ -247,6 +248,7 @@ public int indexOf(String name, int start) { * @see #indexOf * @see #get(String,int) */ + @Override public T get(String name) { return get(name, 0); } @@ -407,6 +409,7 @@ public boolean isEmpty() { return size() == 0; } + @Override public boolean containsKey(Object key) { return NamedList.this.get((String) key) != null; } diff --git a/solr/solrj/src/java/org/apache/solr/common/util/SolrJSONWriter.java b/solr/solrj/src/java/org/apache/solr/common/util/SolrJSONWriter.java index 54e6c592f29..09fac41b6b1 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/SolrJSONWriter.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/SolrJSONWriter.java @@ -54,6 +54,7 @@ public SolrJSONWriter writeObj(Object o) throws IOException { } /** done with all writing */ + @Override public void close() throws IOException { if (writer != null) writer.flushBuffer(); } @@ -77,6 +78,7 @@ public void setLevel(int level) { this.level = level; } + @Override public int level() { return level; } diff --git a/solr/solrj/src/java/org/apache/solr/common/util/TimeSource.java b/solr/solrj/src/java/org/apache/solr/common/util/TimeSource.java index 9f334eca6f3..6365882c250 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/TimeSource.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/TimeSource.java @@ -256,6 +256,7 @@ public static TimeSource get(String type) { */ public abstract long convertDelay(TimeUnit fromUnit, long value, TimeUnit toUnit); + @Override public String toString() { return getClass().getSimpleName(); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index 02664119495..e6df8d74a36 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -925,6 +925,7 @@ public void close() throws IOException { assertEquals(10, rsp.getResults().getNumFound()); } + @Override @Test public void testStreamingRequest() throws Exception { SolrClient client = getSolrClient(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateHttp2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateHttp2SolrClientTest.java index 8b9b4c367d9..90e63dc57d8 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateHttp2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateHttp2SolrClientTest.java @@ -259,6 +259,7 @@ public Builder( this.errors = errors; } + @Override public OutcomeCountingConcurrentUpdateSolrClient build() { return new OutcomeCountingConcurrentUpdateSolrClient(this); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java index 4ab3cb51eaa..23354a6b870 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java @@ -365,6 +365,7 @@ public Builder( this.errors = errors; } + @Override public OutcomeCountingConcurrentUpdateSolrClient build() { return new OutcomeCountingConcurrentUpdateSolrClient(this); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/RecordCountStream.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/RecordCountStream.java index 35137e0ca99..db401a8f69b 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/RecordCountStream.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/RecordCountStream.java @@ -98,24 +98,29 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { .withExpression(toExpression(factory, false).toString()); } + @Override public void close() throws IOException { this.stream.close(); } + @Override public void open() throws IOException { this.stream.open(); } + @Override public List children() { List l = new ArrayList<>(); l.add(stream); return l; } + @Override public void setStreamContext(StreamContext streamContext) { stream.setStreamContext(streamContext); } + @Override public Tuple read() throws IOException { Tuple t = stream.read(); if (t.EOF) { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java index 6d257edcd18..aa3e86bb8d7 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java @@ -46,6 +46,7 @@ public ToyMatchingReplicaListTransformer(String regex) { this.regex = regex; } + @Override public void transform(List choices) { log.info("regex transform input: {}", choices); Iterator it = choices.iterator(); diff --git a/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java b/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java index 4fc462021d3..af5d6012da1 100644 --- a/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java +++ b/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java @@ -172,6 +172,7 @@ private abstract static class Coppier { private static final Coppier MAP_COPPIER = new Coppier() { + @Override public ToleratedUpdateError copy(ToleratedUpdateError in) { return ToleratedUpdateError.parseMap(in.getSimpleMap()); } @@ -179,6 +180,7 @@ public ToleratedUpdateError copy(ToleratedUpdateError in) { private static final Coppier METADATA_COPPIER = new Coppier() { + @Override public ToleratedUpdateError copy(ToleratedUpdateError in) { return ToleratedUpdateError.parseMetadataIfToleratedUpdateError( in.getMetadataKey(), in.getMetadataValue()); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java index ee3e50d1fb1..e60e3ab11e9 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java @@ -133,6 +133,7 @@ public void newSearcher(String collectionName) { } } + @Override public void waitForSearcher( String collection, int cnt, int timeoutms, boolean failOnTimeout) throws InterruptedException { @@ -1182,6 +1183,7 @@ protected CollectionAdminResponse createCollection( return res; } + @Override protected ZkCoreNodeProps getLeaderUrlFromZk(String collection, String slice) { ClusterState clusterState = getCommonCloudSolrClient().getClusterState(); ZkNodeProps leader = clusterState.getCollection(collection).getLeader(slice); @@ -1709,6 +1711,7 @@ private void createNewCollection(final String collection) throws InterruptedExce } } + @Override protected SolrClient createNewSolrClient(String collection, String baseUrl) { try { // setup the server... diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java index 8f3b5540887..b50a9f7854a 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java @@ -72,10 +72,12 @@ protected void destroyServers() throws Exception { private final boolean runFullThrottle; + @Override public String[] getFieldNames() { return fieldNames; } + @Override public RandVal[] getRandValues() { return randVals; } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeySafeLeaderTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeySafeLeaderTestBase.java index a5edbcb7fe2..981c5c717f0 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeySafeLeaderTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeySafeLeaderTestBase.java @@ -53,10 +53,12 @@ public static void afterSuperClass() { protected static final String[] fieldNames = new String[] {"f_i", "f_f", "f_d", "f_l", "f_dt"}; protected static final RandVal[] randVals = new RandVal[] {rint, rfloat, rdouble, rlong, rdate}; + @Override public String[] getFieldNames() { return fieldNames; } + @Override public RandVal[] getRandValues() { return randVals; } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java index 35166e5b432..9d2cac1d11d 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java @@ -765,6 +765,7 @@ public JettySolrRunner createJetty( return jetty; } + @Override public final JettySolrRunner createJetty( File solrHome, String dataDir, diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractRestartWhileUpdatingTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractRestartWhileUpdatingTestBase.java index 132f70e02ae..38733b30fbe 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractRestartWhileUpdatingTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractRestartWhileUpdatingTestBase.java @@ -45,10 +45,12 @@ public AbstractRestartWhileUpdatingTestBase() throws Exception { public static String[] fieldNames = new String[] {"f_i", "f_f", "f_d", "f_l", "f_dt"}; public static RandVal[] randVals = new RandVal[] {rint, rfloat, rdouble, rlong, rdate}; + @Override protected String[] getFieldNames() { return fieldNames; } + @Override protected RandVal[] getRandValues() { return randVals; } @@ -86,6 +88,7 @@ public void test() throws Exception { Thread expireThread = new Thread("expireThread") { + @Override public void run() { while (!stopExpire) { try { diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractUnloadDistributedZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractUnloadDistributedZkTestBase.java index b5f824cb9a7..169a41776cc 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractUnloadDistributedZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractUnloadDistributedZkTestBase.java @@ -62,6 +62,7 @@ public AbstractUnloadDistributedZkTestBase() { fixShardCount(4); // needs at least 4 servers } + @Override protected String getSolrXml() { return "solr.xml"; } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java b/solr/test-framework/src/java/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java index 64b62d60ed8..f9d4c3129e5 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java @@ -175,6 +175,7 @@ public Builder(String baseSolrUrl) { super(baseSolrUrl); } + @Override public ErrorLoggingConcurrentUpdateSolrClient build() { return new ErrorLoggingConcurrentUpdateSolrClient(this); } diff --git a/solr/test-framework/src/java/org/apache/solr/util/ErrorLogMuter.java b/solr/test-framework/src/java/org/apache/solr/util/ErrorLogMuter.java index e9ab1b011f2..fdd2b78b29f 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/ErrorLogMuter.java +++ b/solr/test-framework/src/java/org/apache/solr/util/ErrorLogMuter.java @@ -140,6 +140,7 @@ public int getCount() { return rootFilter.getCount(); } + @Override public void close() { if (!closed.getAndSet(true)) { // Don't muck with log4j if we accidently get a double close CTX.getConfiguration().getRootLogger().removeFilter(rootFilter); @@ -186,6 +187,7 @@ public StringPredicateErrorOrThrowableFilter(final Predicate predicate) this.predicate = predicate; } + @Override public int getCount() { return count.get(); } @@ -221,24 +223,29 @@ private Filter.Result matchAndCount() { return getOnMatch(); } + @Override public Result filter(Logger logger, Level level, Marker marker, String msg, Object... params) { return doFilter(level, msg, null); } + @Override public Result filter(Logger logger, Level level, Marker marker, String msg, Object p0) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, Marker marker, String msg, Object p0, Object p1) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, Marker marker, String msg, Object p0, Object p1, Object p2) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -251,6 +258,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -264,6 +272,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -278,6 +287,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -293,6 +303,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -309,6 +320,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -326,6 +338,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -344,14 +357,17 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t) { return doFilter(level, null == msg ? null : msg.toString(), t); } + @Override public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) { return doFilter(level, msg.getFormattedMessage(), t); } + @Override public Result filter(LogEvent event) { // NOTE: For our usage, we're not worried about needing to filter LogEvents rom remote JVMs // with ThrowableProxy diff --git a/solr/test-framework/src/java/org/apache/solr/util/LogListener.java b/solr/test-framework/src/java/org/apache/solr/util/LogListener.java index d0c2a43fcaf..b5dea24b51b 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/LogListener.java +++ b/solr/test-framework/src/java/org/apache/solr/util/LogListener.java @@ -224,6 +224,7 @@ private LogListener(final String name, final String loggerName, final Level leve CTX.updateLoggers(); } + @Override public void close() { if (!closed.getAndSet(true)) { // Don't muck with log4j if we accidently get a double close final LoggerConfig loggerConfig = CTX.getConfiguration().getLoggerConfig(loggerName); @@ -411,24 +412,29 @@ private Filter.Result doFilter(final Level level, final String msg, final Throwa return getOnMismatch(); } + @Override public Result filter(Logger logger, Level level, Marker marker, String msg, Object... params) { return doFilter(level, msg, null); } + @Override public Result filter(Logger logger, Level level, Marker marker, String msg, Object p0) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, Marker marker, String msg, Object p0, Object p1) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, Marker marker, String msg, Object p0, Object p1, Object p2) { return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -441,6 +447,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -454,6 +461,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -468,6 +476,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -483,6 +492,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -499,6 +509,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -516,6 +527,7 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter( Logger logger, Level level, @@ -534,14 +546,17 @@ public Result filter( return doFilter(level, msg, null); } + @Override public Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t) { return doFilter(level, null == msg ? null : msg.toString(), t); } + @Override public Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t) { return doFilter(level, msg.getFormattedMessage(), t); } + @Override public Result filter(LogEvent event) { // NOTE: For our usage, we're not worried about needing to filter LogEvents rom remote JVMs // with ThrowableProxy diff --git a/solr/test-framework/src/java/org/apache/solr/util/MockCoreContainer.java b/solr/test-framework/src/java/org/apache/solr/util/MockCoreContainer.java index 0d97fd7af29..000905208ee 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/MockCoreContainer.java +++ b/solr/test-framework/src/java/org/apache/solr/util/MockCoreContainer.java @@ -33,6 +33,7 @@ public MockCoreContainer() { super(new Object()); } + @Override public Path getCoreRootDirectory() { return Paths.get("coreroot"); } diff --git a/solr/test-framework/src/java/org/apache/solr/util/SSLTestConfig.java b/solr/test-framework/src/java/org/apache/solr/util/SSLTestConfig.java index b07dc96359d..2f47fbcefe3 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/SSLTestConfig.java +++ b/solr/test-framework/src/java/org/apache/solr/util/SSLTestConfig.java @@ -335,14 +335,17 @@ private static final byte[] fillData(byte[] data) { private static final SecureRandomSpi NOT_SECURE_SPI = new SecureRandomSpi() { /** returns a new byte[] filled with static data */ + @Override public byte[] engineGenerateSeed(int numBytes) { return fillData(new byte[numBytes]); } /** fills the byte[] with static data */ + @Override public void engineNextBytes(byte[] bytes) { fillData(bytes); } /** NOOP */ + @Override public void engineSetSeed(byte[] seed) { /* NOOP */ } @@ -353,30 +356,37 @@ private NotSecurePseudoRandom() { } /** returns a new byte[] filled with static data */ + @Override public byte[] generateSeed(int numBytes) { return fillData(new byte[numBytes]); } /** fills the byte[] with static data */ + @Override public void nextBytes(byte[] bytes) { fillData(bytes); } + @Override public void nextBytes(byte[] bytes, SecureRandomParameters params) { fillData(bytes); } /** NOOP */ + @Override public void setSeed(byte[] seed) { /* NOOP */ } /** NOOP */ + @Override public void setSeed(long seed) { /* NOOP */ } + @Override public void reseed() { /* NOOP */ } + @Override public void reseed(SecureRandomParameters params) { /* NOOP */ } diff --git a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java index b0afecac2da..b4828bad1ca 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java +++ b/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java @@ -278,6 +278,7 @@ public SolrCore getCoreInc() { return container.getCore(coreName); } + @Override public void reload() throws Exception { container.reload(coreName); } @@ -288,6 +289,7 @@ public void reload() throws Exception { * @param xml The XML of the update * @return The XML response to the update */ + @Override public String update(String xml) { try (var mdcSnap = MDCSnapshot.create(); SolrCore core = getCoreInc()) {