Myracle opened a new pull request, #27728:
URL: https://github.com/apache/flink/pull/27728
## What is the purpose of the change
This pull request makes `ObjectPath` implement the `Comparable<ObjectPath>`
interface, enabling natural ordering of `ObjectPath` instances. This allows
users to sort catalog object paths (e.g., in `TreeMap`, `TreeSet`, or
`Collections.sort()`) by database name first, then by object name, which is
useful when displaying or processing catalog objects in a deterministic order.
## Brief change log
- *Made `ObjectPath` implement `Comparable<ObjectPath>`, with comparison
based on `databaseName` first and then `objectName`*
- *Added `ObjectPathTest` with comprehensive test cases covering
comparison, sorting, transitivity, and consistency with `equals`*
## Verifying this change
This change added tests and can be verified as follows:
- *Added `ObjectPathTest` with 8 test cases covering:*
- *Comparison with different database names*
- *Comparison with same database but different object names*
- *Comparison with equal paths*
- *Comparison with self*
- *Consistency between `compareTo` and `equals`*
- *Sorting behavior with `Collections.sort()`*
- *Transitivity of the comparison*
- *Database name takes precedence over object name in ordering*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: yes (`ObjectPath` is annotated with `@PublicEvolving`)
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]