devmadhuu commented on code in PR #10946:
URL: https://github.com/apache/ozone/pull/10946#discussion_r3781529182
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockLocationInfo.java:
##########
@@ -213,12 +249,13 @@ public boolean equals(Object o) {
createVersion == that.createVersion &&
Objects.equals(blockID, that.blockID) &&
Objects.equals(token, that.token) &&
- Objects.equals(pipeline, that.pipeline);
+ Objects.equals(pipeline, that.pipeline) &&
+ Objects.equals(storageTier, that.storageTier);
Review Comment:
If using `isFallBack` in `hashCode`, then better use in `equals` also.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -206,15 +207,22 @@ protected List< OmKeyLocationInfo >
allocateBlock(ScmClient scmClient,
String remoteUser = getRemoteUser().getShortUserName();
List<AllocatedBlock> allocatedBlocks;
try {
+ OzoneStoragePolicy storagePolicy = null;
+ if (storagePolicy == null) {
Review Comment:
This `if `is redundant.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/ScmBlockLocationProtocolServerSideTranslatorPB.java:
##########
@@ -202,20 +209,24 @@ public AllocateScmBlockResponseProto allocateScmBlock(
request.getEcReplicationConfig()),
request.getOwner(),
ExcludeList.getFromProtoBuf(request.getExcludeList()),
- request.getClient());
+ request.getClient(),
+ storagePolicy,
+ request.getAllowFallBack());
AllocateScmBlockResponseProto.Builder builder =
AllocateScmBlockResponseProto.newBuilder();
if (allocatedBlocks.size() < request.getNumBlocks()) {
throw new SCMException("Allocated " + allocatedBlocks.size() +
- " blocks. Requested " + request.getNumBlocks() + " blocks",
- SCMException.ResultCodes.FAILED_TO_ALLOCATE_ENOUGH_BLOCKS);
+ " blocks. Requested " + request.getNumBlocks() + " blocks.
StoragePolicy " +
+ storagePolicy,
SCMException.ResultCodes.FAILED_TO_ALLOCATE_ENOUGH_BLOCKS);
}
for (AllocatedBlock block : allocatedBlocks) {
builder.addBlocks(AllocateBlockResponse.newBuilder()
.setContainerBlockID(block.getBlockID().getProtobuf())
- .setPipeline(block.getPipeline().getProtobufMessage(clientVersion,
Name.IO_PORTS)));
+ .setPipeline(block.getPipeline().getProtobufMessage(clientVersion,
Name.IO_PORTS))
+ .setStorageTier(block.getStorageTier().toProto())
Review Comment:
If block can have `null` storage tier, because it is `nullable` field in
AllocatedBlock
--
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]