You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/12/06 18:15:52 UTC

[GitHub] [pinot] klsince commented on a diff in pull request #9705: Allow to configure multi-datadirs as instance configs and a Quickstart example about them

klsince commented on code in PR #9705:
URL: https://github.com/apache/pinot/pull/9705#discussion_r1041305037


##########
pinot-tools/src/main/java/org/apache/pinot/tools/MultiDirQuickstart.java:
##########
@@ -0,0 +1,110 @@
+/**
+ * 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.pinot.tools;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.pinot.tools.admin.PinotAdministrator;
+import org.apache.pinot.tools.admin.command.QuickstartRunner;
+
+
+/**
+ * A Quickstart to demo how multi directory support works and its typical configs.
+ */
+public class MultiDirQuickstart extends Quickstart {
+  @Override
+  public List<String> types() {
+    return Arrays.asList("OFFLINE_MULTIDIR", "OFFLINE-MULTIDIR", "BATCH_MULTIDIR", "BATCH-MULTIDIR");
+  }
+
+  @Override
+  protected Map<String, Object> getConfigOverrides() {
+    Map<String, Object> properties = new HashMap<>(super.getConfigOverrides());
+    properties.put("pinot.server.instance.segment.directory.loader", "tierBased");
+    properties.put("controller.segment.relocator.frequencyPeriod", "60s");
+    properties.put("controller.segmentRelocator.initialDelayInSeconds", "10");
+    properties.put("controller.segmentRelocator.enableLocalTierMigration", "true");
+    /*
+     * One can also set `dataDir` as part of tierConfigs in TableConfig to overwrite the instance configs (or set as
+     * cluster configs), but it's recommended to use instance (or cluster) configs for consistency across tables.
+     * "tierBackendProperties": {
+     *     "dataDir": "/tmp/multidir_test/hotTier"
+     *  }
+     */
+    properties.put("pinot.server.instance.tierConfigs.0.tierName", "hotTier");

Review Comment:
   Yes, those properties here show that configs can be part of instance configs. But they can be set in cluster config as well, as all cluster config is merged into instance config when instance starts.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org