diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java index 01e1b161ed4c7..2cd257e2b8a0f 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java @@ -195,9 +195,9 @@ protected final Table getIcebergTable(ConnectorSession session, SchemaTableName protected abstract boolean tableExists(ConnectorSession session, SchemaTableName schemaTableName); - protected abstract void registerTable(ConnectorSession clientSession, SchemaTableName schemaTableName, Path metadataLocation); + public abstract void registerTable(ConnectorSession clientSession, SchemaTableName schemaTableName, Path metadataLocation); - protected abstract void unregisterTable(ConnectorSession clientSession, SchemaTableName schemaTableName); + public abstract void unregisterTable(ConnectorSession clientSession, SchemaTableName schemaTableName); /** * This class implements the default implementation for getTableLayoutForConstraint which will be used in the case of a Java Worker diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergCommonModule.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergCommonModule.java index a67324d22fdc9..8c7cd0545c145 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergCommonModule.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergCommonModule.java @@ -39,6 +39,9 @@ import com.facebook.presto.hive.gcs.HiveGcsConfigurationInitializer; import com.facebook.presto.iceberg.nessie.NessieConfig; import com.facebook.presto.iceberg.optimizer.IcebergPlanOptimizerProvider; +import com.facebook.presto.iceberg.procedure.RegisterTableProcedure; +import com.facebook.presto.iceberg.procedure.RollbackToSnapshotProcedure; +import com.facebook.presto.iceberg.procedure.UnregisterTableProcedure; import com.facebook.presto.orc.CachingStripeMetadataSource; import com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory; import com.facebook.presto.orc.EncryptionLibrary; diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/RegisterTableProcedure.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java similarity index 98% rename from presto-iceberg/src/main/java/com/facebook/presto/iceberg/RegisterTableProcedure.java rename to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java index 2a1338a900245..8dbb02c3cfe1e 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/RegisterTableProcedure.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java @@ -11,10 +11,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.iceberg; +package com.facebook.presto.iceberg.procedure; import com.facebook.presto.hive.HdfsContext; import com.facebook.presto.hive.HdfsEnvironment; +import com.facebook.presto.iceberg.IcebergAbstractMetadata; +import com.facebook.presto.iceberg.IcebergMetadataFactory; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.PrestoException; import com.facebook.presto.spi.PrestoWarning; diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/RollbackToSnapshotProcedure.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RollbackToSnapshotProcedure.java similarity index 96% rename from presto-iceberg/src/main/java/com/facebook/presto/iceberg/RollbackToSnapshotProcedure.java rename to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RollbackToSnapshotProcedure.java index 8f35fddd8e204..6ae05746f0b6e 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/RollbackToSnapshotProcedure.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RollbackToSnapshotProcedure.java @@ -11,8 +11,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.iceberg; +package com.facebook.presto.iceberg.procedure; +import com.facebook.presto.iceberg.IcebergMetadataFactory; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.SchemaTableName; import com.facebook.presto.spi.connector.ConnectorMetadata; diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/SetTablePropertyProcedure.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/SetTablePropertyProcedure.java similarity index 92% rename from presto-iceberg/src/main/java/com/facebook/presto/iceberg/SetTablePropertyProcedure.java rename to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/SetTablePropertyProcedure.java index 48bc737f28e39..4c4c5ca91d58d 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/SetTablePropertyProcedure.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/SetTablePropertyProcedure.java @@ -11,10 +11,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.iceberg; +package com.facebook.presto.iceberg.procedure; import com.facebook.airlift.log.Logger; import com.facebook.presto.hive.HdfsEnvironment; +import com.facebook.presto.iceberg.IcebergConfig; +import com.facebook.presto.iceberg.IcebergMetadataFactory; +import com.facebook.presto.iceberg.IcebergResourceFactory; +import com.facebook.presto.iceberg.IcebergTableName; +import com.facebook.presto.iceberg.IcebergUtil; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.SchemaTableName; import com.facebook.presto.spi.connector.ConnectorMetadata; diff --git a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/UnregisterTableProcedure.java b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java similarity index 94% rename from presto-iceberg/src/main/java/com/facebook/presto/iceberg/UnregisterTableProcedure.java rename to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java index eb47f2b8c46b0..aca53fed6bdba 100644 --- a/presto-iceberg/src/main/java/com/facebook/presto/iceberg/UnregisterTableProcedure.java +++ b/presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java @@ -11,8 +11,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.iceberg; +package com.facebook.presto.iceberg.procedure; +import com.facebook.presto.iceberg.IcebergAbstractMetadata; +import com.facebook.presto.iceberg.IcebergMetadataFactory; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.SchemaNotFoundException; import com.facebook.presto.spi.SchemaTableName; diff --git a/presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java b/presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java index db2a1582aaf8f..3379ad1d7b17b 100644 --- a/presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java +++ b/presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java @@ -42,8 +42,8 @@ import static com.facebook.presto.iceberg.IcebergQueryRunner.TEST_CATALOG_DIRECTORY; import static com.facebook.presto.iceberg.IcebergQueryRunner.TEST_DATA_DIRECTORY; import static com.facebook.presto.iceberg.IcebergUtil.MIN_FORMAT_VERSION_FOR_DELETE; -import static com.facebook.presto.iceberg.RegisterTableProcedure.METADATA_FOLDER_NAME; -import static com.facebook.presto.iceberg.TestIcebergRegisterProcedure.getMetadataFileLocation; +import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.METADATA_FOLDER_NAME; +import static com.facebook.presto.iceberg.procedure.TestIcebergRegisterProcedure.getMetadataFileLocation; import static com.facebook.presto.testing.MaterializedResult.resultBuilder; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.Iterables.getOnlyElement; diff --git a/presto-iceberg/src/test/java/com/facebook/presto/iceberg/TestIcebergRegisterProcedure.java b/presto-iceberg/src/test/java/com/facebook/presto/iceberg/procedure/TestIcebergRegisterProcedure.java similarity index 97% rename from presto-iceberg/src/test/java/com/facebook/presto/iceberg/TestIcebergRegisterProcedure.java rename to presto-iceberg/src/test/java/com/facebook/presto/iceberg/procedure/TestIcebergRegisterProcedure.java index 5fd0babd5cf3e..19ab9b8fe64c9 100644 --- a/presto-iceberg/src/test/java/com/facebook/presto/iceberg/TestIcebergRegisterProcedure.java +++ b/presto-iceberg/src/test/java/com/facebook/presto/iceberg/procedure/TestIcebergRegisterProcedure.java @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.iceberg; +package com.facebook.presto.iceberg.procedure; import com.facebook.presto.Session; import com.facebook.presto.hive.HdfsConfiguration; @@ -25,6 +25,8 @@ import com.facebook.presto.hive.metastore.ExtendedHiveMetastore; import com.facebook.presto.hive.metastore.MetastoreContext; import com.facebook.presto.hive.metastore.file.FileHiveMetastore; +import com.facebook.presto.iceberg.IcebergConfig; +import com.facebook.presto.iceberg.IcebergPlugin; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.SchemaTableName; import com.facebook.presto.testing.QueryRunner; @@ -45,10 +47,10 @@ import static com.facebook.presto.hive.metastore.InMemoryCachingHiveMetastore.memoizeMetastore; import static com.facebook.presto.hive.metastore.MetastoreUtil.getMetastoreHeaders; import static com.facebook.presto.hive.metastore.MetastoreUtil.isUserDefinedTypeEncodingEnabled; -import static com.facebook.presto.iceberg.RegisterTableProcedure.METADATA_FOLDER_NAME; -import static com.facebook.presto.iceberg.RegisterTableProcedure.getFileSystem; -import static com.facebook.presto.iceberg.RegisterTableProcedure.parseMetadataVersionFromFileName; -import static com.facebook.presto.iceberg.RegisterTableProcedure.resolveLatestMetadataLocation; +import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.METADATA_FOLDER_NAME; +import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.getFileSystem; +import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.parseMetadataVersionFromFileName; +import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.resolveLatestMetadataLocation; import static com.facebook.presto.testing.TestingSession.testSessionBuilder; import static java.lang.String.format; import static org.apache.iceberg.util.LocationUtil.stripTrailingSlash;