Skip to content

Commit 4976e1a

Browse files
committed
remove all event ids
1 parent 5ff384c commit 4976e1a

File tree

68 files changed

+396
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+396
-355
lines changed

service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java

Lines changed: 130 additions & 107 deletions
Large diffs are not rendered by default.

service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,8 @@ public void doRefresh() {
14271427
if (latestLocation == null) {
14281428
disableRefresh();
14291429
} else {
1430-
polarisEventListener.onBeforeTableRefreshed(new BeforeTableRefreshedEvent(tableIdentifier));
1430+
polarisEventListener.onBeforeTableRefreshed(
1431+
new BeforeTableRefreshedEvent(tableIdentifier), callContext, securityContext);
14311432
refreshFromMetadataLocation(
14321433
latestLocation,
14331434
SHOULD_RETRY_REFRESH_PREDICATE,
@@ -1447,13 +1448,16 @@ public void doRefresh() {
14471448
Set.of(PolarisStorageActions.READ, PolarisStorageActions.LIST));
14481449
return TableMetadataParser.read(fileIO, metadataLocation);
14491450
});
1450-
polarisEventListener.onAfterTableRefreshed(new AfterTableRefreshedEvent(tableIdentifier));
1451+
polarisEventListener.onAfterTableRefreshed(
1452+
new AfterTableRefreshedEvent(tableIdentifier), callContext, securityContext);
14511453
}
14521454
}
14531455

14541456
public void doCommit(TableMetadata base, TableMetadata metadata) {
14551457
polarisEventListener.onBeforeTableCommited(
1456-
new BeforeTableCommitedEvent(tableIdentifier, base, metadata));
1458+
new BeforeTableCommitedEvent(tableIdentifier, base, metadata),
1459+
callContext,
1460+
securityContext);
14571461

14581462
LOGGER.debug(
14591463
"doCommit for table {} with base {}, metadata {}", tableIdentifier, base, metadata);
@@ -1611,7 +1615,9 @@ public void doCommit(TableMetadata base, TableMetadata metadata) {
16111615
}
16121616

16131617
polarisEventListener.onAfterTableCommited(
1614-
new AfterTableCommitedEvent(tableIdentifier, base, metadata));
1618+
new AfterTableCommitedEvent(tableIdentifier, base, metadata),
1619+
callContext,
1620+
securityContext);
16151621
}
16161622

16171623
@Override
@@ -1802,7 +1808,8 @@ public void doRefresh() {
18021808
if (latestLocation == null) {
18031809
disableRefresh();
18041810
} else {
1805-
polarisEventListener.onBeforeViewRefreshed(new BeforeViewRefreshedEvent(identifier));
1811+
polarisEventListener.onBeforeViewRefreshed(
1812+
new BeforeViewRefreshedEvent(identifier), callContext, securityContext);
18061813
refreshFromMetadataLocation(
18071814
latestLocation,
18081815
SHOULD_RETRY_REFRESH_PREDICATE,
@@ -1824,13 +1831,14 @@ public void doRefresh() {
18241831

18251832
return ViewMetadataParser.read(fileIO.newInputFile(metadataLocation));
18261833
});
1827-
polarisEventListener.onAfterViewRefreshed(new AfterViewRefreshedEvent(identifier));
1834+
polarisEventListener.onAfterViewRefreshed(
1835+
new AfterViewRefreshedEvent(identifier), callContext, securityContext);
18281836
}
18291837
}
18301838

18311839
public void doCommit(ViewMetadata base, ViewMetadata metadata) {
18321840
polarisEventListener.onBeforeViewCommited(
1833-
new BeforeViewCommitedEvent(identifier, base, metadata));
1841+
new BeforeViewCommitedEvent(identifier, base, metadata), callContext, securityContext);
18341842

18351843
// TODO: Maybe avoid writing metadata if there's definitely a transaction conflict
18361844
LOGGER.debug("doCommit for view {} with base {}, metadata {}", identifier, base, metadata);
@@ -1927,7 +1935,7 @@ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
19271935
}
19281936

19291937
polarisEventListener.onAfterViewCommited(
1930-
new AfterViewCommitedEvent(identifier, base, metadata));
1938+
new AfterViewCommitedEvent(identifier, base, metadata), callContext, securityContext);
19311939
}
19321940

