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


##########
server/src/main/java/org/apache/druid/server/coordinator/rules/RetentionRulesSnapshot.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.druid.server.coordinator.rules;
+
+import com.google.common.collect.Maps;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Immutable snapshot of the retention rules of every datasource, taken once 
at the
+ * start of a coordinator run and carried in
+ * {@link org.apache.druid.server.coordinator.DruidCoordinatorRuntimeParams}.
+ * <p>
+ * Duties must read rules from this snapshot rather than from
+ * {@link org.apache.druid.metadata.MetadataRuleManager} directly. That 
manager swaps
+ * its entire rule map as soon as a rule update is submitted, so a duty 
reading it
+ * per segment can apply the old rules to some segments and the new rules to 
others
+ * within a single run. The new rules are then evaluated against values the 
run has
+ * already snapshotted from {@link 
org.apache.druid.server.coordinator.CoordinatorDynamicConfig},

Review Comment:
   now that the snapshot is used for more than just the coordinator duties, I 
ended up deleting all these details about duties loop as it seems off topic



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