Skip to content

Commit c89e831

Browse files
committed
Use new interface in tests
1 parent 67ab108 commit c89e831

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/BasePolarisCatalogTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,23 +1541,24 @@ public void testFileIOWrapper() {
15411541
.isGreaterThan(0);
15421542

15431543
Assertions.assertThat(catalog.dropTable(TABLE)).as("Table deletion should succeed").isTrue();
1544+
TaskEntity taskEntity =
1545+
TaskEntity.of(
1546+
metaStoreManager
1547+
.loadTasks(metaStoreSession, "testExecutor", 1)
1548+
.getEntities()
1549+
.getFirst());
1550+
Map<String, String> properties = taskEntity.getInternalPropertiesAsMap();
1551+
properties.put(CatalogProperties.FILE_IO_IMPL, "org.apache.iceberg.inmemory.InMemoryFileIO");
1552+
taskEntity.setInternalPropertiesAsMap(properties);
15441553
TableCleanupTaskHandler handler =
15451554
new TableCleanupTaskHandler(
15461555
Mockito.mock(),
15471556
createMockMetaStoreManagerFactory(),
15481557
configurationStore,
15491558
diagServices,
1550-
(task, rc) ->
1551-
measured.loadFileIO(
1552-
realmId, "org.apache.iceberg.inmemory.InMemoryFileIO", Map.of()),
1559+
new TaskFileIOSupplier(measured),
15531560
clock);
1554-
handler.handleTask(
1555-
TaskEntity.of(
1556-
metaStoreManager
1557-
.loadTasks(metaStoreSession, "testExecutor", 1)
1558-
.getEntities()
1559-
.getFirst()),
1560-
realmId);
1561+
handler.handleTask(taskEntity, realmId);
15611562
Assertions.assertThat(measured.getNumDeletedFiles()).as("A table was deleted").isGreaterThan(0);
15621563
}
15631564
}

service/common/src/main/java/org/apache/polaris/service/catalog/io/FileIOFactory.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,7 @@
3535
*/
3636
public interface FileIOFactory {
3737

38-
/**
39-
* Loads a FileIO implementation for the specified realm and class name with the provided
40-
* properties.
41-
*
42-
* <p>This method is commonly used by TaskFileIOSupplier and Tests to instantiate a FileIO object
43-
* based on the provided configuration. Usually, the properties will contain the full info to
44-
* instantiate a FileIO.
45-
*
46-
* @param realmId the identifier of the realm for which the FileIO is being loaded.
47-
* @param ioImplClassName the fully qualified class name of the FileIO implementation to load.
48-
* @param properties a map of configuration properties to initialize the FileIO implementation.
49-
* @return an instance of the FileIO implementation configured with the specified properties.
50-
*/
38+
/** This method is intended for use in tests only. */
5139
FileIO loadFileIO(
5240
@Nonnull RealmId realmId,
5341
@Nonnull String ioImplClassName,

0 commit comments

Comments
 (0)