diff options
author | Sudheesh Katkam <skatkam@maprtech.com> | 2015-04-17 09:46:11 -0700 |
---|---|---|
committer | Parth Chandra <pchandra@maprtech.com> | 2015-04-20 19:58:53 -0700 |
commit | be8d953935461ee6567b0c4d96c503e8b04469d2 (patch) | |
tree | 54ac5b816958d0f089215be4fc6e93ab223dc880 /exec/java-exec/src/main/java/org/apache/drill/exec/client | |
parent | 21dfe7ac81f3d6c6b2b27812a8b21023ebd7860e (diff) |
DRILL-2383: Support to inject exceptions and pauses in various components of Drill
+ Controls are fired only if assertions are enabled
+ Controls can be introduced in any class that has access to FragmentContext/QueryContext
+ Controls can be fired by altering the DRILLBIT_CONTROL_INJECTIONS session option
+ Renames: SimulatedExceptions => ExecutionControls, ExceptionInjector => ExecutionControlsInjector
+ Added injection sites in Foreman, DrillSqlWorker, FragmentExecutor
+ Unit tests in TestDrillbitResilience, TestExceptionInjection and TestPauseInjection
Other commits included:
+ DRILL-2437: Moved ExecutionControls from DrillbitContext to FragmentContext/QueryContext
+ DRILL-2382: Added address and port to Injection to specify drillbit
+ DRILL-2384: Added QueryState to SingleRowListener and assert that state is COMPLETED while testing
Other edits:
+ Support for short lived session options in SessionOptionManager (using TTL in OptionValidator)
+ Introduced query count in UserSession
+ Added QueryState to queryCompleted() in UserResultsListener to check if COMPLETED/CANCELED
+ Added JSONStringValidator to TypeValidators
+ Log query id as string in DrillClient, WorkEventBus, QueryResultHandler
+ Use try..catch block only around else clause for OptionList in FragmentContext
+ Fixed drillbitContext spelling error in QueryContext
+ Fixed state transition when cancel() before run() in FragmentExecutor
+ Do not call setLocalOption twice in FallbackOptionManager
+ Show explicitly that submitWork() returns queryId in UserServer
+ Updated protocol/readme.txt to include an alternative way to generate sources
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/client')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java | 7 | ||||
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java index 336a14948..0d29f600f 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java @@ -43,6 +43,7 @@ import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint; import org.apache.drill.exec.proto.GeneralRPCProtos.Ack; import org.apache.drill.exec.proto.UserBitShared; import org.apache.drill.exec.proto.UserBitShared.QueryId; +import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; import org.apache.drill.exec.proto.UserBitShared.QueryType; import org.apache.drill.exec.proto.UserProtos; import org.apache.drill.exec.proto.UserProtos.Property; @@ -326,7 +327,7 @@ public class DrillClient implements Closeable, ConnectionThrottle { } @Override - public void queryCompleted() { + public void queryCompleted(QueryState state) { future.set(results); } @@ -352,7 +353,9 @@ public class DrillClient implements Closeable, ConnectionThrottle { @Override public void queryIdArrived(QueryId queryId) { - logger.debug( "Query ID arrived: {}", queryId ); + if (logger.isDebugEnabled()) { + logger.debug("Query ID arrived: {}", QueryIdHelper.getQueryId(queryId)); + } } } diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java index 2bf35b1bc..64e726609 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/PrintingResultsListener.java @@ -29,6 +29,7 @@ import org.apache.drill.exec.memory.BufferAllocator; import org.apache.drill.exec.memory.TopLevelAllocator; import org.apache.drill.exec.proto.UserBitShared.QueryId; import org.apache.drill.exec.proto.UserBitShared.QueryData; +import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; import org.apache.drill.exec.record.RecordBatchLoader; import org.apache.drill.exec.rpc.user.ConnectionThrottle; import org.apache.drill.exec.rpc.user.QueryDataBatch; @@ -60,7 +61,7 @@ public class PrintingResultsListener implements UserResultsListener { } @Override - public void queryCompleted() { + public void queryCompleted(QueryState state) { allocator.close(); latch.countDown(); System.out.println("Total rows returned: " + count.get()); |