[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298907=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298907
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 21/Aug/19 19:01
Start Date: 21/Aug/19 19:01
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on issue #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#issuecomment-523604746
 
 
   Test failures are not related to this patch.
   Thank You @arp7 and @xiaoyuyao for the review.
   I will commit this to the trunk.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 298907)
Time Spent: 2.5h  (was: 2h 20m)

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>  Components: Ozone Manager
>Reporter: Bharat Viswanadham
>Assignee: Bharat Viswanadham
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.5.0
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> Implement OM RenewDelegationToken request to use OM Cache, double buffer.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298908=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298908
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 21/Aug/19 19:01
Start Date: 21/Aug/19 19:01
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #1316: 
HDDS-1973. Implement OM RenewDelegationToken request to use Cache and 
DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 298908)
Time Spent: 2h 40m  (was: 2.5h)

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>  Components: Ozone Manager
>Reporter: Bharat Viswanadham
>Assignee: Bharat Viswanadham
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.5.0
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Implement OM RenewDelegationToken request to use OM Cache, double buffer.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298850=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298850
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 21/Aug/19 16:50
Start Date: 21/Aug/19 16:50
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on issue #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#issuecomment-523547291
 
 
   +1 from me as well. Seems the CI is broken pending fix from HDDS-1999/2000.  
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 298850)
Time Spent: 2h 20m  (was: 2h 10m)

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>  Components: Ozone Manager
>Reporter: Bharat Viswanadham
>Assignee: Bharat Viswanadham
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Implement OM RenewDelegationToken request to use OM Cache, double buffer.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298397=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298397
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 21/Aug/19 03:14
Start Date: 21/Aug/19 03:14
Worklog Time Spent: 10m 
  Work Description: arp7 commented on pull request #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315983569
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298296=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298296
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 23:05
Start Date: 20/Aug/19 23:05
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#issuecomment-523228861
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 88 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | -1 | test4tests | 0 | The patch doesn't appear to include any new or 
modified tests.  Please justify why no new tests are needed for this patch. 
Also please list what manual steps were performed to verify this patch. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 12 | Maven dependency ordering for branch |
   | -1 | mvninstall | 133 | hadoop-ozone in trunk failed. |
   | -1 | compile | 49 | hadoop-ozone in trunk failed. |
   | +1 | checkstyle | 54 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 963 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 198 | trunk passed |
   | 0 | spotbugs | 245 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | -1 | findbugs | 116 | hadoop-ozone in trunk failed. |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 20 | Maven dependency ordering for patch |
   | -1 | mvninstall | 176 | hadoop-ozone in the patch failed. |
   | -1 | compile | 67 | hadoop-ozone in the patch failed. |
   | -1 | cc | 67 | hadoop-ozone in the patch failed. |
   | -1 | javac | 67 | hadoop-ozone in the patch failed. |
   | +1 | checkstyle | 80 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 907 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 176 | the patch passed |
   | -1 | findbugs | 123 | hadoop-ozone in the patch failed. |
   ||| _ Other Tests _ |
   | +1 | unit | 366 | hadoop-hdds in the patch passed. |
   | -1 | unit | 124 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 31 | The patch does not generate ASF License warnings. |
   | | | 4745 | |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=19.03.1 Server=19.03.1 base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1316 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle cc |
   | uname | Linux da79ce0437dc 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 
