public Vertex addVertex(final Object id) { String idString = null; Vertex vertex; if (null != id) { idString = id.toString(); vertex = this.vertices.get(idString); if (null != vertex) { throw ExceptionFactory.vertexWithIdAlreadyExists(id); } } else { boolean done = false; while (!done) { idString = this.getNextId(); vertex = this.vertices.get(idString); if (null == vertex) done = true; } } vertex = new TinkerVertex(idString, this); this.vertices.put(vertex.getId().toString(), vertex); return vertex; }
public Vertex addVertex(final Object id, final Object... properties) { if (id == null) throw ExceptionFactory.vertexIdCanNotBeNull(); if (retrieveFromCache(id) != null) throw ExceptionFactory.vertexWithIdAlreadyExists(id); nextElement(); Vertex v = baseGraph.addVertex(id); if (vertexIdKey != null) { v.setProperty(vertexIdKey, id); } cache.set(v, id); final BatchVertex newVertex = new BatchVertex(id); setProperties(newVertex, properties); return newVertex; }
@Override public Vertex addVertex(Object id) { if (id == null) { id = AccumuloGraphUtils.generateId(); } String idStr = id.toString(); Vertex vert = null; if (!globals.getConfig().getSkipExistenceChecks()) { vert = getVertex(idStr); if (vert != null) { throw ExceptionFactory.vertexWithIdAlreadyExists(idStr); } } vert = new AccumuloVertex(globals, idStr); globals.getVertexWrapper().writeVertex(vert); globals.checkedFlush(); globals.getCaches().cache(vert, Vertex.class); return vert; }
@Override public Vertex addVertex(Object id) { if (id == null) { id = AccumuloGraphUtils.generateId(); } String idStr = id.toString(); Vertex vert = null; if (!globals.getConfig().getSkipExistenceChecks()) { vert = getVertex(idStr); if (vert != null) { throw ExceptionFactory.vertexWithIdAlreadyExists(idStr); } } vert = new AccumuloVertex(globals, idStr); globals.getVertexWrapper().writeVertex(vert); globals.checkedFlush(); globals.getCaches().cache(vert, Vertex.class); return vert; }