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

Graph Versioning #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
68 changes: 34 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.atom8</groupId>
<artifactId>pipes</artifactId>
<groupId>com.github.thehellmaker</groupId>
<artifactId>pied-piper</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

Expand All @@ -13,8 +13,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>

<dependencies>
Expand All @@ -27,11 +27,11 @@
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.inject.extensions/guice-assistedinject -->
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<version>4.2.2</version>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<version>4.2.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4 -->
<dependency>
<groupId>org.powermock</groupId>
Expand All @@ -56,13 +56,13 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.535</version>
<version>1.11.845</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.inject/guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.2.2</version>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.2.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
Expand All @@ -79,9 +79,9 @@
</dependency>
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-actor -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>2.6.3</version>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>2.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-testkit -->
<dependency>
Expand All @@ -92,25 +92,25 @@
</dependency>
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-slf4j -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.12</artifactId>
<version>2.6.3</version>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.12</artifactId>
<version>2.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-stream -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>2.6.3</version>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>2.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.typesafe.akka/akka-parsing -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-parsing_2.12</artifactId>
<version>10.1.11</version>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-parsing_2.12</artifactId>
<version>10.1.11</version>
</dependency>



<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -152,15 +152,15 @@
</dependency>
<!-- https://mvnrepository.com/artifact/io.apigee.trireme/trireme-jar -->
<dependency>
<groupId>io.apigee.trireme</groupId>
<artifactId>trireme-jar</artifactId>
<version>0.9.4</version>
<groupId>io.apigee.trireme</groupId>
<artifactId>trireme-jar</artifactId>
<version>0.9.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.firebase/firebase-admin -->
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>6.8.0</version>
</dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>6.8.0</version>
</dependency>
</dependencies>
</project>
9 changes: 0 additions & 9 deletions src/main/java/com/github/piedpiper/common/GraphUtils.java

This file was deleted.

