Skip to content

Commit 9135371

Browse files
committed
Move iceberg procedures and tests to package ...iceberg.procedure
1 parent ea6375e commit 9135371

File tree

8 files changed

+28
-13
lines changed

8 files changed

+28
-13
lines changed

presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ protected final Table getIcebergTable(ConnectorSession session, SchemaTableName
194194

195195
protected abstract boolean tableExists(ConnectorSession session, SchemaTableName schemaTableName);
196196

197-
protected abstract void registerTable(ConnectorSession clientSession, SchemaTableName schemaTableName, Path metadataLocation);
197+
public abstract void registerTable(ConnectorSession clientSession, SchemaTableName schemaTableName, Path metadataLocation);
198198

199-
protected abstract void unregisterTable(ConnectorSession clientSession, SchemaTableName schemaTableName);
199+
public abstract void unregisterTable(ConnectorSession clientSession, SchemaTableName schemaTableName);
200200

201201
/**
202202
* This class implements the default implementation for getTableLayoutForConstraint which will be used in the case of a Java Worker

presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergCommonModule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
import com.facebook.presto.hive.gcs.HiveGcsConfigurationInitializer;
4040
import com.facebook.presto.iceberg.nessie.NessieConfig;
4141
import com.facebook.presto.iceberg.optimizer.IcebergPlanOptimizerProvider;
42+
import com.facebook.presto.iceberg.procedure.RegisterTableProcedure;
43+
import com.facebook.presto.iceberg.procedure.RollbackToSnapshotProcedure;
44+
import com.facebook.presto.iceberg.procedure.UnregisterTableProcedure;
4245
import com.facebook.presto.orc.CachingStripeMetadataSource;
4346
import com.facebook.presto.orc.DwrfAwareStripeMetadataSourceFactory;
4447
import com.facebook.presto.orc.EncryptionLibrary;

presto-iceberg/src/main/java/com/facebook/presto/iceberg/RegisterTableProcedure.java renamed to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package com.facebook.presto.iceberg;
14+
package com.facebook.presto.iceberg.procedure;
1515

1616
import com.facebook.presto.hive.HdfsContext;
1717
import com.facebook.presto.hive.HdfsEnvironment;
18+
import com.facebook.presto.iceberg.IcebergAbstractMetadata;
19+
import com.facebook.presto.iceberg.IcebergMetadataFactory;
1820
import com.facebook.presto.spi.ConnectorSession;
1921
import com.facebook.presto.spi.PrestoException;
2022
import com.facebook.presto.spi.PrestoWarning;

presto-iceberg/src/main/java/com/facebook/presto/iceberg/RollbackToSnapshotProcedure.java renamed to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RollbackToSnapshotProcedure.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package com.facebook.presto.iceberg;
14+
package com.facebook.presto.iceberg.procedure;
1515

16+
import com.facebook.presto.iceberg.IcebergMetadataFactory;
1617
import com.facebook.presto.spi.ConnectorSession;
1718
import com.facebook.presto.spi.SchemaTableName;
1819
import com.facebook.presto.spi.connector.ConnectorMetadata;

presto-iceberg/src/main/java/com/facebook/presto/iceberg/SetTablePropertyProcedure.java renamed to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/SetTablePropertyProcedure.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package com.facebook.presto.iceberg;
14+
package com.facebook.presto.iceberg.procedure;
1515

1616
import com.facebook.airlift.log.Logger;
1717
import com.facebook.presto.hive.HdfsEnvironment;
18+
import com.facebook.presto.iceberg.IcebergConfig;
19+
import com.facebook.presto.iceberg.IcebergMetadataFactory;
20+
import com.facebook.presto.iceberg.IcebergResourceFactory;
21+
import com.facebook.presto.iceberg.IcebergTableName;
22+
import com.facebook.presto.iceberg.IcebergUtil;
1823
import com.facebook.presto.spi.ConnectorSession;
1924
import com.facebook.presto.spi.SchemaTableName;
2025
import com.facebook.presto.spi.connector.ConnectorMetadata;

presto-iceberg/src/main/java/com/facebook/presto/iceberg/UnregisterTableProcedure.java renamed to presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/UnregisterTableProcedure.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package com.facebook.presto.iceberg;
14+
package com.facebook.presto.iceberg.procedure;
1515

16+
import com.facebook.presto.iceberg.IcebergAbstractMetadata;
17+
import com.facebook.presto.iceberg.IcebergMetadataFactory;
1618
import com.facebook.presto.spi.ConnectorSession;
1719
import com.facebook.presto.spi.SchemaNotFoundException;
1820
import com.facebook.presto.spi.SchemaTableName;

presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
import static com.facebook.presto.iceberg.IcebergQueryRunner.TEST_CATALOG_DIRECTORY;
4343
import static com.facebook.presto.iceberg.IcebergQueryRunner.TEST_DATA_DIRECTORY;
4444
import static com.facebook.presto.iceberg.IcebergUtil.MIN_FORMAT_VERSION_FOR_DELETE;
45-
import static com.facebook.presto.iceberg.RegisterTableProcedure.METADATA_FOLDER_NAME;
46-
import static com.facebook.presto.iceberg.TestIcebergRegisterProcedure.getMetadataFileLocation;
45+
import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.METADATA_FOLDER_NAME;
46+
import static com.facebook.presto.iceberg.procedure.TestIcebergRegisterProcedure.getMetadataFileLocation;
4747
import static com.facebook.presto.testing.MaterializedResult.resultBuilder;
4848
import static com.google.common.base.Preconditions.checkArgument;
4949
import static com.google.common.collect.Iterables.getOnlyElement;

presto-iceberg/src/test/java/com/facebook/presto/iceberg/TestIcebergRegisterProcedure.java renamed to presto-iceberg/src/test/java/com/facebook/presto/iceberg/procedure/TestIcebergRegisterProcedure.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package com.facebook.presto.iceberg;
14+
package com.facebook.presto.iceberg.procedure;
1515

1616
import com.facebook.presto.Session;
1717
import com.facebook.presto.hive.HdfsConfiguration;
@@ -25,6 +25,8 @@
2525
import com.facebook.presto.hive.metastore.ExtendedHiveMetastore;
2626
import com.facebook.presto.hive.metastore.MetastoreContext;
2727
import com.facebook.presto.hive.metastore.file.FileHiveMetastore;
28+
import com.facebook.presto.iceberg.IcebergConfig;
29+
import com.facebook.presto.iceberg.IcebergPlugin;
2830
import com.facebook.presto.spi.ConnectorSession;
2931
import com.facebook.presto.spi.SchemaTableName;
3032
import com.facebook.presto.testing.QueryRunner;
@@ -45,10 +47,10 @@
4547
import static com.facebook.presto.hive.metastore.InMemoryCachingHiveMetastore.memoizeMetastore;
4648
import static com.facebook.presto.hive.metastore.MetastoreUtil.getMetastoreHeaders;
4749
import static com.facebook.presto.hive.metastore.MetastoreUtil.isUserDefinedTypeEncodingEnabled;
48-
import static com.facebook.presto.iceberg.RegisterTableProcedure.METADATA_FOLDER_NAME;
49-
import static com.facebook.presto.iceberg.RegisterTableProcedure.getFileSystem;
50-
import static com.facebook.presto.iceberg.RegisterTableProcedure.parseMetadataVersionFromFileName;
51-
import static com.facebook.presto.iceberg.RegisterTableProcedure.resolveLatestMetadataLocation;
50+
import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.METADATA_FOLDER_NAME;
51+
import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.getFileSystem;
52+
import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.parseMetadataVersionFromFileName;
53+
import static com.facebook.presto.iceberg.procedure.RegisterTableProcedure.resolveLatestMetadataLocation;
5254
import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
5355
import static java.lang.String.format;
5456
import static org.apache.iceberg.util.LocationUtil.stripTrailingSlash;

0 commit comments

Comments
 (0)