Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb3704c
HDDS-8214. Recon - OM DB Insights - Container Level Info.
Mar 30, 2023
823ead5
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 4, 2023
f8e0d79
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 4, 2023
8dacd12
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 4, 2023
168e651
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 4, 2023
cace42c
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 5, 2023
f628968
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 5, 2023
9fc1eaf
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 5, 2023
285ddb1
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 17, 2023
05141a3
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 17, 2023
7091198
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
fb210c3
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
eb23a87
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
3e1e87b
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
72f6c40
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
18abcb9
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
410b846
HDDS-8214. Recon - OM DB Insights - Key Level Info.
Apr 19, 2023
737734c
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 5, 2023
25171b5
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 11, 2023
a169db1
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 11, 2023
90c5a15
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 15, 2023
6135735
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 15, 2023
5ae1ee4
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 15, 2023
76dd31a
HDDS-8214. Recon - OM DB Insights - Key Level Info.
May 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public Response getUnhealthyContainers(
* }
* @param limit limits the number of deleted containers
* @param prevKey previous container Id to skip
* @return Response of delete containers.
* @return Response of deleted containers.
*/
@GET
@Path("/deleted")
Expand Down Expand Up @@ -566,4 +566,76 @@ public Response getContainerMisMatchInsights() {
}
return Response.ok(containerDiscrepancyInfoList).build();
}

/** This API retrieves set of deleted containers in SCM which are present
* in OM to find out list of keys mapped to such DELETED state containers.
*
* limit - limits the number of such SCM DELETED containers present in OM.
* prevKey - Skip containers till it seeks correctly to the previous
* containerId.
* Sample API Response:
* [
* {
* "containerId": 2,
* "numberOfKeys": 2,
* "pipelines": []
* }
* ]
*/
@GET
@Path("/mismatch/deleted")
public Response getOmContainersDeletedInSCM(
@DefaultValue(DEFAULT_FETCH_COUNT) @QueryParam(RECON_QUERY_LIMIT)
int limit,
@DefaultValue(PREV_CONTAINER_ID_DEFAULT_VALUE)
@QueryParam(RECON_QUERY_PREVKEY) long prevKey) {
if (prevKey < 0) {
// Send back an empty response
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
List<ContainerDiscrepancyInfo> containerDiscrepancyInfoList =
new ArrayList<>();
try {
Map<Long, ContainerMetadata> omContainers =
reconContainerMetadataManager.getContainers(limit, prevKey);

List<Long> deletedStateSCMContainerIds =
containerManager.getContainers().stream()
.filter(containerInfo -> (containerInfo.getState() ==
HddsProtos.LifeCycleState.DELETED))
.map(containerInfo -> containerInfo.getContainerID()).collect(
Collectors.toList());

List<Map.Entry<Long, ContainerMetadata>>
omContainersDeletedInSCM =
omContainers.entrySet().stream().filter(containerMetadataEntry ->
(deletedStateSCMContainerIds.contains(
containerMetadataEntry.getKey())))
.collect(
Collectors.toList());

omContainersDeletedInSCM.forEach(
containerMetadataEntry -> {
ContainerDiscrepancyInfo containerDiscrepancyInfo =
new ContainerDiscrepancyInfo();
containerDiscrepancyInfo.setContainerID(
containerMetadataEntry.getKey());
containerDiscrepancyInfo.setNumberOfKeys(
containerMetadataEntry.getValue().getNumberOfKeys());
containerDiscrepancyInfo.setPipelines(
containerMetadataEntry.getValue()
.getPipelines());
containerDiscrepancyInfoList.add(containerDiscrepancyInfo);
});
} catch (IOException ex) {
throw new WebApplicationException(ex,
Response.Status.INTERNAL_SERVER_ERROR);
} catch (IllegalArgumentException e) {
throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
} catch (Exception ex) {
throw new WebApplicationException(ex,
Response.Status.INTERNAL_SERVER_ERROR);
}
return Response.ok(containerDiscrepancyInfoList).build();
}
}
Loading