public Set<VertexLabel> getOutVertexLabels() { Set<VertexLabel> result = new HashSet<>(this.outVertexLabels); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { result.addAll(this.uncommittedOutVertexLabels); result.removeAll(this.uncommittedRemovedOutVertexLabels); } return Collections.unmodifiableSet(result); }
public Set<VertexLabel> getOutVertexLabels() { Set<VertexLabel> result = new HashSet<>(this.outVertexLabels); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { result.addAll(this.uncommittedOutVertexLabels); result.removeAll(this.uncommittedRemovedOutVertexLabels); } return Collections.unmodifiableSet(result); }
public Set<VertexLabel> getInVertexLabels() { Set<VertexLabel> result = new HashSet<>(this.inVertexLabels); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { result.addAll(this.uncommittedInVertexLabels); result.removeAll(this.uncommittedRemovedInVertexLabels); } return Collections.unmodifiableSet(result); }
public Set<VertexLabel> getInVertexLabels() { Set<VertexLabel> result = new HashSet<>(this.inVertexLabels); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { result.addAll(this.uncommittedInVertexLabels); result.removeAll(this.uncommittedRemovedInVertexLabels); } return Collections.unmodifiableSet(result); }
@Override public boolean equals(Object other) { if (!super.equals(other)) { return false; } if (!(other instanceof EdgeLabel)) { return false; } EdgeLabel otherEdgeLabel = (EdgeLabel) other; if (isValid()) { if (this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread() && !this.uncommittedInVertexLabels.isEmpty()) { VertexLabel vertexLabel = this.uncommittedOutVertexLabels.iterator().next(); VertexLabel otherVertexLabel = otherEdgeLabel.uncommittedOutVertexLabels.iterator().next(); return vertexLabel.getSchema().equals(otherVertexLabel.getSchema()) && otherEdgeLabel.getLabel().equals(this.getLabel()); } else { VertexLabel vertexLabel = this.outVertexLabels.iterator().next(); VertexLabel otherVertexLabel = otherEdgeLabel.outVertexLabels.iterator().next(); return vertexLabel.getSchema().equals(otherVertexLabel.getSchema()) && otherEdgeLabel.getLabel().equals(this.getLabel()); } } return otherEdgeLabel.getLabel().equals(this.getLabel()); }
/** * remove in foreign key for a given vertex label and edge label * * @param vertexLabel * @param edgeLabel */ void removeInForeignKeysFromVertexLabel(VertexLabel vertexLabel, EdgeLabel edgeLabel) { Preconditions.checkState(isSqlWriteLockHeldByCurrentThread() || isTopologyMapWriteLockHeldByCurrentThread()); SchemaTable schemaTable = SchemaTable.of(vertexLabel.getSchema().getName(), VERTEX_PREFIX + vertexLabel.getLabel()); Pair<Set<SchemaTable>, Set<SchemaTable>> foreignKeys = this.schemaTableForeignKeyCache.get(schemaTable); if (foreignKeys != null && edgeLabel.isValid()) { foreignKeys.getLeft().remove(SchemaTable.of(edgeLabel.getSchema().getName(), EDGE_PREFIX + edgeLabel.getLabel())); } }
@Override public boolean equals(Object other) { if (!super.equals(other)) { return false; } if (!(other instanceof EdgeLabel)) { return false; } EdgeLabel otherEdgeLabel = (EdgeLabel) other; if (isValid()) { if (this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread() && !this.uncommittedInVertexLabels.isEmpty()) { VertexLabel vertexLabel = this.uncommittedOutVertexLabels.iterator().next(); VertexLabel otherVertexLabel = otherEdgeLabel.uncommittedOutVertexLabels.iterator().next(); return vertexLabel.getSchema().equals(otherVertexLabel.getSchema()) && otherEdgeLabel.getLabel().equals(this.getLabel()); } else { VertexLabel vertexLabel = this.outVertexLabels.iterator().next(); VertexLabel otherVertexLabel = otherEdgeLabel.outVertexLabels.iterator().next(); return vertexLabel.getSchema().equals(otherVertexLabel.getSchema()) && otherEdgeLabel.getLabel().equals(this.getLabel()); } } return otherEdgeLabel.getLabel().equals(this.getLabel()); }
/** * remove in foreign key for a given vertex label and edge label * * @param vertexLabel * @param edgeLabel */ void removeInForeignKeysFromVertexLabel(VertexLabel vertexLabel, EdgeLabel edgeLabel) { Preconditions.checkState(isSqlWriteLockHeldByCurrentThread() || isTopologyMapWriteLockHeldByCurrentThread()); SchemaTable schemaTable = SchemaTable.of(vertexLabel.getSchema().getName(), VERTEX_PREFIX + vertexLabel.getLabel()); Pair<Set<SchemaTable>, Set<SchemaTable>> foreignKeys = this.schemaTableForeignKeyCache.get(schemaTable); if (foreignKeys != null && edgeLabel.isValid()) { foreignKeys.getLeft().remove(SchemaTable.of(edgeLabel.getSchema().getName(), EDGE_PREFIX + edgeLabel.getLabel())); } }
boolean foundInEdgeLabels = false; for (EdgeLabel edgeLabel : this.inEdgeLabels.values()) { if (edgeLabel.isValid()) { Optional<JsonNode> jsonNodeOptional = edgeLabel.toNotifyJson(); if (jsonNodeOptional.isPresent()) {
boolean foundInEdgeLabels = false; for (EdgeLabel edgeLabel : this.inEdgeLabels.values()) { if (edgeLabel.isValid()) { Optional<JsonNode> jsonNodeOptional = edgeLabel.toNotifyJson(); if (jsonNodeOptional.isPresent()) {
@Override protected JsonNode toJson() { ObjectNode edgeLabelNode = new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory()); if (isValid()) { edgeLabelNode.put("schema", getSchema().getName()); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { outVertexLabelArrayNode = new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory()); for (VertexLabel outVertexLabel : this.uncommittedOutVertexLabels) {
@Override protected JsonNode toJson() { ObjectNode edgeLabelNode = new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory()); if (isValid()) { edgeLabelNode.put("schema", getSchema().getName()); if (isValid() && this.getSchema().getTopology().isSqlWriteLockHeldByCurrentThread()) { outVertexLabelArrayNode = new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory()); for (VertexLabel outVertexLabel : this.uncommittedOutVertexLabels) {
if (lbl != null) { EdgeRemoveType ert = EdgeRemoveType.valueOf(n.get("type").asText()); if (lbl.isValid()) { ForeignKey foreignKey; if (this.hasIDPrimaryKey()) {
if (lbl != null) { EdgeRemoveType ert = EdgeRemoveType.valueOf(n.get("type").asText()); if (lbl.isValid()) { ForeignKey foreignKey; if (this.hasIDPrimaryKey()) {
if (lbl.isValid()) { removeFromEdgeForeignKeyCache( lbl.getSchema().getName() + "." + EDGE_PREFIX + lbl.getLabel(),
if (lbl.isValid()) { removeFromEdgeForeignKeyCache( lbl.getSchema().getName() + "." + EDGE_PREFIX + lbl.getLabel(),