132
132
import org .apache .polaris .service .catalog .io .FileIOFactory ;
133
133
import org .apache .polaris .service .catalog .io .FileIOUtil ;
134
134
import org .apache .polaris .service .catalog .validation .IcebergPropertiesValidation ;
135
- import org .apache .polaris .service .events .AfterTableCommitedEvent ;
136
- import org .apache .polaris .service .events .AfterTableRefreshedEvent ;
137
- import org .apache .polaris .service .events .AfterViewCommitedEvent ;
138
- import org .apache .polaris .service .events .AfterViewRefreshedEvent ;
139
- import org .apache .polaris .service .events .BeforeTableCommitedEvent ;
140
- import org .apache .polaris .service .events .BeforeTableRefreshedEvent ;
141
- import org .apache .polaris .service .events .BeforeViewCommitedEvent ;
142
- import org .apache .polaris .service .events .BeforeViewRefreshedEvent ;
135
+ import org .apache .polaris .service .events .IcebergRestCatalogEvents ;
143
136
import org .apache .polaris .service .events .listeners .PolarisEventListener ;
144
137
import org .apache .polaris .service .task .TaskExecutor ;
145
138
import org .apache .polaris .service .types .NotificationRequest ;
@@ -1446,8 +1439,8 @@ public void doRefresh() {
1446
1439
if (latestLocation == null ) {
1447
1440
disableRefresh ();
1448
1441
} else {
1449
- polarisEventListener .onBeforeTableRefreshed (
1450
- new BeforeTableRefreshedEvent (catalogName , tableIdentifier ));
1442
+ polarisEventListener .onBeforeRefreshTable (
1443
+ new IcebergRestCatalogEvents . BeforeRefreshTableEvent (catalogName , tableIdentifier ));
1451
1444
refreshFromMetadataLocation (
1452
1445
latestLocation ,
1453
1446
SHOULD_RETRY_REFRESH_PREDICATE ,
@@ -1467,14 +1460,15 @@ public void doRefresh() {
1467
1460
Set .of (PolarisStorageActions .READ , PolarisStorageActions .LIST ));
1468
1461
return TableMetadataParser .read (fileIO , metadataLocation );
1469
1462
});
1470
- polarisEventListener .onAfterTableRefreshed (
1471
- new AfterTableRefreshedEvent (catalogName , tableIdentifier ));
1463
+ polarisEventListener .onAfterRefreshTable (
1464
+ new IcebergRestCatalogEvents . AfterRefreshTableEvent (catalogName , tableIdentifier ));
1472
1465
}
1473
1466
}
1474
1467
1475
1468
public void doCommit (TableMetadata base , TableMetadata metadata ) {
1476
- polarisEventListener .onBeforeTableCommited (
1477
- new BeforeTableCommitedEvent (tableIdentifier , base , metadata ));
1469
+ polarisEventListener .onBeforeCommitTable (
1470
+ new IcebergRestCatalogEvents .BeforeCommitTableEvent (
1471
+ catalogName , tableIdentifier , base , metadata ));
1478
1472
1479
1473
LOGGER .debug (
1480
1474
"doCommit for table {} with metadataBefore {}, metadataAfter {}" ,
@@ -1618,8 +1612,9 @@ public void doCommit(TableMetadata base, TableMetadata metadata) {
1618
1612
updateTableLike (tableIdentifier , entity );
1619
1613
}
1620
1614
1621
- polarisEventListener .onAfterTableCommited (
1622
- new AfterTableCommitedEvent (catalogName , tableIdentifier , base , metadata ));
1615
+ polarisEventListener .onAfterCommitTable (
1616
+ new IcebergRestCatalogEvents .AfterCommitTableEvent (
1617
+ catalogName , tableIdentifier , base , metadata ));
1623
1618
}
1624
1619
1625
1620
@ Override
@@ -1810,8 +1805,8 @@ public void doRefresh() {
1810
1805
if (latestLocation == null ) {
1811
1806
disableRefresh ();
1812
1807
} else {
1813
- polarisEventListener .onBeforeViewRefreshed (
1814
- new BeforeViewRefreshedEvent (catalogName , identifier ));
1808
+ polarisEventListener .onBeforeRefreshView (
1809
+ new IcebergRestCatalogEvents . BeforeRefreshViewEvent (catalogName , identifier ));
1815
1810
refreshFromMetadataLocation (
1816
1811
latestLocation ,
1817
1812
SHOULD_RETRY_REFRESH_PREDICATE ,
@@ -1833,14 +1828,15 @@ public void doRefresh() {
1833
1828
1834
1829
return ViewMetadataParser .read (fileIO .newInputFile (metadataLocation ));
1835
1830
});
1836
- polarisEventListener .onAfterViewRefreshed (
1837
- new AfterViewRefreshedEvent (catalogName , identifier ));
1831
+ polarisEventListener .onAfterRefreshView (
1832
+ new IcebergRestCatalogEvents . AfterRefreshViewEvent (catalogName , identifier ));
1838
1833
}
1839
1834
}
1840
1835
1841
1836
public void doCommit (ViewMetadata base , ViewMetadata metadata ) {
1842
- polarisEventListener .onBeforeViewCommited (
1843
- new BeforeViewCommitedEvent (catalogName , identifier , base , metadata ));
1837
+ polarisEventListener .onBeforeCommitView (
1838
+ new IcebergRestCatalogEvents .BeforeCommitViewEvent (
1839
+ catalogName , identifier , base , metadata ));
1844
1840
1845
1841
// TODO: Maybe avoid writing metadata if there's definitely a transaction conflict
1846
1842
LOGGER .debug (
@@ -1940,8 +1936,9 @@ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
1940
1936
updateTableLike (identifier , entity );
1941
1937
}
1942
1938
1943
- polarisEventListener .onAfterViewCommited (
1944
- new AfterViewCommitedEvent (catalogName , identifier , base , metadata ));
1939
+ polarisEventListener .onAfterCommitView (
1940
+ new IcebergRestCatalogEvents .AfterCommitViewEvent (
1941
+ catalogName , identifier , base , metadata ));
1945
1942
}
1946
1943
1947
1944
protected String writeNewMetadataIfRequired (ViewMetadata metadata ) {
0 commit comments