jerryshao opened a new pull request, #11199:
URL: https://github.com/apache/gravitino/pull/11199
### What changes were proposed in this pull request?
Introduces a `ListEvent` marker interface that exposes `resultCount()` on all
list-operation success event classes (core and Iceberg REST server). All
event
dispatchers are updated to pass the actual result count when constructing
these
events. `SimpleAuditLogV2.toString()` now surfaces the count as `{count=N}`
in
the custom-info audit-log field.
Backward compatibility is preserved: the original no-count constructors are
deprecated and delegate to `-1`; the audit formatter omits the count field
when
`resultCount()` returns `-1`.
### Why are the changes needed?
Without the result count in audit logs it is impossible to distinguish an
empty list response from a non-empty one, making audit trails less useful for
security analysis and capacity planning.
Fix: #11170
### Does this PR introduce _any_ user-facing change?
- New `ListEvent` interface added to the public `@DeveloperApi` surface.
- All `List*Event` classes gain a new preferred constructor that accepts a
result
count; the old constructors are deprecated but still compile and run.
- Audit log lines for list operations now include `{count=N}` in the last
field.
### How was this patch tested?
- `TestSimpleAuditLogV2`: new tests cover count in log output, zero count,
null
identifier, count merged with custom info, deprecated constructor omitting
count, and non-list events.
- `TestFileAuditWriter`: end-to-end log-line tests for `ListTableEvent`,
`ListMetalakeEvent`, and `ListCatalogEvent`.
- Existing dispatcher and event tests updated to use the new constructors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]