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

adapt for dynamically add/remove graph (#3) #138

Merged
merged 6 commits into from
Dec 27, 2021
Merged

Conversation

zhoney
Copy link
Contributor

@zhoney zhoney commented Dec 24, 2021

Change-Id: I005fba5a131f55820dbd1d702eb5ef812acd132f

zhoney and others added 2 commits December 24, 2021 13:08
Change-Id: I005fba5a131f55820dbd1d702eb5ef812acd132f
Change-Id: I88b3293e68f1ce90f78cddb987251ba639205642
// NOTE: Must provide id for PUT. If use "graph/mode", "/" will
// be encoded to "%2F". So use "mode" here although inaccurate.
this.client.put(path, "mode", mode);
this.client.put(joinPath(this.path(), graph), MODE, mode);
Copy link
Contributor

Choose a reason for hiding this comment

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

can add joinPath(path, graph, action) method: joinPath(this.path(), graph, MODE),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PUT method must have id, MODE is id, should not treated as path

src/test/resources/hugegraph2.properties Outdated Show resolved Hide resolved
src/test/resources/hugegraph3.properties Outdated Show resolved Hide resolved
src/test/resources/hugegraph3.properties Outdated Show resolved Hide resolved
params = ImmutableMap.of("clone_graph_name", cloneGraphName);
}
RestResult result = this.client.post(joinPath(this.path(), name),
config, headers, params);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's behavior if config=null (means just clone without special config)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will occur exception because same store or rocksdb data path

@javeme
Copy link
Contributor

javeme commented Dec 24, 2021

ci error:

Started 1h 36m 7s ago
Can't find any online and idle self-hosted runner in the current repository, account/organization that matches the required labels: 'ubuntu-16.04'
Waiting for a self-hosted runner to pickup this job...

Change-Id: I17db2cfec78cb76af404db9c2bc84bfa5faa292c
backend=rocksdb
serializer=binary

store=hugegraph3
Copy link
Contributor

Choose a reason for hiding this comment

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

can only keep required options in this file:

store=hugegraph3
rocksdb.data_path=./hg3
rocksdb.wal_path=./hg3

Change-Id: I31783a4a2bcf1ddb028601caff74e22bf69ea134
@javeme
Copy link
Contributor

javeme commented Dec 24, 2021

