private BackendEntry getEntryById(Id id, Map<Id, BackendEntry> entries) { // TODO: improve id split Id entryId = IdGenerator.of(EdgeId.split(id)[0]); return entries.get(entryId); }
private static String columnOfEdge(Id id) { // TODO: improve id split String[] parts = EdgeId.split(id); if (parts.length > 1) { parts = Arrays.copyOfRange(parts, 1, parts.length); return EdgeId.concat(parts); } else { // All edges assert parts.length == 1; } return null; } }
public static String[] split(Id id) { return EdgeId.split(id.asString()); }
private static Id vertexIdOfEdge(TextBackendEntry entry) { assert entry.type().isEdge(); // Assume the first part is owner vertex id String vertexId = EdgeId.split(entry.id())[0]; return IdGenerator.of(vertexId); }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); List<Object> list = new ArrayList<>(5); list.add(IdUtil.writeString(edgeId.ownerVertexId())); list.add(edgeId.direction().code()); list.add(edgeId.edgeLabelId().asLong()); list.add(edgeId.sortValues()); list.add(IdUtil.writeString(edgeId.otherVertexId())); return list; }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); List<Object> list = new ArrayList<>(5); list.add(IdUtil.writeString(edgeId.ownerVertexId())); list.add(edgeId.direction().code()); list.add(edgeId.edgeLabelId().asLong()); list.add(edgeId.sortValues()); list.add(IdUtil.writeString(edgeId.otherVertexId())); return list; }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); return idColumnValue(edgeId); }
public static String[] split(Id id) { return EdgeId.split(id.asString()); }
String[] colParts = EdgeId.split(colName);
String[] parts = EdgeId.split(id); Id entryId = IdGenerator.of(parts[0]);
private static Id vertexIdOfEdge(TextBackendEntry entry) { assert entry.type().isEdge(); // Assume the first part is owner vertex id String vertexId = EdgeId.split(entry.id())[0]; return IdGenerator.of(vertexId); } }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); List<Object> list = new ArrayList<>(5); list.add(IdUtil.writeString(edgeId.ownerVertexId())); list.add(edgeId.direction().code()); list.add(edgeId.edgeLabelId().asLong()); list.add(edgeId.sortValues()); list.add(IdUtil.writeString(edgeId.otherVertexId())); return list; }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); List<Object> list = new ArrayList<>(5); list.add(IdUtil.writeString(edgeId.ownerVertexId())); list.add(edgeId.direction().code()); list.add(edgeId.edgeLabelId().asLong()); list.add(edgeId.sortValues()); list.add(IdUtil.writeString(edgeId.otherVertexId())); return list; }
@Override protected List<Object> idColumnValue(Id id) { EdgeId edgeId; if (!(id instanceof EdgeId)) { String[] idParts = EdgeId.split(id); if (idParts.length == 1) { // Delete edge by label return Arrays.asList((Object[]) idParts); } id = IdUtil.readString(id.asString()); edgeId = EdgeId.parse(id.asString()); } else { edgeId = (EdgeId) id; } E.checkState(edgeId.direction() == this.direction, "Can't query %s edges from %s edges table", edgeId.direction(), this.direction); return idColumnValue(edgeId); }
String[] colParts = EdgeId.split(colName);