54 changes: 49 additions & 5 deletions src/main/java/com/github/piedpiper/common/PiedPiperConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ public class PiedPiperConstants {

public static final String WARM_UP = "warmUp";

public static final String ALMIGHTY_TABLE_HASH_KEY = "hashKey";
public static final String HASH_KEY_PARAMETER = "hashKey";

public static final String ALMIGHTY_TABLE_RANGE_KEY = "rangeKey";
public static final String RANGE_KEY_PARAMETER = "rangeKey";

public static final String RANGE_KEY_BEGIN_PARAMETER = "rangeKeyBegin";

public static final String RANGE_KEY_END_PARAMETER = "rangeKeyEnd";

public static final String ALMIGHTY_TABLE_NAME = "AlmightyTable";

Expand All @@ -36,15 +40,15 @@ public class PiedPiperConstants {

public static final String SEARCH_GRAPH_LAMBDA_NODE_NAME = "SearchGraphFunction";

public static final String DEFAULT_ACCESS_KEY = "AccessKey";
public static final String ACCESS_KEY = "AccessKey";

public static final String DEFAULT_SECRET_KEY = "SecretKey";
public static final String SECRET_KEY = "SecretKey";

public static final String PROD_EXECUTE_GRAPH_ENDPOINT = "prodExecuteGraphEndpoint";

public static final String PROD_SEARCH_ENDPOINT = "prodSearchEndpoint";

public static final String TABLE_NAME_PARAMETER = "tableName";
public static final String TABLE_NAME = "tableName";

public static final String AWS_SSM_CACHE = "AWS_SSM_CACHE";

Expand Down Expand Up @@ -72,4 +76,44 @@ public class PiedPiperConstants {

public static final String EMPTY_JSON_STRING = "{}";

public static final String GLOBAL_CONFIG = "GLOBAL_CONFIG";

public static final String REGION = "region";

public static final String GRAPH_VERSION_TABLE_NAME = "graphVersionTableName";

public static final String VERSION_DESCRIPTION = "versionDescription";

public static final String VERSION = "version";

public static final String VERSION_STR = "versionStr";

public static final String ALIAS = "alias";

public static final String STAGING_VERSION = "stagingVersion";

public static final String PUBLISHED_VERSION = "publishedVersion";

public static final String VERSION_TYPE = "versionType";

public static final String SORT_TYPE = "sortType";

public static final String PREVIOUS_VERSION_DETAILS = "previousVersionDetails";

public static final String PREVIOUS_VERSION_DETAILS_JSON = "previousVersionDetailsJson";

public static final String BRANCH_NAME = "branchName";

public static final String PREVIOUS_VERSION = "previousVersion";

public static final String PREVIOUS_PROJECT_NAME = "previousProjectName";

public static final String PREVIOUS_GRAPH_NAME = "previousGraphName";

public static final String PREVIOUS_BRANCH_NAME = "previousBranchName";

public static final String GRAPH_JSON = "graphJson";

public static final String FILTER_TYPE = "filterType";

}
5 changes: 5 additions & 0 deletions src/main/java/com/github/piedpiper/graph/AliasType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.github.piedpiper.graph;

public enum AliasType {
PROD, PREPROD, DEV
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.github.piedpiper.graph.storage;

public enum FilterType {
UNIQUE_GRAPH_LIST_FILTER, UNIQUE_GRAPH_BRANCH_LIST_FILTER, NONE
}
21 changes: 21 additions & 0 deletions src/main/java/com/github/piedpiper/graph/storage/GraphId.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.piedpiper.graph.storage;

public class GraphId {

private String projectName;
private String graphName;

public GraphId(String projectName, String graphName) {
this.projectName = projectName;
this.graphName = graphName;
}

public String getGraphName() {
return graphName;
}

public String getProjectName() {
return projectName;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.github.piedpiper.graph.storage;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.github.piedpiper.graph.storage.QueryGraphInput.SortType;
import com.github.piedpiper.graph.storage.dynamo.PutNewAliasInput;

public interface IGraphStorage {

JsonNode postNewVersion(PostNewVersionInput input) throws Exception;

ArrayNode search(QueryGraphInput queryGraphInput) throws Exception;

JsonNode putAlias(PutNewAliasInput input) throws Exception;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.github.piedpiper.graph.storage;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class PostNewVersionInput {

private String projectName;
private String graphName;
private String graphJson;
private String previousProjectName;
private String previousGraphName;
private Long previousVersion;
private String versionDescription;
private String previousBranchName;
private String branchName;

public PostNewVersionInput(String projectName, String graphName, String graphJson, String branchName,
String versionDescription, String previousProjectName, String previousGraphName, String previousBranchName,
Long previousVersion) {
this.projectName = projectName;
this.graphName = graphName;
this.graphJson = graphJson;
this.branchName = branchName;
this.versionDescription = versionDescription;
this.previousProjectName = previousProjectName;
this.previousGraphName = previousGraphName;
this.previousBranchName = previousBranchName;
this.previousVersion = previousVersion;
}

public String getProjectName() {
return projectName;
}

public String getGraphName() {
return graphName;
}

@JsonIgnore
public String getGraphJson() {
return graphJson;
}

public String getPreviousProjectName() {
return previousProjectName;
}

public String getPreviousGraphName() {
return previousGraphName;
}

public Long getPreviousVersion() {
return previousVersion;
}

public String getVersionDescription() {
return versionDescription;
}

public String getPreviousBranchName() {
return previousBranchName;
}

public String getBranchName() {
return branchName;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.github.piedpiper.graph.storage;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;

public final class PutGraphVersionInput {

private String projectName;
private String graphName;

private String graphJson;
private String version;
private String alias;
private Map<String, Object> attributes;
private String branchName;

public PutGraphVersionInput(String projectName, String graphName, String graphJson, String branchName,
String version, Map<String, Object> attributes) {
this.projectName = projectName;
this.graphName = graphName;
this.graphJson = graphJson;
this.branchName = branchName;
this.version = version;
this.attributes = attributes;
}

public String getProjectName() {
return projectName;
}

public String getGraphName() {
return graphName;
}
@JsonIgnore
public String getGraphJson() {
return graphJson;
}

public String getVersion() {
return version;
}

public String getAlias() {
return alias;
}

public Map<String, Object> getAttributes() {
return attributes;
}

public String getBranchName() {
return branchName;
}

}
Loading