gianm commented on a change in pull request #8870: Additional Kinesis 
resharding fixes
URL: https://github.com/apache/incubator-druid/pull/8870#discussion_r348569813
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java
 ##########
 @@ -190,6 +191,25 @@ public boolean resetSupervisor(String id, @Nullable 
DataSourceMetadata dataSourc
     return true;
   }
 
+  public boolean updateClosedShards(String id, Set<String> closedShards)
+  {
+
+    Preconditions.checkState(started, "SupervisorManager not started");
+    Preconditions.checkNotNull(id, "id");
+    Preconditions.checkNotNull(id, "closedShards");
+
+    Pair<Supervisor, SupervisorSpec> supervisor = supervisors.get(id);
+
+    if (supervisor == null) {
+      return false;
+    }
+    if (supervisor.lhs instanceof SeekableStreamSupervisor) {
 
 Review comment:
   Using an `instanceof` here creates weird, magical coupling between 
SupervisorManager and SeekableStreamSupervisor that would be easy for people to 
miss. Is there a reasonable way to code this without an `instanceof`? Maybe 
some change we could make in the future, that you could mention in a comment?
   
   At the very least, add something to the javadoc for this method in 
SeekableStreamSupervisor that says what conditions SupervisorManager will call 
it under.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to