vldpyatkov commented on a change in pull request #112:
URL: https://github.com/apache/ignite-3/pull/112#discussion_r623970009
##########
File path:
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -275,21 +327,40 @@ private void unsubscribeForTableCreation() {
// change.initPartitions(1_000);
// });
- //TODO: IGNITE-14646 Support asynchronous table creation
- Table tbl = null;
+ return tblFut.join();
+ }
- while (tbl == null) {
- try {
- Thread.sleep(50);
+ /** {@inheritDoc} */
+ @Override public void dropTable(String name) {
+ CompletableFuture<Void> dropTblFut = new CompletableFuture<>();
- tbl = table(name);
- }
- catch (InterruptedException e) {
- LOG.error("Waiting of creation of table was interrupted.", e);
+ listen(TableEvent.DROP, new BiPredicate<List<Object>, Exception>() {
+ @Override public boolean test(List<Object> params, Exception e) {
+ String tableName = (String)params.get(0);
+
+ if (!name.equals(tableName))
+ return false;
+
+ if (e == null) {
+ Table drppedTable = tables.remove(tableName);
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]