@@ -109,7 +109,6 @@ public class BasePolarisCatalog extends BaseMetastoreViewCatalog
109109 private static final Logger LOG = LoggerFactory .getLogger (BasePolarisCatalog .class );
110110
111111 private static final Joiner SLASH = Joiner .on ("/" );
112- private static final Joiner DOT = Joiner .on ("." );
113112
114113 // Config key for whether to allow setting the FILE_IO_IMPL using catalog properties. Should
115114 // only be allowed in dev/test environments.
@@ -351,8 +350,7 @@ public boolean dropTable(TableIdentifier tableIdentifier, boolean purge) {
351350 })
352351 .orElse (Map .of ());
353352 PolarisMetaStoreManager .DropEntityResult dropEntityResult =
354- dropTableLike (
355- catalogId , PolarisEntitySubType .TABLE , tableIdentifier , storageProperties , purge );
353+ dropTableLike (PolarisEntitySubType .TABLE , tableIdentifier , storageProperties , purge );
356354 if (!dropEntityResult .isSuccess ()) {
357355 return false ;
358356 }
@@ -376,7 +374,7 @@ public List<TableIdentifier> listTables(Namespace namespace) {
376374 "Cannot list tables for namespace. Namespace does not exist: %s" , namespace );
377375 }
378376
379- return listTableLike (catalogId , PolarisEntitySubType .TABLE , namespace );
377+ return listTableLike (PolarisEntitySubType .TABLE , namespace );
380378 }
381379
382380 @ Override
@@ -385,7 +383,7 @@ public void renameTable(TableIdentifier from, TableIdentifier to) {
385383 return ;
386384 }
387385
388- renameTableLike (catalogId , PolarisEntitySubType .TABLE , from , to );
386+ renameTableLike (PolarisEntitySubType .TABLE , from , to );
389387 }
390388
391389 @ Override
@@ -700,7 +698,7 @@ public List<TableIdentifier> listViews(Namespace namespace) {
700698 "Cannot list views for namespace. Namespace does not exist: %s" , namespace );
701699 }
702700
703- return listTableLike (catalogId , PolarisEntitySubType .VIEW , namespace );
701+ return listTableLike (PolarisEntitySubType .VIEW , namespace );
704702 }
705703
706704 @ Override
@@ -710,8 +708,7 @@ protected BasePolarisViewOperations newViewOps(TableIdentifier identifier) {
710708
711709 @ Override
712710 public boolean dropView (TableIdentifier identifier ) {
713- return dropTableLike (catalogId , PolarisEntitySubType .VIEW , identifier , Map .of (), true )
714- .isSuccess ();
711+ return dropTableLike (PolarisEntitySubType .VIEW , identifier , Map .of (), true ).isSuccess ();
715712 }
716713
717714 @ Override
@@ -720,14 +717,14 @@ public void renameView(TableIdentifier from, TableIdentifier to) {
720717 return ;
721718 }
722719
723- renameTableLike (catalogId , PolarisEntitySubType .VIEW , from , to );
720+ renameTableLike (PolarisEntitySubType .VIEW , from , to );
724721 }
725722
726723 @ Override
727724 public boolean sendNotification (
728725 TableIdentifier identifier , NotificationRequest notificationRequest ) {
729726 return sendNotificationForTableLike (
730- catalogId , PolarisEntitySubType .TABLE , identifier , notificationRequest );
727+ PolarisEntitySubType .TABLE , identifier , notificationRequest );
731728 }
732729
733730 @ Override
@@ -1060,11 +1057,9 @@ private void validateNoLocationOverlap(
10601057
10611058 private class BasePolarisCatalogTableBuilder
10621059 extends BaseMetastoreViewCatalog .BaseMetastoreViewCatalogTableBuilder {
1063- private final TableIdentifier identifier ;
10641060
10651061 public BasePolarisCatalogTableBuilder (TableIdentifier identifier , Schema schema ) {
10661062 super (identifier , schema );
1067- this .identifier = identifier ;
10681063 }
10691064
10701065 @ Override
@@ -1074,11 +1069,9 @@ public TableBuilder withLocation(String newLocation) {
10741069 }
10751070
10761071 private class BasePolarisCatalogViewBuilder extends BaseMetastoreViewCatalog .BaseViewBuilder {
1077- private final TableIdentifier identifier ;
10781072
10791073 public BasePolarisCatalogViewBuilder (TableIdentifier identifier ) {
10801074 super (identifier );
1081- this .identifier = identifier ;
10821075 }
10831076
10841077 @ Override
@@ -1130,7 +1123,6 @@ public void doRefresh() {
11301123 MAX_RETRIES ,
11311124 metadataLocation -> {
11321125 FileIO fileIO = this .tableFileIO ;
1133- boolean closeFileIO = false ;
11341126 PolarisResolvedPathWrapper resolvedStorageEntity =
11351127 resolvedEntities == null
11361128 ? resolvedEntityView .getResolvedPath (tableIdentifier .namespace ())
@@ -1255,9 +1247,9 @@ public void doCommit(TableMetadata base, TableMetadata metadata) {
12551247 tableIdentifier , oldLocation , newLocation , existingLocation );
12561248 }
12571249 if (null == existingLocation ) {
1258- createTableLike (catalogId , tableIdentifier , entity );
1250+ createTableLike (tableIdentifier , entity );
12591251 } else {
1260- updateTableLike (catalogId , tableIdentifier , entity );
1252+ updateTableLike (tableIdentifier , entity );
12611253 }
12621254 }
12631255
@@ -1477,9 +1469,9 @@ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
14771469 identifier , oldLocation , newLocation , existingLocation );
14781470 }
14791471 if (null == existingLocation ) {
1480- createTableLike (catalogId , identifier , entity );
1472+ createTableLike (identifier , entity );
14811473 } else {
1482- updateTableLike (catalogId , identifier , entity );
1474+ updateTableLike (identifier , entity );
14831475 }
14841476 }
14851477
@@ -1540,7 +1532,7 @@ long getCatalogId() {
15401532 }
15411533
15421534 private void renameTableLike (
1543- long catalogId , PolarisEntitySubType subType , TableIdentifier from , TableIdentifier to ) {
1535+ PolarisEntitySubType subType , TableIdentifier from , TableIdentifier to ) {
15441536 LOG .debug ("Renaming tableLike from {} to {}" , from , to );
15451537 PolarisResolvedPathWrapper resolvedEntities = resolvedEntityView .getResolvedPath (from , subType );
15461538 if (resolvedEntities == null ) {
@@ -1655,7 +1647,7 @@ private void renameTableLike(
16551647 * duplicate the logic to try to reolve parentIds before constructing the proposed entity. This
16561648 * method will fill in the parentId if needed upon resolution.
16571649 */
1658- private void createTableLike (long catalogId , TableIdentifier identifier , PolarisEntity entity ) {
1650+ private void createTableLike (TableIdentifier identifier , PolarisEntity entity ) {
16591651 PolarisResolvedPathWrapper resolvedParent =
16601652 resolvedEntityView .getResolvedPath (identifier .namespace ());
16611653 if (resolvedParent == null ) {
@@ -1664,14 +1656,11 @@ private void createTableLike(long catalogId, TableIdentifier identifier, Polaris
16641656 String .format ("Failed to fetch resolved parent for TableIdentifier '%s'" , identifier ));
16651657 }
16661658
1667- createTableLike (catalogId , identifier , entity , resolvedParent );
1659+ createTableLike (identifier , entity , resolvedParent );
16681660 }
16691661
16701662 private void createTableLike (
1671- long catalogId ,
1672- TableIdentifier identifier ,
1673- PolarisEntity entity ,
1674- PolarisResolvedPathWrapper resolvedParent ) {
1663+ TableIdentifier identifier , PolarisEntity entity , PolarisResolvedPathWrapper resolvedParent ) {
16751664 // Make sure the metadata file is valid for our allowed locations.
16761665 String metadataLocation = TableLikeEntity .of (entity ).getMetadataLocation ();
16771666 validateLocationForTableLike (identifier , metadataLocation , resolvedParent );
@@ -1704,7 +1693,7 @@ private static boolean isUnderParentLocation(URI childLocation, URI expectedPare
17041693 return !expectedParentLocation .relativize (childLocation ).equals (childLocation );
17051694 }
17061695
1707- private void updateTableLike (long catalogId , TableIdentifier identifier , PolarisEntity entity ) {
1696+ private void updateTableLike (TableIdentifier identifier , PolarisEntity entity ) {
17081697 PolarisResolvedPathWrapper resolvedEntities =
17091698 resolvedEntityView .getResolvedPath (identifier , entity .getSubType ());
17101699 if (resolvedEntities == null ) {
@@ -1733,7 +1722,6 @@ private void updateTableLike(long catalogId, TableIdentifier identifier, Polaris
17331722 }
17341723
17351724 private @ NotNull PolarisMetaStoreManager .DropEntityResult dropTableLike (
1736- long catalogId ,
17371725 PolarisEntitySubType subType ,
17381726 TableIdentifier identifier ,
17391727 Map <String , String > storageProperties ,
@@ -1759,10 +1747,7 @@ private void updateTableLike(long catalogId, TableIdentifier identifier, Polaris
17591747 }
17601748
17611749 private boolean sendNotificationForTableLike (
1762- long catalogId ,
1763- PolarisEntitySubType subType ,
1764- TableIdentifier tableIdentifier ,
1765- NotificationRequest request ) {
1750+ PolarisEntitySubType subType , TableIdentifier tableIdentifier , NotificationRequest request ) {
17661751 LOG .debug ("Handling notification request {} for tableIdentifier {}" , request , tableIdentifier );
17671752 PolarisResolvedPathWrapper resolvedEntities =
17681753 resolvedEntityView .getPassthroughResolvedPath (tableIdentifier , subType );
@@ -1772,8 +1757,7 @@ private boolean sendNotificationForTableLike(
17721757 Preconditions .checkNotNull (notificationType , "Expected a valid notification type." );
17731758
17741759 if (notificationType == NotificationType .DROP ) {
1775- return dropTableLike (
1776- catalogId , PolarisEntitySubType .TABLE , tableIdentifier , Map .of (), false /* purge */ )
1760+ return dropTableLike (PolarisEntitySubType .TABLE , tableIdentifier , Map .of (), false /* purge */ )
17771761 .isSuccess ();
17781762 } else if (notificationType == NotificationType .CREATE
17791763 || notificationType == NotificationType .UPDATE ) {
@@ -1832,14 +1816,14 @@ private boolean sendNotificationForTableLike(
18321816 "Creating table {} for notification with metadataLocation {}" ,
18331817 tableIdentifier ,
18341818 newLocation );
1835- createTableLike (catalogId , tableIdentifier , entity , resolvedParent );
1819+ createTableLike (tableIdentifier , entity , resolvedParent );
18361820 } else {
18371821 LOG .debug (
18381822 "Updating table {} for notification with metadataLocation {}" ,
18391823 tableIdentifier ,
18401824 newLocation );
18411825
1842- updateTableLike (catalogId , tableIdentifier , entity );
1826+ updateTableLike (tableIdentifier , entity );
18431827 }
18441828 }
18451829 return true ;
@@ -1863,8 +1847,7 @@ private void createNonExistingNamespaces(Namespace namespace) {
18631847 }
18641848 }
18651849
1866- private List <TableIdentifier > listTableLike (
1867- long catalogId , PolarisEntitySubType subType , Namespace namespace ) {
1850+ private List <TableIdentifier > listTableLike (PolarisEntitySubType subType , Namespace namespace ) {
18681851 PolarisResolvedPathWrapper resolvedEntities = resolvedEntityView .getResolvedPath (namespace );
18691852 if (resolvedEntities == null ) {
18701853 // Illegal state because the namespace should've already been in the static resolution set.
0 commit comments