From 8c8f72a83cbf8ec571d14445a5490107f5f83721 Mon Sep 17 00:00:00 2001 From: An Phi Date: Thu, 7 Nov 2024 14:36:10 -0500 Subject: [PATCH] repl: DX improvement for DataCube client --- .../java/org/finos/legend/engine/repl/client/Client.java | 3 ++- .../engine/repl/dataCube/client/DataCubeClient.java | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/client/Client.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/client/Client.java index 53011f092d7..da8b610b79f 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/client/Client.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-client/src/main/java/org/finos/legend/engine/repl/client/Client.java @@ -100,7 +100,8 @@ public Client(MutableList replExtensions, MutableList e.initialize(this)); - this.printDebug("[DEV] Legend REPL v" + DeploymentStateAndVersions.sdlc.buildVersion + " (" + DeploymentStateAndVersions.sdlc.commitIdAbbreviated + ")"); + this.printDebug("[DEV] REPL v" + DeploymentStateAndVersions.sdlc.buildVersion + " (" + DeploymentStateAndVersions.sdlc.commitIdAbbreviated + ")"); + this.printDebug("[DEV] REPL dir: " + this.getHomeDir().toUri()); if (System.getProperty("legend.repl.initializationMessage") != null) { this.printDebug(StringEscapeUtils.unescapeJava(System.getProperty("legend.repl.initializationMessage"))); diff --git a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/client/DataCubeClient.java b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/client/DataCubeClient.java index 8a7e3667d29..574a731755d 100644 --- a/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/client/DataCubeClient.java +++ b/legend-engine-config/legend-engine-repl/legend-engine-repl-data-cube/src/main/java/org/finos/legend/engine/repl/dataCube/client/DataCubeClient.java @@ -14,6 +14,7 @@ package org.finos.legend.engine.repl.dataCube.client; +import org.apache.commons.io.FileUtils; import org.eclipse.collections.impl.factory.Lists; import org.finos.legend.engine.plan.execution.PlanExecutor; import org.finos.legend.engine.repl.client.Client; @@ -21,10 +22,15 @@ import org.finos.legend.engine.repl.relational.RelationalReplExtension; import org.finos.legend.engine.repl.relational.autocomplete.RelationalCompleterExtension; +import java.nio.file.Paths; + public class DataCubeClient { public static void main(String[] args) throws Exception { + // NOTE: this is exclusively used for development of DataCube when we need to boot multiple instances + // of the REPL at the same time and want to avoid locking on the DuckDB instances + String DEV__homeDir = System.getProperty("legend.repl.dataCube.devHomeDir"); Client client = new Client( Lists.mutable.with( new DataCubeReplExtension(), @@ -33,7 +39,8 @@ public static void main(String[] args) throws Exception Lists.mutable.with( new RelationalCompleterExtension() ), - PlanExecutor.newPlanExecutorBuilder().withAvailableStoreExecutors().build() + PlanExecutor.newPlanExecutorBuilder().withAvailableStoreExecutors().build(), + DEV__homeDir != null ? Paths.get(DEV__homeDir) : FileUtils.getUserDirectory().toPath().resolve(".legend/repl") ); client.loop(); }