Skip to content

Commit

Permalink
repl: DX improvement for DataCube client
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed Nov 7, 2024
1 parent cc8ddee commit 8c8f72a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public Client(MutableList<ReplExtension> replExtensions, MutableList<CompleterEx
this.initialize();
replExtensions.forEach(e -> 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")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@

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;
import org.finos.legend.engine.repl.dataCube.DataCubeReplExtension;
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(),
Expand All @@ -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();
}
Expand Down

0 comments on commit 8c8f72a

Please sign in to comment.