public class org.finos.legend.engine.repl.relational.commands.Cache extends java.lang.Object implements org.finos.legend.engine.repl.core.Command
{
private final org.finos.legend.engine.repl.client.Client client;
public void <init>(org.finos.legend.engine.repl.client.Client)
{
org.finos.legend.engine.repl.relational.commands.Cache v;
org.finos.legend.engine.repl.client.Client v;
v := @this: org.finos.legend.engine.repl.relational.commands.Cache;
v := @parameter: org.finos.legend.engine.repl.client.Client;
specialinvoke v.<java.lang.Object: void <init>()>();
v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client> = v;
return;
}
public java.lang.String documentation()
{
org.finos.legend.engine.repl.relational.commands.Cache v;
v := @this: org.finos.legend.engine.repl.relational.commands.Cache;
return "cache <connection> (<table name>)";
}
public java.lang.String description()
{
org.finos.legend.engine.repl.relational.commands.Cache v;
v := @this: org.finos.legend.engine.repl.relational.commands.Cache;
return "run the query and cache the result";
}
public boolean process(java.lang.String) throws java.lang.Exception
{
org.finos.legend.engine.repl.relational.commands.Cache v;
java.lang.String[] v;
org.finos.legend.engine.repl.client.Client v, v, v, v, v, v;
org.finos.legend.engine.repl.client.ModelState v;
org.eclipse.collections.api.block.function.Function v;
org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData v;
int v, v;
java.lang.String v, v, v, v, v, v, v;
boolean v, v;
java.lang.RuntimeException v;
java.lang.Exception v;
org.finos.legend.engine.protocol.pure.v.model.packageableElement.store.relational.connection.DatabaseConnection v;
v := @this: org.finos.legend.engine.repl.relational.commands.Cache;
v := @parameter: java.lang.String;
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("cache");
if v == 0 goto label;
v = virtualinvoke v.<java.lang.String: java.lang.String[] split(java.lang.String)>(" ");
v = lengthof v;
if v >= 2 goto label;
v = new java.lang.RuntimeException;
v = virtualinvoke v.<org.finos.legend.engine.repl.relational.commands.Cache: java.lang.String documentation()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Command should be used as \'\u0001\'");
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.String)>(v);
throw v;
label:
v = v[1];
v = lengthof v;
if v != 3 goto label;
v = v[2];
goto label;
label:
v = null;
label:
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
v = virtualinvoke v.<org.finos.legend.engine.repl.client.Client: java.lang.String getLastCommand(int)>(1);
if v != null goto label;
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
virtualinvoke v.<org.finos.legend.engine.repl.client.Client: void printError(java.lang.String)>("Failed to retrieve the last command");
return 1;
label:
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
v = virtualinvoke v.<org.finos.legend.engine.repl.client.Client: org.finos.legend.engine.repl.client.ModelState getModelState()>();
v = virtualinvoke v.<org.finos.legend.engine.repl.client.ModelState: org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData parse()>();
v = staticinvoke <org.finos.legend.engine.repl.relational.shared.ConnectionHelper: org.finos.legend.engine.protocol.pure.v.model.packageableElement.store.relational.connection.DatabaseConnection getDatabaseConnection(org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData,java.lang.String)>(v, v);
label:
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
v = staticinvoke <org.finos.legend.engine.repl.relational.commands.Cache$lambda_process_d3c77af5_1__29: org.eclipse.collections.api.block.function.Function bootstrap$(org.finos.legend.engine.repl.relational.commands.Cache,org.finos.legend.engine.protocol.pure.v.model.packageableElement.store.relational.connection.DatabaseConnection,java.lang.String)>(v, v, v);
staticinvoke <org.finos.legend.engine.repl.shared.ExecutionHelper: org.finos.legend.engine.repl.shared.ExecutionHelper$ExecuteResultSummary executeCode(java.lang.String,org.finos.legend.engine.repl.client.Client,org.eclipse.collections.api.block.function.Function)>(v, v, v);
label:
goto label;
label:
v := @caughtexception;
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Last command run is not an execution of a Pure expression (command run: \'\u0001\')");
virtualinvoke v.<org.finos.legend.engine.repl.client.Client: void printError(java.lang.String)>(v);
v = v instanceof org.finos.legend.engine.shared.core.operational.errorManagement.EngineException;
if v == 0 goto label;
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
virtualinvoke v.<org.finos.legend.engine.repl.client.Client: void printEngineError(org.finos.legend.engine.shared.core.operational.errorManagement.EngineException,java.lang.String)>(v, v);
goto label;
label:
throw v;
label:
return 1;
label:
return 0;
catch java.lang.Exception from label to label with label;
}
public org.eclipse.collections.api.list.MutableList complete(java.lang.String, org.jline.reader.LineReader, org.jline.reader.ParsedLine)
{
org.eclipse.collections.api.block.function.Function v, v;
org.eclipse.collections.api.block.predicate.Predicate v, v;
org.finos.legend.engine.repl.relational.commands.Cache v;
org.eclipse.collections.api.factory.list.MutableListFactory v;
org.jline.reader.ParsedLine v;
org.finos.legend.engine.repl.client.Client v;
org.eclipse.collections.api.list.MutableList v, v, v, v, v, v;
org.finos.legend.engine.repl.client.ModelState v;
org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData v;
java.lang.String v;
boolean v, v;
org.jline.reader.LineReader v;
java.util.List v, v;
java.lang.Object v;
v := @this: org.finos.legend.engine.repl.relational.commands.Cache;
v := @parameter: java.lang.String;
v := @parameter: org.jline.reader.LineReader;
v := @parameter: org.jline.reader.ParsedLine;
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("cache ");
if v == 0 goto label;
v = <org.eclipse.collections.impl.factory.Lists: org.eclipse.collections.api.factory.list.MutableListFactory mutable>;
v = interfaceinvoke v.<org.jline.reader.ParsedLine: java.util.List words()>();
v = interfaceinvoke v.<org.eclipse.collections.api.factory.list.MutableListFactory: org.eclipse.collections.api.list.MutableList withAll(java.lang.Iterable)>(v);
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList drop(int)>(2);
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: boolean contains(java.lang.Object)>(" ");
if v != 0 goto label;
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: java.lang.Object get(int)>(0);
v = v.<org.finos.legend.engine.repl.relational.commands.Cache: org.finos.legend.engine.repl.client.Client client>;
v = virtualinvoke v.<org.finos.legend.engine.repl.client.Client: org.finos.legend.engine.repl.client.ModelState getModelState()>();
v = virtualinvoke v.<org.finos.legend.engine.repl.client.ModelState: org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData parse()>();
v = virtualinvoke v.<org.finos.legend.engine.protocol.pure.v.model.context.PureModelContextData: java.util.List getElementsOfType(java.lang.Class)>(class "Lorg/finos/legend/engine/protocol/pure/v1/model/packageableElement/connection/PackageableConnection;");
v = staticinvoke <org.finos.legend.engine.repl.relational.commands.Cache$lambda_complete_3ffcec0_1__30: org.eclipse.collections.api.block.predicate.Predicate bootstrap$()>();
v = staticinvoke <org.eclipse.collections.impl.utility.ListIterate: org.eclipse.collections.api.list.MutableList select(java.util.List,org.eclipse.collections.api.block.predicate.Predicate)>(v, v);
v = staticinvoke <org.finos.legend.engine.repl.relational.commands.Cache$lambda_complete_6bf98952_1__31: org.eclipse.collections.api.block.function.Function bootstrap$()>();
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList collect(org.eclipse.collections.api.block.function.Function)>(v);
v = staticinvoke <org.finos.legend.engine.repl.relational.commands.Cache$lambda_complete_5cb8ef20_1__32: org.eclipse.collections.api.block.predicate.Predicate bootstrap$(java.lang.String)>(v);
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList select(org.eclipse.collections.api.block.predicate.Predicate)>(v);
v = staticinvoke <org.finos.legend.engine.repl.relational.commands.Cache$init__33: org.eclipse.collections.api.block.function.Function bootstrap$()>();
v = interfaceinvoke v.<org.eclipse.collections.api.list.MutableList: org.eclipse.collections.api.list.MutableList collect(org.eclipse.collections.api.block.function.Function)>(v);
return v;
label:
return null;
}
}