HTTPS_SERVER_DIR="hugegraph_https"
mkdir ${HTTPS_SERVER_DIR}
cp -r hugegraph-*/. ${HTTPS_SERVER_DIR}
cd "$(find hugegraph-* | head -1)"
cp ../$TRAVIS_DIR/conf/* conf
cp: -r not specified; omitting directory '../assembly/travis/conf/graphs'
hugegraph-0.12.0/lib/high-scale-lib-1.0.6.jar
hugegraph-0.12.0/lib/gson-2.8.6.jar

@javeme javeme force-pushed the dynamic-add-graph branch 3 times, most recently from 34ca5d4 to 713dfe7 Compare December 24, 2021 17:45
@javeme
Copy link
Contributor

javeme commented Dec 24, 2021

HTTP_SERVER_DIR=$(find hugegraph-* | head -1)
hugegraph-0.12.0/conf/rest-server.properties
hugegraph-0.12.0/conf/hugegraph-community.license
hugegraph-0.12.0/conf/remote-objects.yaml
hugegraph-0.12.0/conf/gremlin-server.yaml
hugegraph-0.12.0/conf/remote.yaml
hugegraph-0.12.0/conf/log4j2.xml
hugegraph-0.12.0/conf/hugegraph-server.keystore
hugegraph-0.12.0/conf/computer.yaml
find: ‘standard output’: Broken pipe
find: write error
HTTPS_SERVER_DIR="hugegraph_https"

mkdir "${HTTPS_SERVER_DIR}"
cp -r "${HTTP_SERVER_DIR}"/. "${HTTPS_SERVER_DIR}"

cd "${HTTP_SERVER_DIR}"
cp -r ../"${TRAVIS_DIR}"/conf/. conf

# start HugeGraphServer with http protocol
echo -e "pa" | bin/init-store.sh || exit 1
Initializing HugeGraph Store...
2021-12-24 17:42:13 [main] [INFO] c.b.h.u.ConfigUtil - Scaning graphs configuration directory assembly/travis/conf/graphs
Error: Exception in thread "main" java.lang.IllegalArgumentException: Please ensure the graphs config directory 'assembly/travis/conf/graphs' exist and indeed a directory
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)
	at com.baidu.hugegraph.util.E.checkArgument(E.java:56)
	at com.baidu.hugegraph.util.ConfigUtil.scanGraphsDir(ConfigUtil.java:72)
	at com.baidu.hugegraph.cmd.InitStore.main(InitStore.java:76)
Initialization finished.
bin/start-hugegraph.sh || exit 1
Starting HugeGraphServer...
Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)..Starting HugeGraphServer failed
See /home/runner/work/hugegraph-client/hugegraph-client/hugegraph-0.12.0/logs/hugegraph-server.log for HugeGraphServer log output.
Error: Process completed with exit code 1.

@javeme javeme force-pushed the dynamic-add-graph branch 5 times, most recently from fb5953c to f8c0ac5 Compare December 24, 2021 19:08
@javeme
Copy link
Contributor

javeme commented Dec 24, 2021

Tests run: 418, Failures: 1, Errors: 84, Skipped: 0, Time elapsed: 256.898 sec <<< FAILURE!
testCreateAndDropGraph(com.baidu.hugegraph.api.GraphsApiTest)  Time elapsed: 0.189 sec  <<< ERROR!
class com.baidu.hugegraph.HugeException: Failed to update/query server info: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Missing authentication context when verifying resource permission
	at com.baidu.hugegraph.exception.ServerException.fromResponse(ServerException.java:47)
	at com.baidu.hugegraph.client.RestClient.checkStatus(RestClient.java:93)
	at com.baidu.hugegraph.rest.AbstractRestClient.post(AbstractRestClient.java:231)
	at com.baidu.hugegraph.api.graphs.GraphsAPI.create(GraphsAPI.java:68)
	at com.baidu.hugegraph.api.GraphsApiTest.testCreateAndDropGraph(GraphsApiTest.java:63)

@javeme javeme force-pushed the dynamic-add-graph branch 6 times, most recently from 39139ad to 4792d80 Compare December 25, 2021 11:06
@javeme
Copy link
Contributor

javeme commented Dec 26, 2021

Tests in error: 
  testCloneAndDropGraph(com.baidu.hugegraph.api.GraphsApiTest): Not support Graph.configuration()
  testCreateAndDropGraph(com.baidu.hugegraph.api.GraphsApiTest): Not support Graph.configuration()

Tests run: 373, Failures: 0, Errors: 2, Skipped: 0

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
Copy link
Member

Choose a reason for hiding this comment

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

also update client version to 2.0.1

@codecov
Copy link

codecov bot commented Dec 27, 2021

Codecov Report

Merging #138 (6c87219) into master (ba79813) will increase coverage by 0.14%.
The diff coverage is 68.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #138      +/-   ##
============================================
+ Coverage     77.18%   77.33%   +0.14%     
- Complexity      947      956       +9     
============================================
  Files           154      154              
  Lines          4042     4064      +22     
  Branches        241      242       +1     
============================================
+ Hits           3120     3143      +23     
+ Misses          743      742       -1     
  Partials        179      179              
Impacted Files Coverage Δ
...java/com/baidu/hugegraph/driver/GraphsManager.java 16.66% <0.00%> (-6.42%) ⬇️
...in/java/com/baidu/hugegraph/driver/HugeClient.java 78.78% <63.63%> (-0.53%) ⬇️
...java/com/baidu/hugegraph/api/graphs/GraphsAPI.java 68.08% <91.30%> (+25.97%) ⬆️
.../com/baidu/hugegraph/structure/gremlin/Result.java 43.75% <0.00%> (+6.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba79813...6c87219. Read the comment docs.

Change-Id: Id14191f3c02ad85de67c6ba66535ce5a4b167543
@javeme javeme merged commit 6a05f0f into master Dec 27, 2021
@javeme javeme deleted the dynamic-add-graph branch December 27, 2021 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants