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

feat(client): support "parent & child" EdgeLabel type #624

Merged
merged 29 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
694a2a7
add EdgeLabelType and related field in EdgeLabel
Thespica Sep 25, 2024
3df065c
modify ci related script
Thespica Sep 25, 2024
f1b1afe
continue on error ci
Thespica Sep 25, 2024
786e9a6
enable run client's three test suites
Thespica Sep 25, 2024
59ed6a1
modify GraphElement.java
Thespica Sep 29, 2024
1e00082
fix EdgeLabelTest.testListByNames
Thespica Oct 1, 2024
6cc46a8
fix part of edge id related tests
Thespica Oct 1, 2024
75ce36a
let server of ci be the latest version of branch father-sub-edge
Thespica Oct 1, 2024
869997a
fix server version
Thespica Oct 1, 2024
cd26708
swich ci jdk to 11
Thespica Oct 1, 2024
5b8570f
not delay link of soruce label and target label to avoid null links
Thespica Oct 2, 2024
0c25411
fix getting name(aka sortValues) form edge id
Thespica Oct 3, 2024
d9f03e2
fix deserialize error of edge label, switch mockito version
Thespica Oct 4, 2024
9b672a2
fix testReadEdgeLabel's superfluous comma in json
Thespica Oct 4, 2024
ab04f08
let loader and spark-connector enable to rely on the latest client
Thespica Oct 8, 2024
2d9a2cb
set loader and spark-connector ci server be same as client, refine te…
Thespica Oct 8, 2024
bd4d32d
modify loader and spark-connector server-install script
Thespica Oct 8, 2024
2ddcda3
fix loader file load test's expected text
Thespica Oct 8, 2024
a87db4b
remove unused code, add deprecated annotation, makr TODO in ci and sc…
Thespica Oct 9, 2024
be5fb6e
modify way to repy on client
Thespica Oct 9, 2024
6d8b68d
correct ci.yaml gramma
Thespica Oct 9, 2024
37c38be
modify ci
Thespica Oct 10, 2024
13ddb27
format
Thespica Oct 10, 2024
b70118e
allow add target label before adding source label, format
Thespica Oct 10, 2024
05bcba2
remove GENERAL enum for EdgeLabelType
Thespica Oct 10, 2024
7563a6f
modify import *
Thespica Oct 11, 2024
1010a56
add todo of mockito
Thespica Oct 11, 2024
c2cb2d5
refactor: enhance the logic for client-ci
imbajin Oct 11, 2024
b39d740
format code
imbajin Oct 11, 2024
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
12 changes: 9 additions & 3 deletions .github/workflows/client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-client/assembly/travis
# TODO: replace it with the (latest - n) commit id (n >= 15)
COMMIT_ID: 6a4041e
COMMIT_ID: f6f3708
strategy:
fail-fast: false
matrix:
JAVA_VERSION: [ '8' ]
steps:
- name: Install JDK 8
- name: Install JDK 11 for server environment
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.JAVA_VERSION }}
java-version: 11
distribution: 'zulu'

- name: Cache Maven packages
Expand Down Expand Up @@ -63,6 +63,12 @@ jobs:
run: |
$TRAVIS_DIR/install-hugegraph-from-source.sh $COMMIT_ID

- name: Install Java ${{ matrix.JAVA_VERSION }} for client
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: Run test
run: |
cd hugegraph-client && ls *
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/loader-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
TRAVIS_DIR: hugegraph-loader/assembly/travis
STATIC_DIR: hugegraph-loader/assembly/static
# TODO: replace it with the (latest - n) commit id (n >= 15)
COMMIT_ID: 6a4041e
COMMIT_ID: f6f3708
DB_USER: root
DB_PASS: root
DB_DATABASE: load_test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spark-connector-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-spark-connector/assembly/travis
COMMIT_ID: 6a4041e
COMMIT_ID: f6f3708
steps:
- name: Install JDK 11
uses: actions/setup-java@v4
Expand Down
4 changes: 4 additions & 0 deletions hugegraph-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</parent>

<artifactId>hugegraph-client</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand All @@ -48,6 +49,9 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<!-- TODO: current version(2.8.48) will meet error when using java11 to test unit/RestResultTest,
switch to 2.25.1 will temporarily solve this problem -->
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public GraphElement property(String name, Object value) {
E.checkArgument(ReflectionUtil.isSimpleType(clazz) ||
clazz.equals(UUID.class) ||
clazz.equals(Date.class) ||
clazz.equals(byte[].class) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's for? (any context)

value instanceof List ||
value instanceof Set,
"Invalid property value type: '%s'", clazz);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.apache.hugegraph.structure.constant;

public enum EdgeLabelType {

NORMAL(0, "NORMAL"),

PARENT(1, "PARENT"),

SUB(2, "SUB");

private byte code = 0;
private String name = null;

EdgeLabelType(int code, String name) {
assert code < 256;
this.code = (byte) code;
this.name = name;
}

public boolean parent() {
return this == PARENT;
}

public boolean sub() {
return this == SUB;
}

public boolean normal() {
return this == NORMAL;
}

public byte code() {
return this.code;
}

public String string() {
return this.name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ public void targetLabel(String targetLabel) {
public String name() {
if (this.name == null) {
String[] idParts = SplicingIdGenerator.split(this.id);
E.checkState(idParts.length == 4,
"The edge id must be formatted by 4 parts, " +
E.checkState(idParts.length == 5 || idParts.length == 6,
"The edge id must be formatted by 5~6 parts, " +
"actual is %s", idParts.length);
this.name = idParts[2];
this.name = idParts[idParts.length - 2];
}
return this.name;
}
Expand Down
Loading
Loading