08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 269b543 |
   | Default Java | 1.8.0_212 |
   | mvninstall | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/branch-mvninstall-hadoop-ozone.txt
 |
   | compile | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/branch-compile-hadoop-ozone.txt
 |
   | findbugs | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/branch-findbugs-hadoop-ozone.txt
 |
   | mvninstall | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-mvninstall-hadoop-ozone.txt
 |
   | compile | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-compile-hadoop-ozone.txt
 |
   | cc | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-compile-hadoop-ozone.txt
 |
   | javac | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-compile-hadoop-ozone.txt
 |
   | findbugs | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-findbugs-hadoop-ozone.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/testReport/ |
   | Max. process+thread count | 451 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/common hadoop-ozone/ozone-manager U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/3/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298231=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298231
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 22:06
Start Date: 20/Aug/19 22:06
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #1316: 
HDDS-1973. Implement OM RenewDelegationToken request to use Cache and 
DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315924477
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298209=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298209
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 21:31
Start Date: 20/Aug/19 21:31
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315913008
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298180=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298180
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 20:52
Start Date: 20/Aug/19 20:52
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #1316: 
HDDS-1973. Implement OM RenewDelegationToken request to use Cache and 
DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315896339
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298181=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298181
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 20:52
Start Date: 20/Aug/19 20:52
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #1316: 
HDDS-1973. Implement OM RenewDelegationToken request to use Cache and 
DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315896339
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298149=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298149
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 20:30
Start Date: 20/Aug/19 20:30
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315886059
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298146=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298146
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 20:24
Start Date: 20/Aug/19 20:24
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315886059
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
+
+  public OMRenewDelegationTokenRequest(OMRequest omRequest) {
+super(omRequest);
+  }
+
+  @Override
+  public OMRequest preExecute(OzoneManager ozoneManager) throws IOException {
+RenewDelegationTokenRequestProto renewDelegationTokenRequest =
+getOmRequest().getRenewDelegationTokenRequest();
+
+// Call OM to renew token
+long renewTime = ozoneManager.renewDelegationToken(
+OMPBHelper.convertToDelegationToken(
+renewDelegationTokenRequest.getToken()));
+
+RenewDelegationTokenResponseProto.Builder renewResponse =
+RenewDelegationTokenResponseProto.newBuilder();
+
+renewResponse.setResponse(org.apache.hadoop.security.proto.SecurityProtos
+.RenewDelegationTokenResponseProto.newBuilder()
+.setNewExpiryTime(renewTime));
+
+
+// Client issues RenewDelegationToken request, when received by OM leader
+// it will renew the token. Original RenewDelegationToken request is
+// converted to UpdateRenewDelegationToken request with the token and renew
+// information. This updated request will be submitted to Ratis. In this
+// way delegation token renewd by leader, will be replicated across all
+// OMs. With this approach, original RenewDelegationToken request from
+// client does not need any proto changes.
+
+// Create UpdateRenewDelegationTokenRequest with original request and
+// expiry time.
+OMRequest.Builder omRequest = OMRequest.newBuilder()
+.setUserInfo(getUserInfo())
+.setUpdatedRenewDelegationTokenRequest(
+UpdateRenewDelegationTokenRequest.newBuilder()
+.setRenewDelegationTokenRequest(renewDelegationTokenRequest)
+

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=298143=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-298143
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 20:18
Start Date: 20/Aug/19 20:18
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#discussion_r315883423
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMRenewDelegationTokenRequest.java
 ##
 @@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.request.security;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Optional;
+import org.apache.hadoop.ozone.om.OMMetadataManager;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerDoubleBufferHelper;
+import org.apache.hadoop.ozone.om.request.OMClientRequest;
+import org.apache.hadoop.ozone.om.response.OMClientResponse;
+import 
org.apache.hadoop.ozone.om.response.security.OMRenewDelegationTokenResponse;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMResponse;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.RenewDelegationTokenResponseProto;
+import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.UpdateRenewDelegationTokenRequest;
+import org.apache.hadoop.ozone.protocolPB.OMPBHelper;
+import org.apache.hadoop.ozone.security.OzoneTokenIdentifier;
+import 
org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
+import org.apache.hadoop.security.token.Token;
+import org.apache.hadoop.utils.db.cache.CacheKey;
+import org.apache.hadoop.utils.db.cache.CacheValue;
+
+/**
+ * Handle RenewDelegationToken Request.
+ */
+public class OMRenewDelegationTokenRequest extends OMClientRequest {
+
+  private static final Logger LOG =
+  LoggerFactory.getLogger(OMGetDelegationTokenRequest.class);
 
 Review comment:
   This should be OMRenewDelegationTokenRequest.class
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 298143)
Time Spent: 0.5h  (was: 20m)

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>  Components: Ozone Manager
>Reporter: Bharat Viswanadham
>Assignee: Bharat Viswanadham
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Implement OM RenewDelegationToken request to use OM Cache, double buffer.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=297856=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-297856
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 13:17
Start Date: 20/Aug/19 13:17
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#issuecomment-523009957
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 46 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | -1 | test4tests | 0 | The patch doesn't appear to include any new or 
modified tests.  Please justify why no new tests are needed for this patch. 
Also please list what manual steps were performed to verify this patch. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 30 | Maven dependency ordering for branch |
   | +1 | mvninstall | 604 | trunk passed |
   | +1 | compile | 345 | trunk passed |
   | +1 | checkstyle | 60 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 790 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 146 | trunk passed |
   | 0 | spotbugs | 435 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 624 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 18 | Maven dependency ordering for patch |
   | +1 | mvninstall | 548 | the patch passed |
   | +1 | compile | 345 | the patch passed |
   | +1 | cc | 345 | the patch passed |
   | +1 | javac | 345 | the patch passed |
   | +1 | checkstyle | 62 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 628 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 163 | the patch passed |
   | +1 | findbugs | 662 | the patch passed |
   ||| _ Other Tests _ |
   | -1 | unit | 222 | hadoop-hdds in the patch failed. |
   | -1 | unit | 2128 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 39 | The patch does not generate ASF License warnings. |
   | | | 7626 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | hadoop.ozone.container.ozoneimpl.TestOzoneContainer |
   |   | hadoop.ozone.TestMiniChaosOzoneCluster |
   |   | hadoop.ozone.container.server.TestSecureContainerServer |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=19.03.1 Server=19.03.1 base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/2/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1316 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle cc |
   | uname | Linux 6ba1a9cb3234 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 6244502 |
   | Default Java | 1.8.0_222 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/2/artifact/out/patch-unit-hadoop-hdds.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/2/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/2/testReport/ |
   | Max. process+thread count | 4478 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/common hadoop-ozone/ozone-manager U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/2/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 297856)
Time Spent: 20m  (was: 10m)

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop 

[jira] [Work logged] (HDDS-1973) Implement OM RenewDelegationToken request to use Cache and DoubleBuffer

2019-08-19 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HDDS-1973?focusedWorklogId=297576=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-297576
 ]