19331941
protected String writeNewMetadataIfRequired(ViewMetadata metadata) {

service/common/src/main/java/org/apache/polaris/service/events/AfterAddGrantToCatalogRoleEvent.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@
1919

2020
package org.apache.polaris.service.events;
2121

22-
import org.apache.polaris.core.admin.model.AddGrantRequest;
2322
import org.apache.polaris.core.admin.model.GrantResource;
2423
import org.apache.polaris.core.entity.PolarisPrivilege;
2524

2625
/**
2726
* Event fired after a grant is added to a catalog role in Polaris.
2827
*
29-
* @param eventId the unique identifier for this event
3028
* @param catalogName the name of the catalog
3129
* @param catalogRoleName the name of the catalog role
3230
* @param privilege the privilege granted
3331
* @param grantResource the grant resource
3432
*/
3533
public record AfterAddGrantToCatalogRoleEvent(
36-
String eventId,
3734
String catalogName,
3835
String catalogRoleName,
3936
PolarisPrivilege privilege,

service/common/src/main/java/org/apache/polaris/service/events/AfterAssignPrincipalRoleEvent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
/**
2525
* Event fired after a principal role is assigned to a principal in Polaris.
2626
*
27-
* @param eventId the unique identifier for this event
2827
* @param principalName the name of the principal
2928
* @param principalRole the principal role assigned
3029
*/
31-
public record AfterAssignPrincipalRoleEvent(
32-
String eventId, String principalName, PrincipalRole principalRole) implements PolarisEvent {}
30+
public record AfterAssignPrincipalRoleEvent(String principalName, PrincipalRole principalRole)
31+
implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogCreatedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
import org.apache.polaris.core.admin.model.Catalog;
2323

2424
/** Emitted when Polaris intends to create a table. */
25-
public record AfterCatalogCreatedEvent(String eventId, Catalog catalog) implements PolarisEvent {}
25+
public record AfterCatalogCreatedEvent(Catalog catalog) implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogDeletedEvent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
package org.apache.polaris.service.events;
2121

2222
/** Emitted when Polaris deletes a catalog. */
23-
public record AfterCatalogDeletedEvent(String eventId, String catalogName)
24-
implements PolarisEvent {}
23+
public record AfterCatalogDeletedEvent(String catalogName) implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogGetEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
import org.apache.polaris.core.admin.model.Catalog;
2323

2424
/** Emitted when Polaris intends to get a catalog. */
25-
public record AfterCatalogGetEvent(String eventId, Catalog catalog) implements PolarisEvent {}
25+
public record AfterCatalogGetEvent(Catalog catalog) implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogListEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
package org.apache.polaris.service.events;
2121

2222
/** Emitted when Polaris lists all catalogs. */
23-
public record AfterCatalogListEvent(String eventId) implements PolarisEvent {}
23+
public record AfterCatalogListEvent() implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleAssignToPrincipalRoleEvent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
/**
2323
* Event fired after a catalog role is assigned to a principal role in Polaris.
2424
*
25-
* @param eventId the unique identifier for this event
2625
* @param principalRoleName the name of the principal role
2726
* @param catalogName the name of the catalog
2827
* @param catalogRoleName the name of the catalog role assigned
2928
*/
3029
public record AfterCatalogRoleAssignToPrincipalRoleEvent(
31-
String eventId, String principalRoleName, String catalogName, String catalogRoleName)
32-
implements PolarisEvent {}
30+
String principalRoleName, String catalogName, String catalogRoleName) implements PolarisEvent {}

service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleCreateEvent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
/**
2525
* Event fired after a catalog role is created in Polaris.
2626
*
27-
* @param eventId the unique identifier for this event
2827
* @param catalogName the name of the catalog
2928
* @param catalogRole the catalog role that was created
3029
*/
31-
public record AfterCatalogRoleCreateEvent(
32-
String eventId, String catalogName, CatalogRole catalogRole) implements PolarisEvent {}
30+
public record AfterCatalogRoleCreateEvent(String catalogName, CatalogRole catalogRole)
31+
implements PolarisEvent {}

0 commit comments

Comments
 (0)