Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql Dataspace API #2392

Merged
merged 6 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-language-pure-dsl-generation</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-data-space-pure-metamodel</artifactId>
</dependency>
<!-- ENGINE -->

<dependency>
Expand Down Expand Up @@ -289,6 +293,16 @@
<artifactId>legend-engine-xt-relationalStore-protocol</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-data-space-grammar</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-data-space-compiler</artifactId>
<scope>test</scope>
</dependency>
<!-- TEST -->
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

public interface GraphQLCacheKey
{
String getQueryClassPath();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.finos.legend.engine.query.graphQL.api.cache;

import com.google.common.base.Objects;
import java.util.Objects;

public class GraphQLDevCacheKey implements GraphQLCacheKey
{
Expand Down Expand Up @@ -47,12 +47,37 @@ public boolean equals(Object o)
return false;
}
GraphQLDevCacheKey that = (GraphQLDevCacheKey) o;
return Objects.equal(projectId, that.projectId) && Objects.equal(workspaceId, that.workspaceId) && Objects.equal(queryClassPath, that.queryClassPath) && Objects.equal(mappingPath, that.mappingPath) && Objects.equal(runtimePath, that.runtimePath) && Objects.equal(query, that.query);
return Objects.equals(projectId, that.projectId)
&& Objects.equals(workspaceId, that.workspaceId)
&& Objects.equals(queryClassPath, that.queryClassPath)
&& Objects.equals(mappingPath, that.mappingPath)
&& Objects.equals(runtimePath, that.runtimePath)
&& Objects.equals(query, that.query);
}

@Override
public int hashCode()
{
return Objects.hashCode(projectId, workspaceId, queryClassPath, mappingPath, runtimePath, query);
return Objects.hash(projectId, workspaceId, queryClassPath, mappingPath, runtimePath, query);
}

public String getQueryClassPath()
{
return queryClassPath;
}

public String getMappingPath()
{
return mappingPath;
}

public String getRuntimePath()
{
return runtimePath;
}

public String getQuery()
{
return query;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@

package org.finos.legend.engine.query.graphQL.api.cache;

import com.google.common.base.Objects;
import java.util.Objects;

public class GraphQLProdCacheKey implements GraphQLCacheKey
public abstract class GraphQLProdCacheKey implements GraphQLCacheKey
{
private String groupID;
private String artifactId;
private String versionId;
private String mappingPath;
private String runtimePath;
private String queryClassPath;
private String query;

public GraphQLProdCacheKey(String groupID, String artifactId, String versionId, String mappingPath, String runtimePath, String queryClassPath, String query)
protected String groupID;
protected String artifactId;
protected String versionId;
protected String queryClassPath;
protected String query;

public GraphQLProdCacheKey(String groupID, String artifactId, String versionId, String queryClassPath, String query)
{
this.groupID = groupID;
this.artifactId = artifactId;
this.versionId = versionId;
this.mappingPath = mappingPath;
this.runtimePath = runtimePath;
this.queryClassPath = queryClassPath;
this.query = query;
}
Expand All @@ -49,12 +45,35 @@ public boolean equals(Object o)
return false;
}
GraphQLProdCacheKey that = (GraphQLProdCacheKey) o;
return Objects.equal(groupID, that.groupID) && Objects.equal(artifactId, that.artifactId) && Objects.equal(versionId, that.versionId) && Objects.equal(mappingPath, that.mappingPath) && Objects.equal(runtimePath, that.runtimePath) && Objects.equal(queryClassPath, that.queryClassPath) && Objects.equal(query, that.query);
return Objects.equals(groupID, that.groupID)
&& Objects.equals(artifactId, that.artifactId)
&& Objects.equals(versionId, that.versionId)
&& Objects.equals(queryClassPath, that.queryClassPath)
&& Objects.equals(query, that.query);
}

@Override
public int hashCode()
public String getGroupID()
{
return groupID;
}

public String getArtifactId()
{
return artifactId;
}

public String getVersionId()
{
return versionId;
}

public String getQueryClassPath()
{
return queryClassPath;
}

public String getQuery()
{
return Objects.hashCode(groupID, artifactId, versionId, mappingPath, runtimePath, queryClassPath, query);
return query;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2023 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.query.graphQL.api.cache;

import java.util.Objects;

public class GraphQLProdDataspaceCacheKey extends GraphQLProdCacheKey
{
private String dataspacePath;
private String executionContext;

public GraphQLProdDataspaceCacheKey(String groupID, String artifactId, String versionId, String dataspacePath, String executionContext, String queryClassPath, String query)
{
super(groupID, artifactId, versionId, queryClassPath, query);
this.dataspacePath = dataspacePath;
this.executionContext = executionContext;
}

@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
GraphQLProdDataspaceCacheKey that = (GraphQLProdDataspaceCacheKey) o;
return super.equals(that)
&& Objects.equals(dataspacePath, that.dataspacePath)
&& Objects.equals(executionContext, that.executionContext);
}

@Override
public int hashCode()
{
return Objects.hash(groupID, artifactId, versionId, dataspacePath, executionContext, queryClassPath, query);
}

public String getDataspacePath()
{
return dataspacePath;
}

public String getExecutionContext()
{
return executionContext;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2023 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.query.graphQL.api.cache;

import java.util.Objects;

public class GraphQLProdMappingRuntimeCacheKey extends GraphQLProdCacheKey
{
private String mappingPath;
private String runtimePath;

public GraphQLProdMappingRuntimeCacheKey(String groupID, String artifactId, String versionId, String mappingPath, String runtimePath, String queryClassPath, String query)
{
super(groupID, artifactId, versionId, queryClassPath, query);
this.mappingPath = mappingPath;
this.runtimePath = runtimePath;
}

@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
GraphQLProdMappingRuntimeCacheKey that = (GraphQLProdMappingRuntimeCacheKey) o;
return super.equals(that)
&& Objects.equals(mappingPath, that.mappingPath)
&& Objects.equals(runtimePath, that.runtimePath);
}

@Override
public int hashCode()
{
return Objects.hash(groupID, artifactId, versionId, mappingPath, runtimePath, queryClassPath, query);
}

public String getMappingPath()
{
return mappingPath;
}

public String getRuntimePath()
{
return runtimePath;
}
}
Loading
Loading