Skip to content

Commit

Permalink
[IGNITE-19082] Catalog. Cleanup dead code
Browse files Browse the repository at this point in the history
await catalog activation.
  • Loading branch information
lowka committed Apr 30, 2024
1 parent 9b7d653 commit e332285
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ public CompletableFuture<Void> startAsync() {
.handle((r, e) -> catalogInitializationFuture.complete(null));

return initCatalog(emptyCatalog);
} else {
catalogInitializationFuture.complete(null);
return nullCompletedFuture();
}

return nullCompletedFuture();
});
}

Expand Down Expand Up @@ -316,6 +317,11 @@ public CompletableFuture<Void> catalogReadyFuture(int version) {
return versionTracker.waitFor(version);
}

@Override
public CompletableFuture<Void> catalogInitializationFuture() {
return catalogInitializationFuture;
}

@Override
public @Nullable Catalog catalog(int catalogVersion) {
return catalogByVer.get(catalogVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,6 @@ public interface CatalogService extends EventProducer<CatalogEvent, CatalogEvent
* @param version Catalog version to wait for.
*/
CompletableFuture<Void> catalogReadyFuture(int version);

CompletableFuture<Void> catalogInitializationFuture();
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public CompletableFuture<IgniteImpl> startNodeAsync(int nodeIndex, String nodeBo

return TestIgnitionManager.start(nodeName, config, workDir.resolve(nodeName))
.thenApply(IgniteImpl.class::cast)
.thenCompose(ignite -> ignite.catalogManager().catalogInitializationFuture().thenApply(x -> ignite))
.thenApply(ignite -> {
synchronized (nodes) {
while (nodes.size() < nodeIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ private CompletableFuture<QueryMetadata> prepareSingleAsync0(

HybridTimestamp timestamp = explicitTransaction != null ? explicitTransaction.startTimestamp() : clockService.now();

System.err.println("sqlSchemaActivationTimestamp: " + timestamp);

return prepareParsedStatement(schemaName, result, timestamp, queryCancel, params)
.thenApply(plan -> new QueryMetadata(plan.metadata(), plan.parameterMetadata()));
});
Expand Down Expand Up @@ -675,10 +673,10 @@ private CompletableFuture<SchemaPlus> waitForActualSchema(String schemaName, Hyb
return schemaSyncService.waitForMetadataCompleteness(timestamp).thenApply(unused -> {
SchemaPlus schema = sqlSchemaManager.schema(timestamp.longValue()).getSubSchema(schemaName);

System.err.println("sqlSchemaActivationTimestamp: " + timestamp);
System.err.println("sqlSchemaCurrentTimestamp: " + clockService.now());

if (schema == null) {
System.err.println("sqlSchemaCurrentTimestamp: " + clockService.now());
System.err.println("sqlSchemaActivationTimestamp: " + timestamp);

throw new SchemaNotFoundException(schemaName);
}

Expand Down

0 comments on commit e332285

Please sign in to comment.