-
Notifications
You must be signed in to change notification settings - Fork 504
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
open rocksdb graph store using multi-threads when multi disks #721
Conversation
Codecov Report
@@ Coverage Diff @@
## master #721 +/- ##
============================================
- Coverage 71.41% 70.22% -1.19%
+ Complexity 4328 4298 -30
============================================
Files 280 281 +1
Lines 20593 20737 +144
Branches 2893 2922 +29
============================================
- Hits 14706 14563 -143
- Misses 4444 4729 +285
- Partials 1443 1445 +2
Continue to review full report at Codecov.
|
9e3f63f
to
276fd3d
Compare
Change-Id: I83525ff97942c49c80f3767ed19d891617ae54f9
276fd3d
to
9f69d9d
Compare
@@ -273,6 +300,22 @@ public void close() { | |||
|
|||
this.checkOpened(); | |||
this.sessions.close(); | |||
|
|||
boolean terminated; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean terminated = false
better
Change-Id: Ib25b9138aed71e3b4e60e1ab9927c8813cf58f1d
@@ -69,6 +74,11 @@ | |||
private RocksDBSessions sessions; | |||
private final Map<HugeType, String> tableDiskMapping; | |||
|
|||
private static final String DB_OPEN = "db-open-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"db-open-%s"
})); | ||
} | ||
} | ||
for (Future<?> f : futures) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future<?> future
@@ -273,6 +300,22 @@ public void close() { | |||
|
|||
this.checkOpened(); | |||
this.sessions.close(); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensure sessions for all threads are closed
try { | ||
f.get(); | ||
} catch (Throwable e) { | ||
throw new BackendException("Failed to open RocksDB store", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems can destroy thread pool after open
} catch (Throwable e) { | ||
throw new BackendException("Failed to open RocksDB store", e); | ||
} | ||
} | ||
this.shutdownOpenPool(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should create pool before submit for every open()
public static final ConfigOption<Boolean> SKIP_STATS_UPDATE_ON_DB_OPEN = | ||
new ConfigOption<>( | ||
"rocksdb.skip_stats_update_on_db_open", | ||
"This flag allows us to not update statistics.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether to skip statistics update when opening the database,
setting this flag true allows us to not update statistics.
@@ -151,20 +159,59 @@ public synchronized void open(HugeConfig config) { | |||
return; | |||
} | |||
|
|||
List<Future<?>> futures = new ArrayList<>(); | |||
ExecutorService openPool = ExecutorUtil.newFixedThreadPool(8, DB_OPEN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can also use MAX_FILE_OPENING_THREADS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this thread pool is used to open DBs, not RocksDB sst files.
Change-Id: I83525ff97942c49c80f3767ed19d891617ae54f9