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

Let drop column family mutual exclusion with other operations #1202

Merged
merged 3 commits into from
Oct 30, 2020

Conversation

Linary
Copy link
Contributor

@Linary Linary commented Sep 30, 2020

  • use ReadWriteLock

Change-Id: Id68401b568d7de8910026fcf420947d42bf23802

* use ReadWriteLock

Change-Id: Id68401b568d7de8910026fcf420947d42bf23802
@codecov
Copy link

codecov bot commented Sep 30, 2020

Codecov Report

Merging #1202 into master will increase coverage by 35.04%.
The diff coverage is 50.74%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master    #1202       +/-   ##
=============================================
+ Coverage     29.65%   64.70%   +35.04%     
- Complexity      263     5758     +5495     
=============================================
  Files            75      366      +291     
  Lines          4208    30166    +25958     
  Branches        510     4276     +3766     
=============================================
+ Hits           1248    19518    +18270     
- Misses         2797     8668     +5871     
- Partials        163     1980     +1817     
Impacted Files Coverage Δ Complexity Δ
...du/hugegraph/backend/store/BackendSessionPool.java 76.38% <ø> (ø) 17.00 <0.00> (?)
...raph/backend/store/rocksdb/RocksDBStdSessions.java 65.55% <12.00%> (ø) 35.00 <0.00> (?)
.../hugegraph/backend/store/rocksdb/RocksDBStore.java 65.98% <59.63%> (ø) 60.00 <14.00> (?)
...com/baidu/hugegraph/serializer/JsonSerializer.java 41.93% <0.00%> (-3.42%) 0.00% <0.00%> (-19.00%)
...n/java/com/baidu/hugegraph/version/ApiVersion.java 75.00% <0.00%> (ø) 0.00% <0.00%> (-2.00%)
...ava/com/baidu/hugegraph/serializer/Serializer.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...va/com/baidu/hugegraph/api/traversers/KoutAPI.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...a/com/baidu/hugegraph/api/traversers/PathsAPI.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...m/baidu/hugegraph/api/traversers/KneighborAPI.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...aidu/hugegraph/api/traversers/ShortestPathAPI.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
... and 297 more

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 58045ba...ae54519. Read the comment docs.

@@ -247,6 +251,36 @@ public synchronized void dropTable(String... tables)
}
}

public void reload() throws RocksDBException {
Copy link
Contributor

Choose a reason for hiding this comment

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

unneeded to reload rocksdb if not operate batch after CF is dropped.
but we can keep these code for future use (don't --amend)

Change-Id: I823030bc9ab23ac5612f74bddd9f9dff40e4a5cf
Change-Id: I32a896790b9a28e2fac90cdddd258ef306cd296a
@@ -87,6 +88,7 @@ public RocksDBStdSessions(HugeConfig config, String database, String store,
String dataPath, String walPath)
throws RocksDBException {
super(config, database, store);
this.config = config;
Copy link
Contributor

Choose a reason for hiding this comment

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

Config can be removed by making config protected in super class.

@@ -112,6 +114,7 @@ public RocksDBStdSessions(HugeConfig config, String database, String store,
String dataPath, String walPath,
List<String> cfNames) throws RocksDBException {
super(config, database, store);
Copy link
Contributor

Choose a reason for hiding this comment

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

using constructor chain by this(...) can reduce some duplicate codes.

@Linary Linary merged commit 3442e71 into master Oct 30, 2020
@Linary Linary deleted the fix-drop-cf branch October 30, 2020 09:12
tmljob pushed a commit to tmljob/hugegraph that referenced this pull request Dec 10, 2020
…#1202)

* use ReadWriteLock
* don't reload rocksdb

Change-Id: I32a896790b9a28e2fac90cdddd258ef306cd296a
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.

None yet

4 participants