devmadhuu opened a new pull request, #9472:
URL: https://github.com/apache/ozone/pull/9472
## What changes were proposed in this pull request?
This PR updates existing SCM `ReplicationManager` to capture all container
replication statuses in existing `ContainerInfo` object. The implementation
uses a simple enum-based approach with short values, enabling SCM to track
both individual health states (e.g., `UNDER_REPLICATED`, `MISSING`) and common
combinations (e.g., `UNDER_REPLICATED_MIS_REPLICATED`) efficiently.
**Key Features**
1. `ContainerHealthState` Enum
- Individual states (values 0-99): 11 health states including `HEALTHY`,
`UNDER_REPLICATED`, `MIS_REPLICATED`, `OVER_REPLICATED`, `MISSING`,
`UNHEALTHY`, `EMPTY`, `OPEN_UNHEALTHY`, `QUASI_CLOSED_STUCK`,
`OPEN_WITHOUT_PIPELINE`, and `REPLICA_MISMATCH`
- Combination states (values 100+): 8 common combinations like
`MISSING_EMPTY`, `UNDER_REPLICATED_MIS_REPLICATED`, etc.
2. `HealthStateFilter` API
- Simple filtering mechanism for querying containers by exact health state
match
- Factory methods: `HealthStateFilter.of(state)` for single state or
multiple states
- Clean matches() method for container filtering
3. `ContainerInfo` Integration
- New healthState field (short, 2 bytes per container)
- New healthStateUpdateTime field for tracking when health state changed
- Automatic timestamp updates when health state is modified
- Protobuf serialization support
4. `ContainerManager` Query API
```
List<ContainerInfo> getContainersByHealthState(HealthStateFilter filter);
Map<ContainerInfo, ContainerHealthState>
getContainersWithHealthState(HealthStateFilter filter);
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14119
## How was this patch tested?
This patch is tested using new test cases:
`TestContainerHealthState` covering:
- All individual states and combinations
- Conversion from ReplicationManager states
- Protobuf serialization/deserialization
- Health state filtering and querying
- Edge cases and invalid states
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]