コード例 #1
0
ファイル: StandardTitanTx.java プロジェクト: rafatuita/titan
 @Override
 public TitanVertex addVertex() {
   verifyWriteAccess();
   StandardVertex vertex =
       new StandardVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
   vertex.addProperty(SystemKey.VertexState, (byte) 0);
   if (config.hasAssignIDsImmediately()) graph.assignID(vertex);
   vertexCache.add(vertex, vertex.getID());
   return vertex;
 }
コード例 #2
0
ファイル: StandardTitanTx.java プロジェクト: rafatuita/titan
 public TitanLabel makeEdgeLabel(EdgeLabelDefinition definition) {
   verifyOpen();
   TitanLabelVertex label =
       new TitanLabelVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
   addProperty(label, SystemKey.TypeName, definition.getName());
   addProperty(label, SystemKey.RelationTypeDefinition, definition);
   addProperty(label, SystemKey.TypeClass, TitanTypeClass.LABEL);
   graph.assignID(label);
   vertexCache.add(label, label.getID());
   typeCache.put(definition.getName(), label);
   return label;
 }
コード例 #3
0
ファイル: StandardTitanTx.java プロジェクト: rafatuita/titan
 public TitanKey makePropertyKey(PropertyKeyDefinition definition) {
   verifyOpen();
   TitanKeyVertex prop =
       new TitanKeyVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
   addProperty(prop, SystemKey.TypeName, definition.getName());
   addProperty(prop, SystemKey.PropertyKeyDefinition, definition);
   addProperty(prop, SystemKey.TypeClass, TitanTypeClass.KEY);
   graph.assignID(prop);
   Preconditions.checkArgument(prop.getID() > 0);
   vertexCache.add(prop, prop.getID());
   typeCache.put(definition.getName(), prop);
   return prop;
 }