capistrant commented on code in PR #17955:
URL: https://github.com/apache/druid/pull/17955#discussion_r2079553908


##########
extensions-core/kafka-indexing-service/src/main/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorSpec.java:
##########
@@ -176,6 +177,35 @@ protected KafkaSupervisorSpec toggleSuspend(boolean 
suspend)
     );
   }
 
+  @Override
+  public void validateProposedSpecEvolution(SupervisorSpec that) throws 
IllegalArgumentException
+  {
+    if (!(that instanceof KafkaSupervisorSpec)) {
+      throw new IllegalArgumentException("Cannot evolve to " + that.getType() 
+ " from " + getType());
+    }
+    KafkaSupervisorSpec other = (KafkaSupervisorSpec) that;
+    if (this.getSource() == null || other.getSource() == null) {
+      // I don't think this is possible, but covering just in case.
+      throw new IllegalArgumentException(
+          "Cannot consider KafkaSupervisorSpec evolution when one or both of 
the specs have not provided either a "
+          + "topic OR topicPattern");
+    }
+
+    // Future enhancements could allow for topicPattern to be changed in a way 
where the new source is additive to the
+    // old source. If we did that now, there would be metadata issues due to 
{@link KafkaDataSourceMetadata}
+    // implementation details that aren't set up to handle evolution of 
metadata in this way.
+    if (!this.getSource().equals(other.getSource())) {

Review Comment:
   I looked into it and it turns out rabbit and kinesis also share the metadata 
management logic that wouldn't support updating streams so I made the update 
for all. I therefore put this in SeekableStreamSupervisorSpec. I still ended up 
having to have an override in Kafka cuz the multi topic single topic 
information created an edge case of moving between single/multi with the same 
exact string for topic/topicPattern. I'm not sure that my kafka override is the 
proper style. I do the edge case logic and then call into super implementation 
for the core logic. I thought that would save duplicate code, but wasn't sure 
if it is necessarily the right way from a java perspective



-- 
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]

Reply via email to