You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by bo...@apache.org on 2018/05/16 01:47:24 UTC
[drill] 02/02: code review comments
This is an automated email from the ASF dual-hosted git repository.
boaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
commit cfaf430c78dd05f3f33b89008339c6d49f55c0b0
Author: Padma Penumarthy <pp...@yahoo.com>
AuthorDate: Tue May 15 17:58:13 2018 -0700
code review comments
---
.../drill/exec/physical/impl/flatten/FlattenRecordBatch.java | 8 ++++++--
.../drill/exec/physical/impl/join/LateralJoinBatch.java | 10 +++++++---
.../apache/drill/exec/physical/impl/join/MergeJoinBatch.java | 8 ++++++--
.../drill/exec/physical/impl/unnest/UnnestRecordBatch.java | 11 ++++++-----
4 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/flatten/FlattenRecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/flatten/FlattenRecordBatch.java
index 1a56265..be44c94 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/flatten/FlattenRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/flatten/FlattenRecordBatch.java
@@ -157,7 +157,9 @@ public class FlattenRecordBatch extends AbstractSingleRecordBatch<FlattenPOP> {
// i.e. all rows fit within memory budget.
setOutputRowCount(Math.min(columnSize.getElementCount(), getOutputRowCount()));
- logger.debug("BATCH_STATS, incoming:\n {}", getRecordBatchSizer());
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, incoming:\n {}", getRecordBatchSizer());
+ }
updateIncomingStats();
}
@@ -260,7 +262,9 @@ public class FlattenRecordBatch extends AbstractSingleRecordBatch<FlattenPOP> {
flattenMemoryManager.updateOutgoingStats(outputRecords);
- logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ }
// Get the final outcome based on hasRemainder since that will determine if all the incoming records were
// consumed in current output batch or not
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/LateralJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/LateralJoinBatch.java
index b7e40fe..8ea381b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/LateralJoinBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/LateralJoinBatch.java
@@ -637,8 +637,10 @@ public class LateralJoinBatch extends AbstractBinaryRecordBatch<LateralJoinPOP>
container.buildSchema(BatchSchema.SelectionVectorMode.NONE);
batchMemoryManager.updateOutgoingStats(outputIndex);
- logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
- logger.debug("Number of records emitted: " + outputIndex);
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ logger.debug("Number of records emitted: " + outputIndex);
+ }
// Update the output index for next output batch to zero
outputIndex = 0;
@@ -872,7 +874,9 @@ public class LateralJoinBatch extends AbstractBinaryRecordBatch<LateralJoinPOP>
// a new output batch with new incoming then it will not cause any problem since outputIndex will be 0
final int newOutputRowCount = batchMemoryManager.update(inputIndex, outputIndex);
- logger.debug("BATCH_STATS, incoming {}:\n {}", inputIndex == 0 ? "left" : "right", batchMemoryManager.getRecordBatchSizer(inputIndex));
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, incoming {}:\n {}", inputIndex == 0 ? "left" : "right", batchMemoryManager.getRecordBatchSizer(inputIndex));
+ }
if (useMemoryManager) {
maxOutputRowCount = newOutputRowCount;
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
index 2f91b46..9713b70 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
@@ -122,7 +122,9 @@ public class MergeJoinBatch extends AbstractBinaryRecordBatch<MergeJoinPOP> {
@Override
public void update(int inputIndex) {
status.setTargetOutputRowCount(super.update(inputIndex, status.getOutPosition()));
- logger.debug("BATCH_STATS, incoming {}:\n {}", inputIndex == 0 ? "left" : "right", getRecordBatchSizer(inputIndex));
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, incoming {}:\n {}", inputIndex == 0 ? "left" : "right", getRecordBatchSizer(inputIndex));
+ }
}
}
@@ -268,7 +270,9 @@ public class MergeJoinBatch extends AbstractBinaryRecordBatch<MergeJoinPOP> {
vw.getValueVector().getMutator().setValueCount(getRecordCount());
}
- logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ }
batchMemoryManager.updateOutgoingStats(getRecordCount());
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java
index 24b4280..fe91fc3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java
@@ -124,10 +124,9 @@ public class UnnestRecordBatch extends AbstractTableFunctionRecordBatch<UnnestPO
// i.e. all rows fit within memory budget.
setOutputRowCount(Math.min(columnSize.getElementCount(), getOutputRowCount()));
- logger.debug("incoming batch size : {}", getRecordBatchSizer());
-
- logger.debug("output batch size : {}, avg outgoing rowWidth : {}, output rowCount : {}",
- outputBatchSize, avgOutgoingRowWidth, getOutputRowCount());
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, incoming:\n {}", getRecordBatchSizer());
+ }
updateIncomingStats();
}
@@ -301,7 +300,9 @@ public class UnnestRecordBatch extends AbstractTableFunctionRecordBatch<UnnestPO
// entire incoming recods has been unnested. If the entire records has been
// unnested, we return EMIT and any blocking operators in the pipeline will
// unblock.
- logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ if (logger.isDebugEnabled()) {
+ logger.debug("BATCH_STATS, outgoing:\n {}", new RecordBatchSizer(this));
+ }
return hasRemainder ? IterOutcome.OK : IterOutcome.EMIT;
}
--
To stop receiving notification emails like this one, please contact
boaz@apache.org.