ASF GitHub Bot logged work on HDDS-1973:


Author: ASF GitHub Bot
Created on: 20/Aug/19 03:12
Start Date: 20/Aug/19 03:12
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #1316: HDDS-1973. 
Implement OM RenewDelegationToken request to use Cache and DoubleBuffer.
URL: https://github.com/apache/hadoop/pull/1316#issuecomment-522835104
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 45 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 1 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | -1 | test4tests | 0 | The patch doesn't appear to include any new or 
modified tests.  Please justify why no new tests are needed for this patch. 
Also please list what manual steps were performed to verify this patch. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 36 | Maven dependency ordering for branch |
   | +1 | mvninstall | 752 | trunk passed |
   | +1 | compile | 396 | trunk passed |
   | +1 | checkstyle | 66 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 880 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 167 | trunk passed |
   | 0 | spotbugs | 418 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 619 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 18 | Maven dependency ordering for patch |
   | +1 | mvninstall | 541 | the patch passed |
   | +1 | compile | 360 | the patch passed |
   | +1 | cc | 360 | the patch passed |
   | +1 | javac | 360 | the patch passed |
   | +1 | checkstyle | 69 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 669 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 154 | the patch passed |
   | +1 | findbugs | 634 | the patch passed |
   ||| _ Other Tests _ |
   | +1 | unit | 313 | hadoop-hdds in the patch passed. |
   | -1 | unit | 1836 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 39 | The patch does not generate ASF License warnings. |
   | | | 7760 | |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=19.03.1 Server=19.03.1 base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/1/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1316 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle cc |
   | uname | Linux ae6cbda13a4f 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 4f925af |
   | Default Java | 1.8.0_222 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/1/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/1/testReport/ |
   | Max. process+thread count | 4820 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/common hadoop-ozone/ozone-manager U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-1316/1/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 297576)
Remaining Estimate: 0h
Time Spent: 10m

> Implement OM RenewDelegationToken request to use Cache and DoubleBuffer
> ---
>
> Key: HDDS-1973
> URL: https://issues.apache.org/jira/browse/HDDS-1973
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>  Components: Ozone Manager
>Reporter: Bharat Viswanadham
>Assignee: Bharat Viswanadham
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Implement OM RenewDelegationToken