Akshat-Jain commented on code in PR #16328:
URL: https://github.com/apache/druid/pull/16328#discussion_r1582043669


##########
server/src/main/java/org/apache/druid/server/lookup/cache/LookupLoadingSpec.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.lookup.cache;
+
+import org.apache.druid.java.util.common.ISE;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * This class defines the spec for loading of lookups for a given task. It 
contains 2 fields:
+ * <ol>
+ *   <li>{@link LookupLoadingSpec#mode}: This mode defines whether lookups 
need to be
+ *   loaded for the given task, or not. It can take 3 values: </li>
+ *   <ul>
+ *    <li> ALL: Load all the lookups.</li>
+ *    <li> NONE: Load no lookups. </li>
+ *    <li> PARTIAL: Load only the lookups defined in lookupsToLoad </li>
+ *   </ul>
+ * <li>{@link LookupLoadingSpec#lookupsToLoad}: Defines the lookups to load 
when the lookupLoadingMode is set to PARTIAL.</li>
+ * </ol>
+ */
+public class LookupLoadingSpec
+{
+  public enum Mode
+  {
+    ALL, NONE, PARTIAL
+  }
+
+  private final Mode mode;
+  private final List<String> lookupsToLoad;
+
+  public static final LookupLoadingSpec ALL = new LookupLoadingSpec(Mode.ALL, 
null);
+  public static final LookupLoadingSpec NONE = new 
LookupLoadingSpec(Mode.NONE, Collections.emptyList());

Review Comment:
   I put it empty list for NONE to have correct behavior in case anyone uses 
`getLookupsToLoad()` method to fetch list of lookups for NONE case. I'm okay 
either way, but thoughts?



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