Skip to content

Commit db1f0ee

Browse files
authored
[Dataflow] Remove unused PhysicalElementCount Counter (#34461)
1 parent 604e335 commit db1f0ee

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowOutputCounter.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@
2828
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
2929

3030
/**
31-
* A Dataflow-specific version of {@link ElementCounter}, which specifies the object counter name
32-
* differently as PhysicalElementCount. Additionally, it counts element windows as ElementCount.
31+
* A Dataflow-specific version of {@link ElementCounter}. It counts element windows as ElementCount.
3332
*/
3433
@SuppressWarnings({
3534
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
3635
})
3736
public class DataflowOutputCounter implements ElementCounter {
38-
/** Number of physical element and multiple-window assignments that were serialized/processed. */
39-
private static final String OBJECT_COUNTER_NAME = "-PhysicalElementCount";
4037
/** Number of logical element and single window pairs that were processed. */
4138
private static final String ELEMENT_COUNTER_NAME = "-ElementCount";
4239

@@ -57,7 +54,6 @@ public DataflowOutputCounter(
5754
NameContext nameContext) {
5855
objectAndByteCounter =
5956
new OutputObjectAndByteCounter(elementByteSizeObservable, counterFactory, nameContext);
60-
objectAndByteCounter.countObject(outputName + OBJECT_COUNTER_NAME);
6157
objectAndByteCounter.countMeanByte(outputName + MEAN_BYTE_COUNTER_NAME);
6258
createElementCounter(counterFactory, outputName + ELEMENT_COUNTER_NAME);
6359
}
@@ -86,11 +82,6 @@ static String getElementCounterName(String prefix) {
8682
return prefix + ELEMENT_COUNTER_NAME;
8783
}
8884

89-
@VisibleForTesting
90-
static String getObjectCounterName(String prefix) {
91-
return prefix + OBJECT_COUNTER_NAME;
92-
}
93-
9485
@VisibleForTesting
9586
static String getMeanByteCounterName(String prefix) {
9687
return prefix + MEAN_BYTE_COUNTER_NAME;

runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/IntrinsicMapTaskExecutorFactoryTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.apache.beam.runners.dataflow.util.Structs.addString;
2121
import static org.apache.beam.runners.dataflow.worker.DataflowOutputCounter.getElementCounterName;
2222
import static org.apache.beam.runners.dataflow.worker.DataflowOutputCounter.getMeanByteCounterName;
23-
import static org.apache.beam.runners.dataflow.worker.DataflowOutputCounter.getObjectCounterName;
2423
import static org.apache.beam.runners.dataflow.worker.counters.CounterName.named;
2524
import static org.apache.beam.sdk.util.SerializableUtils.serializeToByteArray;
2625
import static org.apache.beam.sdk.util.StringUtils.byteArrayToJsonString;
@@ -242,8 +241,6 @@ private static void verifyOutputCounters(
242241
for (String outputName : outputNames) {
243242
verify(updateExtractor)
244243
.longSum(eq(named(getElementCounterName(outputName))), anyBoolean(), anyLong());
245-
verify(updateExtractor)
246-
.longSum(eq(named(getObjectCounterName(outputName))), anyBoolean(), anyLong());
247244
verify(updateExtractor)
248245
.longMean(
249246
eq(named(getMeanByteCounterName(outputName))),

0 commit comments

Comments
 (0)