use of org.apache.iceberg.io.CloseableGroup in project iceberg by apache.
the class DynamoDbCatalog method initialize.
@VisibleForTesting
void initialize(String name, String path, AwsProperties properties, DynamoDbClient client, FileIO io) {
this.catalogName = name;
this.awsProperties = properties;
this.warehousePath = cleanWarehousePath(path);
this.dynamo = client;
this.fileIO = io;
this.closeableGroup = new CloseableGroup();
closeableGroup.addCloseable(dynamo);
closeableGroup.addCloseable(fileIO);
closeableGroup.setSuppressCloseFailure(true);
ensureCatalogTableExistsOrCreate();
}
use of org.apache.iceberg.io.CloseableGroup in project iceberg by apache.
the class GlueCatalog method initialize.
@VisibleForTesting
void initialize(String name, String path, AwsProperties properties, GlueClient client, LockManager lock, FileIO io) {
this.catalogName = name;
this.awsProperties = properties;
this.warehousePath = cleanWarehousePath(path);
this.glue = client;
this.lockManager = lock;
this.fileIO = io;
this.closeableGroup = new CloseableGroup();
closeableGroup.addCloseable(glue);
closeableGroup.addCloseable(lockManager);
closeableGroup.addCloseable(fileIO);
closeableGroup.setSuppressCloseFailure(true);
}
use of org.apache.iceberg.io.CloseableGroup in project iceberg by apache.
the class HadoopCatalog method initialize.
@Override
public void initialize(String name, Map<String, String> properties) {
String inputWarehouseLocation = properties.get(CatalogProperties.WAREHOUSE_LOCATION);
Preconditions.checkArgument(inputWarehouseLocation != null && !inputWarehouseLocation.equals(""), "Cannot instantiate hadoop catalog. No location provided for warehouse (Set warehouse config)");
this.catalogName = name;
this.warehouseLocation = inputWarehouseLocation.replaceAll("/*$", "");
this.fs = Util.getFs(new Path(warehouseLocation), conf);
String fileIOImpl = properties.get(CatalogProperties.FILE_IO_IMPL);
this.fileIO = fileIOImpl == null ? new HadoopFileIO(conf) : CatalogUtil.loadFileIO(fileIOImpl, properties, conf);
this.lockManager = LockManagers.from(properties);
this.closeableGroup = new CloseableGroup();
closeableGroup.addCloseable(lockManager);
closeableGroup.setSuppressCloseFailure(true);
this.suppressPermissionError = Boolean.parseBoolean(properties.get(HADOOP_SUPPRESS_PERMISSION_ERROR));
}
Aggregations