From ca65eda0c023d31a43c50d9937600708f9bdae00 Mon Sep 17 00:00:00 2001 From: shirly121 Date: Thu, 15 Jul 2021 14:38:52 +0800 Subject: [PATCH] implement GraphStoreService api for maxgraph && add snapshot (#537) * implement GraphStoreService api for maxgraph && add snapshot function * guarantee one query use the same snapshot id * refine cached graph schema structure --- interactive_engine/src/gaia-adaptor/pom.xml | 70 +++++++++++++++++++ .../graphscope/gaia/CachedMaxGraphMeta.java | 31 ++++++++ .../graphscope/gaia/MaxGraphStore.java | 68 ++++++++++++++++++ interactive_engine/src/pom.xml | 2 + .../graphscope/gaia/config/GaiaConfig.java | 2 +- .../gaia/plan/LogicPlanGlobalMap.java | 29 +++++--- .../plan/strategy/SchemaIdMakerStrategy.java | 2 +- .../plan/translator/builder/PlanConfig.java | 3 +- .../gaia/processor/GaiaGraphOpProcessor.java | 7 ++ .../gaia/processor/LogicPlanProcessor.java | 13 +++- .../gaia/processor/TraversalOpProcessor.java | 11 +-- .../gaia/store/GraphStoreService.java | 4 ++ .../graphscope/gaia/store/GraphType.java | 2 +- .../gaia/store/SchemaNotFoundException.java | 15 ++++ .../resources/maxgraph.modern.properties.json | 48 +++++++++++++ 15 files changed, 288 insertions(+), 19 deletions(-) create mode 100644 interactive_engine/src/gaia-adaptor/pom.xml create mode 100644 interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/CachedMaxGraphMeta.java create mode 100644 interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/MaxGraphStore.java create mode 100644 research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/SchemaNotFoundException.java create mode 100644 research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/resources/maxgraph.modern.properties.json diff --git a/interactive_engine/src/gaia-adaptor/pom.xml b/interactive_engine/src/gaia-adaptor/pom.xml new file mode 100644 index 000000000000..cd56668d2ff3 --- /dev/null +++ b/interactive_engine/src/gaia-adaptor/pom.xml @@ -0,0 +1,70 @@ + + + + maxgraph-src + com.alibaba.maxgraph + 0.0.1-SNAPSHOT + + 4.0.0 + + gaia-adaptor + + + + com.alibaba.graphscope + gremlin-server-plugin + 1.0-SNAPSHOT + + + com.alibaba.maxgraph + v2 + 0.0.1-SNAPSHOT + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + + + com.google.common + shaded.com.google.common + + + com.google.protobuf + shaded.com.google.protobuf + + + + + + + + + \ No newline at end of file diff --git a/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/CachedMaxGraphMeta.java b/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/CachedMaxGraphMeta.java new file mode 100644 index 000000000000..e83a19b19d07 --- /dev/null +++ b/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/CachedMaxGraphMeta.java @@ -0,0 +1,31 @@ +package com.alibaba.graphscope.gaia; + +import com.alibaba.maxgraph.compiler.api.schema.GraphSchema; +import com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher; +import org.apache.commons.lang3.tuple.Pair; + +public class CachedMaxGraphMeta { + private SchemaFetcher schemaFetcher; + private GraphSchema graphSchema; + private Long snapshotId; + + public CachedMaxGraphMeta(SchemaFetcher schemaFetcher) { + this.schemaFetcher = schemaFetcher; + } + + public synchronized void update() { + Pair pair = this.schemaFetcher.getSchemaSnapshotPair(); + if (pair != null) { + this.graphSchema = pair.getLeft(); + this.snapshotId = pair.getRight(); + } + } + + public GraphSchema getGraphSchema() { + return graphSchema; + } + + public Long getSnapshotId() { + return snapshotId; + } +} diff --git a/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/MaxGraphStore.java b/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/MaxGraphStore.java new file mode 100644 index 000000000000..c75a37e7862e --- /dev/null +++ b/interactive_engine/src/gaia-adaptor/src/main/java/com/alibaba/graphscope/gaia/MaxGraphStore.java @@ -0,0 +1,68 @@ +package com.alibaba.graphscope.gaia; + +import com.alibaba.graphscope.gaia.store.GraphStoreService; +import com.alibaba.graphscope.gaia.store.SchemaNotFoundException; +import com.alibaba.maxgraph.compiler.api.schema.GraphSchema; +import com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MaxGraphStore extends GraphStoreService { + private static final Logger logger = LoggerFactory.getLogger(MaxGraphStore.class); + public static final String MAXGRAPH_MODERN_PROPERTY_RESOURCE = "maxgraph.modern.properties.json"; + private CachedMaxGraphMeta cachedGraphSchemaPair; + + public MaxGraphStore(SchemaFetcher schemaFetcher) { + super(MAXGRAPH_MODERN_PROPERTY_RESOURCE); + this.cachedGraphSchemaPair = new CachedMaxGraphMeta(schemaFetcher); + } + + @Override + public long getLabelId(String label) { + try { + GraphSchema graphSchema = this.cachedGraphSchemaPair.getGraphSchema(); + return graphSchema.getElement(label).getLabelId(); + } catch (Exception e) { + logger.error("label " + label + " is invalid, please check schema"); + throw new SchemaNotFoundException("label " + label + " is invalid, please check schema"); + } + } + + @Override + public String getLabel(long labelId) { + GraphSchema graphSchema = this.cachedGraphSchemaPair.getGraphSchema(); + return graphSchema.getElement((int) labelId).getLabel(); + } + + @Override + public long getGlobalId(long labelId, long propertyId) { + throw new UnsupportedOperationException(); + } + + @Override + public int getPropertyId(String propertyName) { + try { + GraphSchema graphSchema = this.cachedGraphSchemaPair.getGraphSchema(); + return graphSchema.getPropertyId(propertyName); + } catch (Exception e) { + logger.error("property " + propertyName + " is invalid, please check schema"); + throw new SchemaNotFoundException("property " + propertyName + " is invalid, please check schema"); + } + } + + @Override + public String getPropertyName(int propertyId) { + GraphSchema graphSchema = this.cachedGraphSchemaPair.getGraphSchema(); + return graphSchema.getPropertyName(propertyId); + } + + @Override + public long getSnapShotId() { + return this.cachedGraphSchemaPair.getSnapshotId(); + } + + @Override + public synchronized void updateSnapShotId() { + this.cachedGraphSchemaPair.update(); + } +} diff --git a/interactive_engine/src/pom.xml b/interactive_engine/src/pom.xml index 720d9636abfd..29c78d42e38f 100644 --- a/interactive_engine/src/pom.xml +++ b/interactive_engine/src/pom.xml @@ -26,6 +26,8 @@ executor v2 data_load_tools + ../../research/gaia/gremlin/compiler + gaia-adaptor diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/config/GaiaConfig.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/config/GaiaConfig.java index 39dc703edcd2..49bd9a1dfbce 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/config/GaiaConfig.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/config/GaiaConfig.java @@ -9,7 +9,7 @@ public interface GaiaConfig { int DEFAULT_PEGASUS_WORKER_NUM = 1; int DEFAULT_PEGASUS_SERVER_NUM = 0; int DEFAULT_PEGASUS_TIMEOUT = 60000; - GraphType DEFAULT_GRAPH_TYPE = GraphType.VINEYARD; + GraphType DEFAULT_GRAPH_TYPE = GraphType.MAXGRAPH; String DEFAULT_SCHEMA_PATH = "."; boolean DEFAULT_OPT_FLAG = false; diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/LogicPlanGlobalMap.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/LogicPlanGlobalMap.java index 21e395355b7e..1485c9478a59 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/LogicPlanGlobalMap.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/LogicPlanGlobalMap.java @@ -15,6 +15,7 @@ */ package com.alibaba.graphscope.gaia.plan; +import com.alibaba.graphscope.common.proto.Common; import com.alibaba.graphscope.common.proto.Gremlin; import com.alibaba.graphscope.gaia.idmaker.IdMaker; import com.alibaba.graphscope.gaia.plan.extractor.PropertyExtractor; @@ -23,6 +24,7 @@ import com.alibaba.graphscope.gaia.plan.strategy.global.TransformTraverserStep; import com.alibaba.graphscope.gaia.FilterHelper; import com.alibaba.graphscope.gaia.plan.strategy.global.property.cache.ToFetchProperties; +import com.alibaba.graphscope.gaia.plan.translator.builder.PlanConfig; import com.alibaba.pegasus.builder.JobBuilder; import com.alibaba.pegasus.builder.ReduceBuilder; import com.alibaba.graphscope.gaia.plan.extractor.TagKeyExtractorFactory; @@ -36,6 +38,7 @@ import com.alibaba.graphscope.gaia.plan.translator.builder.StepBuilder; import com.alibaba.graphscope.gaia.plan.translator.builder.TraversalBuilder; import com.google.protobuf.ByteString; +import com.google.protobuf.Option; import org.apache.commons.configuration.Configuration; import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Step; @@ -129,16 +132,21 @@ protected Object getStepResource(Step t, Configuration conf) { stepPlanMap.put(STEP.CachePropGaiaGraphStep, new GremlinStepResource() { @Override protected Object getStepResource(Step t, Configuration conf) { - Gremlin.QueryParams params = StoreParamsBuider.newBuilder() + StoreParamsBuider paramsBuider = StoreParamsBuider.newBuilder() .setGraphLabels(((CachePropGaiaGraphStep) t).getGraphLabels()) .setPredicates(new PredicateTranslator(new HasContainerP((CachePropGaiaGraphStep) t)).translate()) - .setRequiredProperties(((CachePropGaiaGraphStep) t).cacheProperties()) - .build(); + .setRequiredProperties(((CachePropGaiaGraphStep) t).cacheProperties()); + // set snapshot id if present + Long snapshotId = (Long) conf.getProperty(PlanConfig.SNAPSHOT_ID); + if (snapshotId != null) { + Common.Value value = Common.Value.newBuilder().setI64(snapshotId).build(); + paramsBuider.setExtraParams(Collections.singletonMap(PlanConfig.SNAPSHOT_ID, value)); + } return Gremlin.GraphStep.newBuilder() .addAllIds(PlanUtils.extractIds(((CachePropGaiaGraphStep) t).getIds())) .setReturnType(((GraphStep) t).returnsVertex() ? Gremlin.EntityType.VERTEX : Gremlin.EntityType.EDGE) .addTraverserRequirements(Gremlin.TraverserRequirement.valueOf(((CachePropGaiaGraphStep) t).getTraverserRequirement().name())) - .setQueryParams(params) + .setQueryParams(paramsBuider.build()) .build(); } }); @@ -209,14 +217,19 @@ protected Object getStepResource(Step t, Configuration conf) { stepPlanMap.put(STEP.CachePropVertexStep, new GremlinStepResource() { @Override protected Object getStepResource(Step t, Configuration conf) { - Gremlin.QueryParams params = StoreParamsBuider.newBuilder() + StoreParamsBuider paramsBuider = StoreParamsBuider.newBuilder() .setGraphLabels(Arrays.asList(((CachePropVertexStep) t).getEdgeLabels())) - .setRequiredProperties(((CachePropVertexStep) t).cacheProperties()) - .build(); + .setRequiredProperties(((CachePropVertexStep) t).cacheProperties()); + // set snapshot id if present + Long snapshotId = (Long) conf.getProperty(PlanConfig.SNAPSHOT_ID); + if (snapshotId != null) { + Common.Value value = Common.Value.newBuilder().setI64(snapshotId).build(); + paramsBuider.setExtraParams(Collections.singletonMap(PlanConfig.SNAPSHOT_ID, value)); + } return Gremlin.VertexStep.newBuilder() .setReturnType(((CachePropVertexStep) t).returnsVertex() ? Gremlin.EntityType.VERTEX : Gremlin.EntityType.EDGE) .setDirection(Gremlin.Direction.valueOf(((CachePropVertexStep) t).getDirection().name())) - .setQueryParams(params) + .setQueryParams(paramsBuider.build()) .build(); } }); diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/strategy/SchemaIdMakerStrategy.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/strategy/SchemaIdMakerStrategy.java index 5507c7d8c5a9..c86040a3095a 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/strategy/SchemaIdMakerStrategy.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/strategy/SchemaIdMakerStrategy.java @@ -109,7 +109,7 @@ public void apply(Traversal.Admin traversal) { } GraphType graphType = config.getGraphType(); // property string -> property id - if (graphType == GraphType.VINEYARD) { + if (graphType == GraphType.MAXGRAPH) { for (int i = 0; i < steps.size(); ++i) { Step step = steps.get(i); if (step instanceof HasContainerHolder) { diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/translator/builder/PlanConfig.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/translator/builder/PlanConfig.java index f256f82df608..e02722ccea14 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/translator/builder/PlanConfig.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/plan/translator/builder/PlanConfig.java @@ -19,5 +19,6 @@ public class PlanConfig { public static String QUERY_ID = "query_id"; public static String TAG_ID_MAKER = "tag_id_maker"; public static String QUERY_CONFIG = "query_config"; - public static String SNAPSHOT_ID = "snapshot_id"; + // This snapshot id is aligned with the runtime to represent the extra parameter of snapshot id while accessing MaxGraphStore + public static String SNAPSHOT_ID = "SID"; } diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/GaiaGraphOpProcessor.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/GaiaGraphOpProcessor.java index bffde4893f49..121c249aba56 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/GaiaGraphOpProcessor.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/GaiaGraphOpProcessor.java @@ -21,6 +21,7 @@ import com.alibaba.graphscope.gaia.result.DefaultResultParser; import com.alibaba.graphscope.gaia.result.GremlinResultProcessor; import com.alibaba.graphscope.gaia.store.GraphStoreService; +import com.alibaba.graphscope.gaia.store.GraphType; import com.alibaba.pegasus.builder.AbstractBuilder; import com.alibaba.graphscope.gaia.broadcast.AbstractBroadcastProcessor; import com.alibaba.graphscope.gaia.broadcast.RpcBroadcastProcessor; @@ -59,6 +60,9 @@ protected GremlinExecutor.LifeCycle createLifeCycle(Context ctx, Supplier args = msg.getArgs(); final long seto = args.containsKey(Tokens.ARGS_SCRIPT_EVAL_TIMEOUT) ? ((Number) args.get(Tokens.ARGS_SCRIPT_EVAL_TIMEOUT)).longValue() : settings.scriptEvaluationTimeout; + if (config.getGraphType() == GraphType.MAXGRAPH) { + graphStore.updateSnapShotId(); + } return GremlinExecutor.LifeCycle.build() .scriptEvaluationTimeoutOverride(seto) .beforeEval(b -> { @@ -81,6 +85,9 @@ protected GremlinExecutor.LifeCycle createLifeCycle(Context ctx, Supplier args = msg.getArgs(); final long seto = args.containsKey(Tokens.ARGS_SCRIPT_EVAL_TIMEOUT) ? ((Number) args.get(Tokens.ARGS_SCRIPT_EVAL_TIMEOUT)).longValue() : settings.scriptEvaluationTimeout; + if (config.getGraphType() == GraphType.MAXGRAPH) { + graphStore.updateSnapShotId(); + } return GremlinExecutor.LifeCycle.build() .scriptEvaluationTimeoutOverride(seto) .beforeEval(b -> { @@ -70,11 +74,14 @@ protected GremlinExecutor.LifeCycle createLifeCycle(Context ctx, Supplier { if (o != null && o instanceof Traversal) { long queryId = (long) queryIdMaker.getId(o); - AbstractBuilder jobReqBuilder = new TraversalTranslator((new TraversalBuilder((Traversal.Admin) o)) + TraversalBuilder traversalBuilder = new TraversalBuilder((Traversal.Admin) o) .addConfig(PlanConfig.QUERY_ID, queryId) .addConfig(PlanConfig.TAG_ID_MAKER, new TagIdMaker((Traversal.Admin) o)) - .addConfig(PlanConfig.QUERY_CONFIG, PlanUtils.getDefaultConfig(queryId, config))) - .translate(); + .addConfig(PlanConfig.QUERY_CONFIG, PlanUtils.getDefaultConfig(queryId, config)); + if (config.getGraphType() == GraphType.MAXGRAPH) { + traversalBuilder.addConfig(PlanConfig.SNAPSHOT_ID, Long.valueOf(graphStore.getSnapShotId())); + } + AbstractBuilder jobReqBuilder = new TraversalTranslator(traversalBuilder).translate(); String content = new String(jobReqBuilder.build().toByteArray(), StandardCharsets.ISO_8859_1); AbstractGraphOpProcessor.writeResultList(ctx, Arrays.asList(content), ResponseStatusCode.SUCCESS); } diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/TraversalOpProcessor.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/TraversalOpProcessor.java index a5cd3a30fdaf..49423c85711f 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/TraversalOpProcessor.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/processor/TraversalOpProcessor.java @@ -13,8 +13,8 @@ import com.alibaba.graphscope.gaia.result.GremlinResultProcessor; import com.alibaba.graphscope.gaia.result.RemoteTraverserResultParser; import com.alibaba.graphscope.gaia.store.GraphStoreService; +import com.alibaba.graphscope.gaia.store.GraphType; import com.alibaba.pegasus.builder.AbstractBuilder; -import org.apache.commons.io.FileUtils; import org.apache.tinkerpop.gremlin.driver.Tokens; import org.apache.tinkerpop.gremlin.driver.message.RequestMessage; import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode; @@ -29,8 +29,6 @@ import org.slf4j.LoggerFactory; import javax.script.SimpleBindings; -import java.io.File; -import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Map; @@ -63,6 +61,9 @@ public ThrowingConsumer select(Context ctx) throws OpProcessorException final Map aliases = (Map) message.optionalArgs(Tokens.ARGS_ALIASES).get(); final String traversalSourceName = aliases.entrySet().iterator().next().getValue(); logger.info("tokens ops is {}", message.getOp()); + if (config.getGraphType() == GraphType.MAXGRAPH) { + graphStore.updateSnapShotId(); + } switch (message.getOp()) { case Tokens.OPS_BYTECODE: op = (context -> { @@ -74,8 +75,10 @@ public ThrowingConsumer select(Context ctx) throws OpProcessorException .addConfig(PlanConfig.QUERY_ID, queryId) .addConfig(PlanConfig.TAG_ID_MAKER, new TagIdMaker((Traversal.Admin) traversal)) .addConfig(PlanConfig.QUERY_CONFIG, PlanUtils.getDefaultConfig(queryId, config)); + if (config.getGraphType() == GraphType.MAXGRAPH) { + traversalBuilder.addConfig(PlanConfig.SNAPSHOT_ID, Long.valueOf(graphStore.getSnapShotId())); + } AbstractBuilder jobReqBuilder = new TraversalTranslator(traversalBuilder).translate(); - FileUtils.writeStringToFile(new File("plan.log"), String.format("query-%d", queryId), StandardCharsets.UTF_8, true); PlanUtils.print(jobReqBuilder); broadcastProcessor.broadcast(jobReqBuilder.build(), new GremlinResultProcessor(ctx, new RemoteTraverserResultParser(traversalBuilder, graphStore))); diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphStoreService.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphStoreService.java index a103b1252519..badcb04cfbc7 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphStoreService.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphStoreService.java @@ -60,6 +60,10 @@ public long getSnapShotId() { throw new UnsupportedOperationException(); } + public void updateSnapShotId() { + throw new UnsupportedOperationException(); + } + public

Optional

getVertexProperty(BigInteger id, String key) { String idStr = String.valueOf(id); if (getVertexKeys(id).isEmpty()) return Optional.empty(); diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphType.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphType.java index c0f9ae13defa..293892cd08ef 100644 --- a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphType.java +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/GraphType.java @@ -1,6 +1,6 @@ package com.alibaba.graphscope.gaia.store; public enum GraphType { - VINEYARD, + MAXGRAPH, EXPERIMENTAL } diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/SchemaNotFoundException.java b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/SchemaNotFoundException.java new file mode 100644 index 000000000000..9d44fc8bdac1 --- /dev/null +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/java/com/alibaba/graphscope/gaia/store/SchemaNotFoundException.java @@ -0,0 +1,15 @@ +package com.alibaba.graphscope.gaia.store; + +public class SchemaNotFoundException extends RuntimeException { + public SchemaNotFoundException(String msg) { + super(msg); + } + + public SchemaNotFoundException(String msg, Throwable e) { + super(msg, e); + } + + public SchemaNotFoundException(Throwable e) { + super(e); + } +} diff --git a/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/resources/maxgraph.modern.properties.json b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/resources/maxgraph.modern.properties.json new file mode 100644 index 000000000000..11691f49a798 --- /dev/null +++ b/research/gaia/gremlin/compiler/gremlin-server-plugin/src/main/resources/maxgraph.modern.properties.json @@ -0,0 +1,48 @@ +{ + "vertex_properties": { + "-7732428334775821489": { + "name": "marko", + "age": 29 + }, + "6308168136910223060": { + "name": "vadas", + "age": 27 + }, + "-7991964441648465618": { + "name": "lop", + "lang": "java" + }, + "-6112228345218519679": { + "name": "josh", + "age": 32 + }, + "2233628339503041259": { + "name": "ripple", + "lang": "java" + }, + "-2045066182110421307": { + "name": "peter", + "age": 35 + } + }, + "edge_properties": { + "116365163195512080671421597138077195087": { + "weight": 0.5 + }, + "192856644219662164701116934573529602895": { + "weight": 0.4 + }, + "227531654916619196195951004092339690319": { + "weight": 1.0 + }, + "192856644219662164702737134563086904705": { + "weight": 0.4 + }, + "41203170334597432720105003197729156481": { + "weight": 1.0 + }, + "192856644219662164706804296726195003077": { + "weight": 0.2 + } + } +} \ No newline at end of file