avijayanhwx commented on a change in pull request #194: HDDS-2241. Optimize the
refresh pipeline logic used by KeyManagerImpl…
URL: https://github.com/apache/hadoop-ozone/pull/194#discussion_r348299804
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -688,6 +665,35 @@ public OmKeyInfo lookupKey(OmKeyArgs args, String
clientAddress)
}
}
+ /**
+ * Refresh pipeline info in OM by asking SCM.
+ * @param value OmKeyInfo
+ */
+ @VisibleForTesting
+ protected void refreshPipeline(OmKeyInfo value) throws IOException {
+ Map<Long, ContainerWithPipeline> containerWithPipelineMap = new
HashMap<>();
+ for (OmKeyLocationInfoGroup key : value.getKeyLocationVersions()) {
+ for (OmKeyLocationInfo k : key.getLocationList()) {
+ // TODO: fix Some tests that may not initialize container client
+ // The production should always have containerClient initialized.
+ if (scmClient.getContainerClient() != null) {
+ if (containerWithPipelineMap.containsKey(k.getContainerID())) {
+ ContainerWithPipeline containerWithPipeline = scmClient
+ .getContainerClient()
+ .getContainerWithPipeline(k.getContainerID());
Review comment:
Added new OMException ResultCode.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]