Source:
<code>public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { CreateKeyRequest createKeyRequest = getOmRequest().getCreateKeyRequest(); Preconditions.checkNotNull(createKeyRequest); KeyArgs keyArgs = createKeyRequest.getKeyArgs(); CreateKeyRequest.Builder newCreateKeyRequest = null; KeyArgs.Builder newKeyArgs = null; if (!keyArgs.getIsMultipartKey()) { long scmBlockSize = ozoneManager.getScmBlockSize(); final long requestedSize = keyArgs.getDataSize() > 0 ? keyArgs.getDataSize() : scmBlockSize; boolean useRatis = ozoneManager.isUseRatis(); HddsProtos.ReplicationFactor factor = keyArgs.getFactor(); if (factor == null) { factor = useRatis ? HddsProtos.ReplicationFactor.THREE : HddsProtos.ReplicationFactor.ONE; } HddsProtos.ReplicationType type = keyArgs.getType(); if (type == null) { type = useRatis ? HddsProtos.ReplicationType.RATIS : HddsProtos.ReplicationType.STAND_ALONE; } <START> <END> List< OmKeyLocationInfo > omKeyLocationInfoList = allocateBlock(ozoneManager.getScmClient(), ozoneManager.getBlockTokenSecretManager(), type, factor, new ExcludeList(), requestedSize, scmBlockSize, ozoneManager.getPreallocateBlocksMax(), ozoneManager.isGrpcBlockTokenEnabled(), ozoneManager.getOMNodeId()); newKeyArgs = keyArgs.toBuilder().setModificationTime(Time.now()) .setType(type).setFactor(factor) .setDataSize(requestedSize); newKeyArgs.addAllKeyLocations(omKeyLocationInfoList.stream() .map(OmKeyLocationInfo::getProtobuf).collect(Collectors.toList())); } else { newKeyArgs = keyArgs.toBuilder().setModificationTime(Time.now()); } newCreateKeyRequest = createKeyRequest.toBuilder().setKeyArgs(newKeyArgs) .setID(UniqueId.next()); return getOmRequest().toBuilder() .setCreateKeyRequest(newCreateKeyRequest).setUserInfo(getUserInfo()) .build(); }</code><technical_language>this OM talk SCM get blocks</technical_language>

Target:
public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { CreateKeyRequest createKeyRequest = getOmRequest().getCreateKeyRequest(); Preconditions.checkNotNull(createKeyRequest); KeyArgs keyArgs = createKeyRequest.getKeyArgs(); CreateKeyRequest.Builder newCreateKeyRequest = null; KeyArgs.Builder newKeyArgs = null; if (!keyArgs.getIsMultipartKey()) { long scmBlockSize = ozoneManager.getScmBlockSize(); final long requestedSize = keyArgs.getDataSize() > 0 ? keyArgs.getDataSize() : scmBlockSize; boolean useRatis = ozoneManager.shouldUseRatis(); HddsProtos.ReplicationFactor factor = keyArgs.getFactor(); if (factor == null) { factor = useRatis ? HddsProtos.ReplicationFactor.THREE : HddsProtos.ReplicationFactor.ONE; } HddsProtos.ReplicationType type = keyArgs.getType(); if (type == null) { type = useRatis ? HddsProtos.ReplicationType.RATIS : HddsProtos.ReplicationType.STAND_ALONE; } List< OmKeyLocationInfo > omKeyLocationInfoList = allocateBlock(ozoneManager.getScmClient(), ozoneManager.getBlockTokenSecretManager(), type, factor, new ExcludeList(), requestedSize, scmBlockSize, ozoneManager.getPreallocateBlocksMax(), ozoneManager.isGrpcBlockTokenEnabled(), ozoneManager.getOMNodeId()); newKeyArgs = keyArgs.toBuilder().setModificationTime(Time.now()) .setType(type).setFactor(factor) .setDataSize(requestedSize); newKeyArgs.addAllKeyLocations(omKeyLocationInfoList.stream() .map(OmKeyLocationInfo::getProtobuf).collect(Collectors.toList())); } else { newKeyArgs = keyArgs.toBuilder().setModificationTime(Time.now()); } newCreateKeyRequest = createKeyRequest.toBuilder().setKeyArgs(newKeyArgs) .setClientID(UniqueId.next()); return getOmRequest().toBuilder() .setCreateKeyRequest(newCreateKeyRequest).setUserInfo(getUserInfo()) .build(); }