hanishakoneru commented on a change in pull request #884: HDDS-1620. Implement
Volume Write Requests to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/884#discussion_r292245143
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -43,10 +48,24 @@ private OzoneManagerRatisUtils() {
* @return OMClientRequest
* @throws IOException
*/
- public static OMClientRequest createClientRequest(OMRequest omRequest)
- throws IOException {
+ public static OMClientRequest createClientRequest(OMRequest omRequest) {
Type cmdType = omRequest.getCmdType();
switch (cmdType) {
+ case CreateVolume:
+ return new OMVolumeCreateRequest(omRequest);
+ case SetVolumeProperty:
+ boolean hasQuota = omRequest.getSetVolumePropertyRequest()
+ .hasQuotaInBytes();
+ boolean hasOwner =
omRequest.getSetVolumePropertyRequest().hasOwnerName();
+ Preconditions.checkState(hasOwner || hasQuota, "Either Quota or owner " +
+ "shuould be set in the SetVolumeProperty request");
+ if (omRequest.getSetVolumePropertyRequest().hasQuotaInBytes()) {
+ return new OMVolumeSetQuotaRequest(omRequest);
+ } else if(omRequest.getSetVolumePropertyRequest().hasOwnerName()) {
Review comment:
The 2nd if check is not required. If its not a set quota request, it must be
set owner request.
----------------------------------------------------------------
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]