Skip to content

Commit

Permalink
Core: Expose properties in InMemoryCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Sep 2, 2024
1 parent 5864850 commit ae820ff
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.iceberg.inmemory;

import static java.util.Objects.requireNonNull;

import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -68,6 +70,7 @@ public class InMemoryCatalog extends BaseMetastoreViewCatalog
private final ConcurrentMap<TableIdentifier, String> views;
private FileIO io;
private String catalogName;
private Map<String, String> properties;
private String warehouseLocation;
private CloseableGroup closeableGroup;

Expand All @@ -85,6 +88,7 @@ public String name() {
@Override
public void initialize(String name, Map<String, String> properties) {
this.catalogName = name != null ? name : InMemoryCatalog.class.getSimpleName();
this.properties = ImmutableMap.copyOf(properties);

String warehouse = properties.getOrDefault(CatalogProperties.WAREHOUSE_LOCATION, "");
this.warehouseLocation = warehouse.replaceAll("/*$", "");
Expand All @@ -94,6 +98,12 @@ public void initialize(String name, Map<String, String> properties) {
closeableGroup.setSuppressCloseFailure(true);
}

@Override
protected Map<String, String> properties() {
requireNonNull(properties, "properties");
return properties;
}

@Override
protected TableOperations newTableOps(TableIdentifier tableIdentifier) {
return new InMemoryTableOperations(io, tableIdentifier);
Expand Down

0 comments on commit ae820ff

Please sign in to comment.