jaykay12 commented on code in PR #4744:
URL: https://github.com/apache/solr/pull/4744#discussion_r3833594678
##########
solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/DeleteByQueryToIdTest.java:
##########
@@ -67,8 +66,6 @@ public class DeleteByQueryToIdTest extends SolrCloudTestCase {
private static final Logger log =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- static final String VERSION_FIELD = "_version_";
Review Comment:
all these cleanups, i was also doing in this PR:
https://github.com/apache/solr/pull/4610
##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/common/ConfigProperty.java:
##########
@@ -49,10 +43,6 @@ public boolean isRequired() {
return required;
}
- public String getDefaultValue() {
Review Comment:
[Q] this getter may get used in future?
##########
solr/cross-dc-manager/src/java/org/apache/solr/crossdc/manager/messageprocessor/SolrMessageProcessor.java:
##########
@@ -335,43 +333,6 @@ private void logFirstAttemptLatency(MirroredSolrRequest<?>
mirroredSolrRequest)
}
}
- /**
- * Adds {@link CrossDcConstants#SHOULD_MIRROR}=false to the params if it's
not already specified.
- * Logs a warning if it is specified and NOT set to false. (i.e. circular
mirror may occur)
- *
- * @param mirroredSolrRequest MirroredSolrRequest object that is being
processed.
- */
- void preventCircularMirroring(MirroredSolrRequest<?> mirroredSolrRequest) {
Review Comment:
[Q] is this some deprecated function which earlier was being used?
its unused for now, that's why intelliJ flagged it but is it not useful
anytime in future as well?
##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/common/MirroredSolrRequest.java:
##########
@@ -227,10 +227,6 @@ public long getSubmitTimeNanos() {
return submitTimeNanos;
}
- public void setSubmitTimeNanos(final long submitTimeNanos) {
- this.submitTimeNanos = submitTimeNanos;
- }
-
Review Comment:
this is a setter for a private field. may be useful in future.
##########
solr/modules/cross-dc/src/test/org/apache/solr/crossdc/update/processor/MirroringUpdateProcessorTest.java:
##########
@@ -544,7 +544,7 @@ UpdateRequest createMirrorRequest() {
processor.processDelete(deleteUpdateCommand);
verify(requestMirroringHandler, times(1)).mirror(updateRequest);
assertEquals("missing dbq", 1, updateRequest.getDeleteQuery().size());
- assertEquals("dbq value", "id:test*",
updateRequest.getDeleteQuery().get(0));
+ assertEquals("dbq value", "id:test*",
updateRequest.getDeleteQuery().getFirst());
Review Comment:
there are other IntelliJ suggestions as well for this class, like this one?
<img width="756" height="418" alt="Image"
src="https://github.com/user-attachments/assets/40c2ee9f-2bd0-469d-87e3-cf05f9457a24"
/>
##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/common/MirroredSolrRequest.java:
##########
@@ -264,15 +260,16 @@ public int hashCode() {
public String toString() {
final StringBuilder sb = new StringBuilder(getClass().getSimpleName() +
"{type=");
sb.append(type.toString());
- sb.append(", method=" + solrRequest.getMethod());
- sb.append(", params=" + solrRequest.getParams());
+ sb.append(", method=").append(solrRequest.getMethod());
+ sb.append(", params=").append(solrRequest.getParams());
if (solrRequest instanceof UpdateRequest req) {
- sb.append(", add=" + (req.getDocuments() != null ?
req.getDocuments().size() : "0"));
- sb.append(", del=" + (req.getDeleteByIdMap() != null ?
req.getDeleteByIdMap().size() : "0"));
- sb.append(", dbq=" + (req.getDeleteQuery() != null ?
req.getDeleteQuery().size() : "0"));
+ sb.append(", add=").append(req.getDocuments() != null ?
req.getDocuments().size() : "0");
+ sb.append(", del=")
+ .append(req.getDeleteByIdMap() != null ?
req.getDeleteByIdMap().size() : "0");
+ sb.append(", dbq=").append(req.getDeleteQuery() != null ?
req.getDeleteQuery().size() : "0");
}
- sb.append(", attempt=" + attempt);
- sb.append(", submitTimeNanos=" + submitTimeNanos);
+ sb.append(", attempt=").append(attempt);
+ sb.append(", submitTimeNanos=").append(submitTimeNanos);
Review Comment:
neat. 👍🏽
##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/update/processor/MirroringUpdateRequestProcessorFactory.java:
##########
@@ -223,14 +218,6 @@ public void inform(SolrCore core) {
mirroringHandler = new KafkaRequestMirroringHandler(sink);
}
- private static Integer getIntegerPropValue(String name, Properties props) {
Review Comment:
[Q] this may be useful in future right?
##########
solr/modules/cross-dc/src/java/org/apache/solr/crossdc/update/processor/MirroringException.java:
##########
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.crossdc.update.processor;
-
-/** Wrapper class for Mirroring exceptions. */
-public class MirroringException extends Exception {
Review Comment:
[for-my-knowledge] why would this custom exception be created if this is not
being used in the codebase?
any other usage outside this codebase possible for this, since it lies in
cross-dc-manager module?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]