Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ private Map<String, TableMetadata> createTableMetadataMap(
throws IOException, TableMetadataException {
File configFile = new File(configFilePath);
StorageFactory storageFactory = StorageFactory.create(configFile);
try (DistributedStorageAdmin storageAdmin = storageFactory.getStorageAdmin()) {
DistributedStorageAdmin storageAdmin = null;
Copy link
Collaborator

@brfrn169 brfrn169 May 28, 2025

Choose a reason for hiding this comment

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

@inv-jishnu Sorry, why do we need this change only for the 3.12 branch?

Copy link
Contributor

Choose a reason for hiding this comment

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

@brfrn169 san,

As I mentioned above there was a CI failure

> Task :data-loader:cli:compileJava FAILED
/home/runner/work/scalardb/scalardb/data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/command/dataimport/ImportCommand.java:99: error: incompatible types: try-with-resources not applicable to variable type
    try (DistributedStorageAdmin storageAdmin = storageFactory.getStorageAdmin()) {
                                 ^
    (DistributedStorageAdmin cannot be converted to AutoCloseable)
Note: /home/runner/work/scalardb/scalardb/data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/command/dataexport/ScanOrderingConverter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

I thought there may have been an update in DistributedStorageAdmin implementation. This only happened in 3.12 branch. Hence I changed the implementation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yes. Thanks!

try {
storageAdmin = storageFactory.getStorageAdmin();
TableMetadataService tableMetadataService = new TableMetadataService(storageAdmin);
Map<String, TableMetadata> tableMetadataMap = new HashMap<>();
if (controlFile != null) {
Expand All @@ -111,6 +113,10 @@ private Map<String, TableMetadata> createTableMetadataMap(
tableMetadataService.getTableMetadata(namespace, tableName));
}
return tableMetadataMap;
} finally {
if (storageAdmin != null) {
storageAdmin.close();
}
}
}

Expand Down