-
Notifications
You must be signed in to change notification settings - Fork 275
Add Events for PolarisServiceImpl APIs #1904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adnanhemani
wants to merge
12
commits into
apache:main
Choose a base branch
from
adnanhemani:ahemani/add_events_for_polaris_service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8d75dac
Add Events for PolarisServiceImpl APIs
adnanhemani bf34c0c
Ensure all events extend PolarisEvent
adnanhemani 5e6ab5a
spotless apply
adnanhemani cc87952
Add licenses
adnanhemani 5dbfb2d
first revision
adnanhemani 08b2bde
spotlessapply
adnanhemani 920673d
Merge remote-tracking branch 'origin/main' into ahemani/add_events_fo…
adnanhemani be81102
merge from main
adnanhemani afa7bae
spotlessapply
adnanhemani 5ff384c
few event adjustments
adnanhemani 4976e1a
remove all event ids
adnanhemani 7c099d6
remove securitycontext and callcontext
adnanhemani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
268 changes: 230 additions & 38 deletions
268
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
...mmon/src/main/java/org/apache/polaris/service/events/AfterAddGrantToCatalogRoleEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.GrantResource; | ||
import org.apache.polaris.core.entity.PolarisPrivilege; | ||
|
||
/** | ||
* Event fired after a grant is added to a catalog role in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
* @param catalogRoleName the name of the catalog role | ||
* @param privilege the privilege granted | ||
* @param grantResource the grant resource | ||
*/ | ||
public record AfterAddGrantToCatalogRoleEvent( | ||
String catalogName, | ||
String catalogRoleName, | ||
PolarisPrivilege privilege, | ||
GrantResource grantResource) | ||
implements PolarisEvent {} |
31 changes: 31 additions & 0 deletions
31
...common/src/main/java/org/apache/polaris/service/events/AfterAssignPrincipalRoleEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.PrincipalRole; | ||
|
||
/** | ||
* Event fired after a principal role is assigned to a principal in Polaris. | ||
* | ||
* @param principalName the name of the principal | ||
* @param principalRole the principal role assigned | ||
*/ | ||
public record AfterAssignPrincipalRoleEvent(String principalName, PrincipalRole principalRole) | ||
implements PolarisEvent {} |
25 changes: 25 additions & 0 deletions
25
service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogCreatedEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.Catalog; | ||
|
||
/** Emitted when Polaris intends to create a table. */ | ||
public record AfterCatalogCreatedEvent(Catalog catalog) implements PolarisEvent {} |
23 changes: 23 additions & 0 deletions
23
service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogDeletedEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** Emitted when Polaris deletes a catalog. */ | ||
public record AfterCatalogDeletedEvent(String catalogName) implements PolarisEvent {} |
25 changes: 25 additions & 0 deletions
25
service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogGetEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.Catalog; | ||
|
||
/** Emitted when Polaris intends to get a catalog. */ | ||
public record AfterCatalogGetEvent(Catalog catalog) implements PolarisEvent {} |
23 changes: 23 additions & 0 deletions
23
service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogListEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** Emitted when Polaris lists all catalogs. */ | ||
public record AfterCatalogListEvent() implements PolarisEvent {} |
30 changes: 30 additions & 0 deletions
30
...in/java/org/apache/polaris/service/events/AfterCatalogRoleAssignToPrincipalRoleEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** | ||
* Event fired after a catalog role is assigned to a principal role in Polaris. | ||
* | ||
* @param principalRoleName the name of the principal role | ||
* @param catalogName the name of the catalog | ||
* @param catalogRoleName the name of the catalog role assigned | ||
*/ | ||
public record AfterCatalogRoleAssignToPrincipalRoleEvent( | ||
String principalRoleName, String catalogName, String catalogRoleName) implements PolarisEvent {} |
31 changes: 31 additions & 0 deletions
31
...e/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleCreateEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.CatalogRole; | ||
|
||
/** | ||
* Event fired after a catalog role is created in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
* @param catalogRole the catalog role that was created | ||
*/ | ||
public record AfterCatalogRoleCreateEvent(String catalogName, CatalogRole catalogRole) | ||
implements PolarisEvent {} |
29 changes: 29 additions & 0 deletions
29
...e/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleDeleteEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** | ||
* Event fired after a catalog role is deleted in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
* @param catalogRoleName the name of the catalog role that was deleted | ||
*/ | ||
public record AfterCatalogRoleDeleteEvent(String catalogName, String catalogRoleName) | ||
implements PolarisEvent {} |
31 changes: 31 additions & 0 deletions
31
service/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleGetEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.CatalogRole; | ||
|
||
/** | ||
* Event fired after a catalog role is retrieved in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
* @param catalogRole the catalog role that was retrieved | ||
*/ | ||
public record AfterCatalogRoleGetEvent(String catalogName, CatalogRole catalogRole) | ||
implements PolarisEvent {} |
30 changes: 30 additions & 0 deletions
30
.../java/org/apache/polaris/service/events/AfterCatalogRoleRevokeFromPrincipalRoleEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** | ||
* Event fired after a catalog role is revoked from a principal role in Polaris. | ||
* | ||
* @param principalRoleName the name of the principal role | ||
* @param catalogName the name of the catalog | ||
* @param catalogRoleName the name of the catalog role that was revoked | ||
*/ | ||
public record AfterCatalogRoleRevokeFromPrincipalRoleEvent( | ||
String principalRoleName, String catalogName, String catalogRoleName) implements PolarisEvent {} |
31 changes: 31 additions & 0 deletions
31
...e/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRoleUpdateEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
import org.apache.polaris.core.admin.model.CatalogRole; | ||
|
||
/** | ||
* Event fired after a catalog role is updated in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
* @param updatedCatalogRole the updated catalog role object | ||
*/ | ||
public record AfterCatalogRoleUpdateEvent(String catalogName, CatalogRole updatedCatalogRole) | ||
implements PolarisEvent {} |
27 changes: 27 additions & 0 deletions
27
...ce/common/src/main/java/org/apache/polaris/service/events/AfterCatalogRolesListEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.polaris.service.events; | ||
|
||
/** | ||
* Event fired after the list of catalog roles is retrieved in Polaris. | ||
* | ||
* @param catalogName the name of the catalog | ||
*/ | ||
public record AfterCatalogRolesListEvent(String catalogName) implements PolarisEvent {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"intends to" are
AfterCatalogGet
not the same?