Skip to content

Commit

Permalink
Improve PCT (#2960)
Browse files Browse the repository at this point in the history
* Up To Latest Pure With Essential Functions

* Add Relation Functions

* Move functions module to Engine

* Organize Function modules

* Start moving aggregator functions

* Fix Variance and StdDev

* Fix Report

* Rebase

* Fix POM

* Fix POM

* Clean POMs

* delete empty file

* Rebase fixes

* Fix post rebase

* Fix print getAll type

* Improve PCT report

* rebase

* Set Pure Prod Version

* Ensure TZ is GMT for PCT
  • Loading branch information
pierredebelen authored Jul 15, 2024
1 parent 679eede commit 02966e7
Show file tree
Hide file tree
Showing 855 changed files with 33,670 additions and 3,572 deletions.
1 change: 1 addition & 0 deletions h2Console1.4.200.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -jar ~/.m2/repository/com/h2database/h2/1.4.200/h2-1.4.200.jar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"pattern": "(meta::pure::extension::configuration)(::.*)?",
"dependencies": [
"platform",
"platform_functions",
"core_functions_unclassified",
"core",
"core_service",
"core_external_language_java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ protected Iterable<String> getExpectedCodeRepositories()
.with("core")
.with("core_generation")
.with("core_service")
.with("core_functions")
.with("core_functions_unclassified")
.with("core_analytics_binding")
.with("core_analytics_class")
.with("core_analytics_function")
Expand All @@ -540,6 +540,9 @@ protected Iterable<String> getExpectedCodeRepositories()
.with("core_external_query_graphql_metamodel")
.with("core_external_query_sql_metamodel")
.with("core_function_activator")
.with("core_functions_standard")
.with("core_functions_relation")
.with("core_functions_json")
.with("core_external_compiler")
.with("core_persistence")
.with("core_external_language_daml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-extensions</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-structures</artifactId>
</dependency>
<!-- TODO -> Itemize... Only using ErrorManagement import org.finos.legend.engine.shared.core.operational.errorManagement.EngineException; -->
<dependency>
<groupId>org.finos.legend.engine</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.finos.legend.engine.repl.core.Command;
import org.finos.legend.engine.shared.core.extension.Extensions;
import org.finos.legend.engine.shared.core.extension.LegendExtension;
import org.finos.legend.engine.shared.core.extension.TreeNode;
import org.finos.legend.shared.stuctures.TreeNode;
import org.jline.reader.Candidate;
import org.jline.reader.LineReader;
import org.jline.reader.ParsedLine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-core</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-structures</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-shared-vault-core</artifactId>
Expand Down Expand Up @@ -1047,8 +1051,8 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.pure</groupId>
<artifactId>legend-pure-runtime-java-extension-compiled-functions-json</artifactId>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-pure-runtime-java-extension-compiled-functions-json</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand All @@ -1069,11 +1073,11 @@
<!-- RUNTIME -->

<!-- PCT -->
<!-- <dependency>-->
<!-- <groupId>org.finos.legend.engine</groupId>-->
<!-- <artifactId>legend-engine-xt-relationalStore-duckdb-PCT</artifactId>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-relationalStore-duckdb-PCT</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-javaPlatformBinding-PCT</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
import org.finos.legend.engine.server.core.bundles.ErrorHandlingBundle;
import org.finos.legend.engine.server.core.exceptionMappers.CatchAllExceptionMapper;
import org.finos.legend.engine.server.core.exceptionMappers.JsonInformationExceptionMapper;
import org.finos.legend.engine.server.core.pct.PCT;
import org.finos.legend.engine.server.core.session.SessionAttributeBundle;
import org.finos.legend.engine.server.core.session.SessionTracker;
import org.finos.legend.engine.server.core.session.StoreExecutableManagerSessionListener;
Expand Down Expand Up @@ -337,6 +338,9 @@ public void run(T serverConfiguration, Environment environment)
environment.jersey().register(new ConcurrentExecutionNodeExecutorPoolInfo(Collections.emptyList()));
environment.jersey().register(new ParallelGraphFetchExecutionExecutorPoolInfo(parallelGraphFetchExecutionExecutorPool));

// PCT
environment.jersey().register(new PCT());

// Protocol
environment.jersey().register(new PureProtocol());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2020 Goldman Sachs
//
// Licensed 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.finos.legend.engine.server.core.pct;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.finos.legend.pure.m3.pct.aggregate.generation.DocumentationGeneration;
import org.finos.legend.pure.m3.pct.aggregate.model.Documentation;
import org.pac4j.core.profile.CommonProfile;
import org.pac4j.core.profile.ProfileManager;
import org.pac4j.jax.rs.annotations.Pac4JProfileManager;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Api(tags = "PCT")
@Path("pct")
public class PCT
{
@GET
@Path("html")
@ApiOperation(value = "PCT report in HTML")
@Produces(MediaType.TEXT_HTML)
public Response htmlPCT(@Pac4JProfileManager @ApiParam(hidden = true) ProfileManager<CommonProfile> pm)
{
return Response.status(200).type(MediaType.TEXT_HTML).entity(PCT_to_SimpleHTML.buildHTML()).build();
}

@GET
@Path("json")
@ApiOperation(value = "PCT report in JSON")
@Produces(MediaType.APPLICATION_JSON)
public Response jsonPCT(@Pac4JProfileManager @ApiParam(hidden = true) ProfileManager<CommonProfile> pm)
{
try
{
Documentation doc = DocumentationGeneration.buildDocumentation();
return Response.status(200).type(MediaType.APPLICATION_JSON).entity(new ObjectMapper().writeValueAsString(doc)).build();
}
catch (JsonProcessingException e)
{
throw new RuntimeException(e);
}
}
}
Loading

0 comments on commit 02966e7

Please sign in to comment.