org.janusgraph.core.JanusGraph.addVertex()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.janusgraph.core.JanusGraph.addVertex()方法的一些代码示例,展示了JanusGraph.addVertex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JanusGraph.addVertex()方法的具体详情如下:
包路径:org.janusgraph.core.JanusGraph
类名称:JanusGraph
方法名:addVertex

JanusGraph.addVertex介绍

暂无

代码示例

代码示例来源:origin: awslabs/dynamodb-janusgraph-storage-backend

@Override
  public void run() {
    final long start = System.currentTimeMillis();
    final Vertex vertex = graph.addVertex();
    vertex.property(COMIC_BOOK, comicBook);
    REGISTRY.counter(COUNTER_GET + COMIC_BOOK).inc();
    final long end = System.currentTimeMillis();
    final long time = end - start;
    REGISTRY.timer(TIMER_CREATE + COMIC_BOOK).update(time, TimeUnit.MILLISECONDS);
  }
}

代码示例来源:origin: awslabs/dynamodb-janusgraph-storage-backend

@Override
  public void run() {
    final long start = System.currentTimeMillis();
    final Vertex vertex = graph.addVertex();
    vertex.property(CHARACTER, character);
    // only sets weapon on character vertex on initial creation.
    vertex.property(WEAPON, WEAPONS.get(RANDOM.nextInt(WEAPONS.size())));
    REGISTRY.counter(COUNTER_GET + CHARACTER).inc();
    final long end = System.currentTimeMillis();
    final long time = end - start;
    REGISTRY.timer(TIMER_CREATE + CHARACTER).update(time, TimeUnit.MILLISECONDS);
  }
}

代码示例来源:origin: apache/atlas

@Override
public AtlasVertex<AtlasJanusVertex, AtlasJanusEdge> addVertex() {
  Vertex result = getGraph().addVertex();
  return GraphDbObjectFactory.createVertex(this, result);
}

代码示例来源:origin: org.jboss.windup.graph/windup-graph-impl

@Override
public <T> T addFramedVertex(final ClassInitializer<T> initializer, final Object... keyValues) {
  final Vertex vertex;
  final T framedVertex;
  if( keyValues != null ) {
    vertex = this.getBaseGraph().addVertex(keyValues);
    framedVertex = frameNewElement(vertex, initializer);
  }
  else {
    vertex = this.getBaseGraph().addVertex();
    framedVertex = frameNewElement(vertex, initializer);
  }
  GraphContextImpl.this.mutationListener.vertexAdded(vertex);
  return framedVertex;
}

代码示例来源:origin: windup/windup

@Override
public <T> T addFramedVertex(final ClassInitializer<T> initializer, final Object... keyValues) {
  final Vertex vertex;
  final T framedVertex;
  if( keyValues != null ) {
    vertex = this.getBaseGraph().addVertex(keyValues);
    framedVertex = frameNewElement(vertex, initializer);
  }
  else {
    vertex = this.getBaseGraph().addVertex();
    framedVertex = frameNewElement(vertex, initializer);
  }
  GraphContextImpl.this.mutationListener.vertexAdded(vertex);
  return framedVertex;
}

代码示例来源:origin: org.jboss.windup.graph/windup-graph-impl

@Override
  public <T> T addFramedVertexExplicit(final ClassInitializer<T> initializer) {
    Vertex vertex = this.getBaseGraph().addVertex();
    final T framedVertex = frameNewElementExplicit(vertex, initializer);
    GraphContextImpl.this.mutationListener.vertexAdded(vertex);
    return framedVertex;
  }
};

代码示例来源:origin: windup/windup

@Override
  public <T> T addFramedVertexExplicit(final ClassInitializer<T> initializer) {
    Vertex vertex = this.getBaseGraph().addVertex();
    final T framedVertex = frameNewElementExplicit(vertex, initializer);
    GraphContextImpl.this.mutationListener.vertexAdded(vertex);
    return framedVertex;
  }
};

代码示例来源:origin: awslabs/dynamodb-janusgraph-storage-backend

private static void process(final JanusGraph graph, final Appeared appeared) {
  Vertex comicBookVertex = get(graph, COMIC_BOOK, appeared.getComicBook());
  if (null == comicBookVertex) {
    REGISTRY.counter("error.missingComicBook." + appeared.getComicBook()).inc();
    comicBookVertex = graph.addVertex();
    comicBookVertex.property(COMIC_BOOK, appeared.getComicBook());
  }
  Vertex characterVertex = get(graph, CHARACTER, appeared.getCharacter());
  if (null == characterVertex) {
    REGISTRY.counter("error.missingCharacter." + appeared.getCharacter()).inc();
    characterVertex = graph.addVertex();
    characterVertex.property(CHARACTER, appeared.getCharacter());
    characterVertex.property(WEAPON, WEAPONS.get(RANDOM.nextInt(WEAPONS.size())));
  }
  characterVertex.addEdge(APPEARED, comicBookVertex);
}

代码示例来源:origin: Netflix/ndbench

@Override
public String writeSingle(String key) throws Exception {
  if (useJanusgraphTransaction) {
      graph.addVertex(T.label, VERTEX_LABEL_LEVEL_1, PROP_CUSTOM_ID_KEY, key, PROP_METADATA_KEY,
          dataGenerator.getRandomValue()); //Automatically opens a new transaction
      graph.tx().commit();
  } else {
    traversalSource.getGraph().addVertex(T.label, VERTEX_LABEL_LEVEL_1, PROP_CUSTOM_ID_KEY, key,
        PROP_METADATA_KEY, dataGenerator.getRandomValue());
    traversalSource.getGraph().tx().commit();
  }
  return OK;
}

相关文章