Skip to content

Commit

Permalink
feat: initial commit with working JG upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sumandas0 committed Feb 5, 2024
1 parent 6ca6c87 commit 7df57e2
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
- beta
- development
- master
- lineageondemand
- janusgraph-upgrade-1.0.0

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions graphdb/janus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>cassandra-hadoop-util</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class AtlasJanusGraphDatabase implements GraphDatabase<AtlasJanusVertex,

public AtlasJanusGraphDatabase() {
//update registry
GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.getInstance()).create();
GraphSONMapper.build().addRegistry(JanusGraphIoRegistry.instance()).create();
}

public static Configuration getConfiguration() throws AtlasException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Map<String, Object> directIndexQuery(String query) throws AtlasBaseExcept

@Override
public Iterator<Result<AtlasJanusVertex, AtlasJanusEdge>> vertices() {
Iterator<JanusGraphIndexQuery.Result<JanusGraphVertex>> results = query.vertices().iterator();
Iterator<JanusGraphIndexQuery.Result<JanusGraphVertex>> results = query.vertexStream().iterator();

Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>> function =
new Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>>() {
Expand All @@ -77,7 +77,7 @@ public Iterator<Result<AtlasJanusVertex, AtlasJanusEdge>> vertices(int offset, i
Iterator<JanusGraphIndexQuery.Result<JanusGraphVertex>> results = query
.offset(offset)
.limit(limit)
.vertices().iterator();
.vertexStream().iterator();

Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>> function =
new Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>>() {
Expand All @@ -100,7 +100,7 @@ public Iterator<Result<AtlasJanusVertex, AtlasJanusEdge>> vertices(int offset, i
.orderBy(sortBy, sortOrder)
.offset(offset)
.limit(limit)
.vertices().iterator();
.vertexStream().iterator();

Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>> function =
new Function<JanusGraphIndexQuery.Result<JanusGraphVertex>, Result<AtlasJanusVertex, AtlasJanusEdge>>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
import org.janusgraph.graphdb.query.condition.Not;
import org.janusgraph.graphdb.query.condition.Or;
import org.janusgraph.graphdb.query.condition.PredicateCondition;
import org.janusgraph.graphdb.tinkerpop.optimize.step.Aggregation;
import org.janusgraph.graphdb.types.ParameterType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -597,6 +598,11 @@ public void restore(Map<String, Map<String, List<IndexEntry>>> documents,
}
}

@Override
public Number queryAggregation(IndexQuery indexQuery, KeyInformation.IndexRetriever indexRetriever, BaseTransaction baseTransaction, Aggregation aggregation) throws BackendException {
return null;
}

// This method will create a map of field ids to values. In the case of multiValued fields,
// it will consolidate all the values into one List or Set so it can be updated with a single Solr operation
private Map<String, Object> collectFieldValues(List<IndexEntry> content, String collectionName,
Expand Down Expand Up @@ -672,7 +678,6 @@ public Stream<String> query(IndexQuery query, KeyInformation.IndexRetriever info
doc -> doc.getFieldValue(keyIdField).toString());
}

@Override
public Long queryCount(IndexQuery query, KeyInformation.IndexRetriever information, BaseTransaction tx) throws BackendException {
try {
String collection = query.getStore();
Expand Down Expand Up @@ -1064,6 +1069,11 @@ public void clearStorage() throws BackendException {
}
}

@Override
public void clearStore(String s) throws BackendException {

}

@Override
public boolean supports(KeyInformation information, JanusGraphPredicate predicate) {
final Class<?> dataType = information.getDataType();
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,9 @@
<hppc.version>0.8.1</hppc.version>
<httpcomponents-httpclient.version>4.5.13</httpcomponents-httpclient.version>
<httpcomponents-httpcore.version>4.4.13</httpcomponents-httpcore.version>
<jackson.databind.version>2.11.3</jackson.databind.version>
<jackson.version>2.11.3</jackson.version>
<janusgraph.version>0.6.0</janusgraph.version>
<jackson.databind.version>2.12.4</jackson.databind.version>
<jackson.version>2.12.4</jackson.version>
<janusgraph.version>1.0.0</janusgraph.version>
<janusgraph.cassandra.version>0.5.3</janusgraph.cassandra.version>
<javax-inject.version>1</javax-inject.version>
<javax.servlet.version>3.1.0</javax.servlet.version>
Expand Down Expand Up @@ -773,7 +773,7 @@
<surefire.forkCount>2C</surefire.forkCount>
<surefire.version>3.0.0-M5</surefire.version>
<testng.version>6.9.4</testng.version>
<tinkerpop.version>3.5.1</tinkerpop.version>
<tinkerpop.version>3.7.0</tinkerpop.version>
<woodstox-core.version>5.0.3</woodstox-core.version>
<zookeeper.version>3.4.6</zookeeper.version>
<redis.client.version>3.20.1</redis.client.version>
Expand Down
12 changes: 12 additions & 0 deletions repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
<artifactId>atlas-graphdb-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-util</artifactId>
<version>${tinkerpop.version}</version>
</dependency>

<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<version>4.0.1</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.atlas.web.model.DebugMetrics;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hbase.shaded.org.apache.commons.configuration2.SubsetConfiguration;
import org.apache.hadoop.metrics2.AbstractMetric;
import org.apache.hadoop.metrics2.MetricsRecord;
import org.apache.hadoop.metrics2.MetricsSink;
Expand Down Expand Up @@ -58,10 +59,6 @@ public HashMap getMetrics() {
return metricStructuredSnapshot;
}

@Override
public void init(org.apache.commons.configuration2.SubsetConfiguration subsetConfiguration) {
}

@Override
public void flush() {
}
Expand Down Expand Up @@ -112,4 +109,9 @@ private void updateMetricType(DebugMetrics debugMetrics, String metricType, Abst
private static String inferMeasureType(String fullName, String nameWithoutMetricType) {
return fullName.replaceFirst(nameWithoutMetricType, "");
}

@Override
public void init(SubsetConfiguration subsetConfiguration) {

}
}

0 comments on commit 7df57e2

Please sign in to comment.