bharathv commented on a change in pull request #2322:
URL: https://github.com/apache/hbase/pull/2322#discussion_r479581668



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/LockTimeoutException.java
##########
@@ -0,0 +1,32 @@
+/**
+ *
+ * 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.hbase.client;
+
+import org.apache.hadoop.hbase.HBaseIOException;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/*
+  Thrown whenever we are not able to get the lock within the specified wait 
time.
+ */
[email protected]

Review comment:
       need to be public?

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
##########
@@ -968,6 +968,19 @@ private RegionLocations locateRegionInMeta(TableName 
tableName, byte[] row, bool
     }
   }
 
+  private void takeUserRegionLock() throws IOException {
+    try {
+      long waitTime = connectionConfig.getScannerTimeoutPeriod();
+      if (!userRegionLock.tryLock(waitTime, TimeUnit.MILLISECONDS)) {

Review comment:
       > operation timeout is for 'whole operation end-to-end'
   
   In that case IMO the right fix is to extend the operation timeout to all 
public methods of HTable (may or may not be a part of this change). Looking at 
the code, we do it for some and we skip it for others. One of those methods is 
locateRegion() which is the root caller in this case. 
   
   My concern was from a user configuration POV, there 3 or 4 different 
timeouts a user has to configure (depending on which API they are using) to get 
a proper timeout behavior. Ideally it'd be nice if there is a single timeout at 
the root level that is an e-e timeout and probably other timeouts like scanner 
timeout etc for finer control depending on the need.
   
   Don't mean to block this PR, we can probably implement that as a separate 
change.

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionConfiguration.java
##########
@@ -117,6 +119,11 @@
 
     this.writeRpcTimeout = conf.getInt(HConstants.HBASE_RPC_WRITE_TIMEOUT_KEY,
         conf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, 
HConstants.DEFAULT_HBASE_RPC_TIMEOUT));
+
+    this.scannerTimeoutPeriod = HBaseConfiguration.getInt(conf,

Review comment:
       static getInt() is deprecated, switch to conf.getInt()?




----------------------------------------------------------------
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]


Reply via email to