aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main/java/org/apache/drill/exec/rpc
diff options
context:
space:
mode:
authorVlad Rozov <vrozov@apache.org>2018-03-13 10:56:52 -0700
committerVitalii Diravka <vitalii.diravka@gmail.com>2018-03-24 20:35:32 +0200
commit590a72bc667f6bc373130bcae58c22c11f13edaf (patch)
tree1616152871e0a54d22474c1df19cffde10d7e6fe /exec/java-exec/src/main/java/org/apache/drill/exec/rpc
parent9327ca65ac100ec6959d2180ba79fbb10ab7d6c6 (diff)
DRILL-6053: Avoid excessive locking in LocalPersistentStore
closes #1163
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/rpc')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/CustomHandlerRegistry.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/CustomHandlerRegistry.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/CustomHandlerRegistry.java
index 7a2bd0411..97e855c3d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/CustomHandlerRegistry.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/CustomHandlerRegistry.java
@@ -23,6 +23,7 @@ import io.netty.buffer.DrillBuf;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.apache.drill.common.AutoCloseables.Closeable;
import org.apache.drill.common.concurrent.AutoCloseableLock;
import org.apache.drill.exec.proto.BitControl.CustomMessage;
import org.apache.drill.exec.proto.BitControl.RpcType;
@@ -60,7 +61,7 @@ public class CustomHandlerRegistry {
Preconditions.checkNotNull(handler);
Preconditions.checkNotNull(requestSerde);
Preconditions.checkNotNull(responseSerde);
- try (AutoCloseableLock lock = write.open()) {
+ try (@SuppressWarnings("unused") Closeable lock = write.open()) {
ParsingHandler<?, ?> parsingHandler = handlers.get(messageTypeId);
if (parsingHandler != null) {
throw new IllegalStateException(String.format(
@@ -76,7 +77,7 @@ public class CustomHandlerRegistry {
public Response handle(CustomMessage message, DrillBuf dBody) throws RpcException {
final ParsingHandler<?, ?> handler;
- try (AutoCloseableLock lock = read.open()) {
+ try (@SuppressWarnings("unused") Closeable lock = read.open()) {
handler = handlers.get(message.getType());
}