Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE(server): support "parent & child" EdgeLabel type #2662

Merged
merged 28 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
try fix cassandra
  • Loading branch information
VGalaxies committed Sep 20, 2024
commit e44aaf3bcfeef04900ce794d69c57da3773ef8c9
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
ImmutableMap<HugeKeys, DataType> ckeys = ImmutableMap.of(
HugeKeys.DIRECTION, DataType.tinyint(),
HugeKeys.LABEL, TYPE_SL,
HugeKeys.SUB_LABEL, TYPE_SL,
HugeKeys.SORT_VALUES, DataType.text(),
HugeKeys.OTHER_VERTEX, TYPE_ID
);
Expand All @@ -376,6 +377,8 @@
*/
if (this.direction == Directions.OUT) {
this.createIndex(session, LABEL_INDEX, HugeKeys.LABEL);
this.createIndex(session, LABEL_INDEX, HugeKeys.SUB_LABEL);

Check warning on line 380 in hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java#L380

Added line #L380 was not covered by tests
// TODO: sub label?
}
}

Expand Down Expand Up @@ -431,6 +434,7 @@
list.add(IdUtil.writeBinString(edgeId.ownerVertexId()));
list.add(edgeId.directionCode());
list.add(edgeId.edgeLabelId().asLong());
list.add(edgeId.subLabelId().asLong());

Check warning on line 437 in hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java#L437

Added line #L437 was not covered by tests
list.add(edgeId.sortValues());
list.add(IdUtil.writeBinString(edgeId.otherVertexId()));
return list;
Expand Down Expand Up @@ -470,6 +474,8 @@
// Query edges by label index
Select select = QueryBuilder.select().from(this.labelIndexTable());
select.where(formatEQ(HugeKeys.LABEL, label.asLong()));
select.where(formatEQ(HugeKeys.SUB_LABEL, label.asLong()));

Check warning on line 477 in hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java#L477

Added line #L477 was not covered by tests
// TODO: sub label?

ResultSet rs;
try {
Expand Down Expand Up @@ -512,6 +518,7 @@
delete.where(formatEQ(HugeKeys.DIRECTION,
EdgeId.directionToCode(direction)));
delete.where(formatEQ(HugeKeys.LABEL, label.asLong()));
delete.where(formatEQ(HugeKeys.SUB_LABEL, label.asLong()));

Check warning on line 521 in hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraTables.java#L521

Added line #L521 was not covered by tests
delete.where(formatEQ(HugeKeys.SORT_VALUES, sortValues));
delete.where(formatEQ(HugeKeys.OTHER_VERTEX, otherVertex));
return delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public static class Edge extends CassandraTables.Edge {

private final String mvLabel2Edge = mvLabelTable(this.table());

// TODO: sub label?
private static final String LABEL = CassandraTable.formatKey(HugeKeys.LABEL);
private final List<String> keys = this.idColumnName().stream()
.filter(k -> k != HugeKeys.LABEL)
Expand Down
Loading