示例#1
0
 @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
 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
 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;
 }