File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
main/java/org/apache/hadoop/hbase/client
test/java/org/apache/hadoop/hbase/client Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,8 @@ public class ConnectionConfiguration {
121
121
WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS , WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS_DEFAULT );
122
122
123
123
this .metaOperationTimeout = conf .getInt (HConstants .HBASE_CLIENT_META_OPERATION_TIMEOUT ,
124
- HConstants .DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT );
124
+ conf .getInt (HConstants .HBASE_CLIENT_OPERATION_TIMEOUT ,
125
+ HConstants .DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT ));
125
126
126
127
this .operationTimeout = conf .getInt (HConstants .HBASE_CLIENT_OPERATION_TIMEOUT ,
127
128
HConstants .DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT );
Original file line number Diff line number Diff line change 32
32
import org .junit .experimental .categories .Category ;
33
33
34
34
/**
35
- * See HBASE-24513.
35
+ * See HBASE-24513, HBASE-28608 .
36
36
*/
37
37
@ Category ({ ClientTests .class , SmallTests .class })
38
38
public class TestAsyncConnectionConfiguration {
@@ -69,4 +69,16 @@ public void testDefaultReadWriteRpcTimeout() {
69
69
assertEquals (expected , config .getReadRpcTimeoutNs ());
70
70
assertEquals (expected , config .getWriteRpcTimeoutNs ());
71
71
}
72
+
73
+ @ Test
74
+ public void testDefaultMetaOperationTimeout () {
75
+ Configuration conf = HBaseConfiguration .create ();
76
+ long timeoutMs = 1000 ;
77
+ conf .setLong (HConstants .HBASE_CLIENT_OPERATION_TIMEOUT , timeoutMs );
78
+ AsyncConnectionConfiguration config = new AsyncConnectionConfiguration (conf );
79
+ long expected = TimeUnit .MILLISECONDS .toNanos (timeoutMs );
80
+ assertEquals (expected , config .getOperationTimeoutNs ());
81
+ assertEquals (expected , config .getMetaOperationTimeoutNs ());
82
+ }
83
+
72
84
}
Original file line number Diff line number Diff line change 22
22
23
23
import org .apache .hadoop .conf .Configuration ;
24
24
import org .apache .hadoop .hbase .HBaseClassTestRule ;
25
+ import org .apache .hadoop .hbase .HBaseConfiguration ;
25
26
import org .apache .hadoop .hbase .HConstants ;
26
27
import org .apache .hadoop .hbase .testclassification .ClientTests ;
27
28
import org .apache .hadoop .hbase .testclassification .SmallTests ;
@@ -51,4 +52,15 @@ public void itHandlesDeprecatedPauseForCQTBE() {
51
52
config = new ConnectionConfiguration (conf );
52
53
assertEquals (timeoutMs , config .getPauseMillisForServerOverloaded ());
53
54
}
55
+
56
+ @ Test
57
+ public void testDefaultMetaOperationTimeout () {
58
+ Configuration conf = HBaseConfiguration .create ();
59
+ long clientOperationTimeoutMs = 1000 ;
60
+ conf .setLong (HConstants .HBASE_CLIENT_OPERATION_TIMEOUT , clientOperationTimeoutMs );
61
+ ConnectionConfiguration config = new ConnectionConfiguration (conf );
62
+ assertEquals (clientOperationTimeoutMs , config .getOperationTimeout ());
63
+ assertEquals (clientOperationTimeoutMs , config .getMetaOperationTimeout ());
64
+ }
65
+
54
66
}
You can’t perform that action at this time.
0 commit comments