|
34 | 34 | import org.apache.beam.sdk.coders.InstantCoder; |
35 | 35 | import org.apache.beam.sdk.coders.NullableCoder; |
36 | 36 | import org.apache.beam.sdk.coders.SerializableCoder; |
| 37 | +import org.apache.beam.sdk.coders.SnappyCoder; |
37 | 38 | import org.apache.beam.sdk.coders.StructuredCoder; |
38 | 39 | import org.apache.beam.sdk.io.UnboundedSource.CheckpointMark; |
39 | 40 | import org.apache.beam.sdk.io.UnboundedSource.CheckpointMark.NoopCheckpointMark; |
@@ -148,7 +149,7 @@ public final PCollection<T> expand(PBegin input) { |
148 | 149 | .getPipeline() |
149 | 150 | .apply(Impulse.create()) |
150 | 151 | .apply(ParDo.of(new OutputSingleSource<>(source))) |
151 | | - .setCoder(SerializableCoder.of(new TypeDescriptor<BoundedSource<T>>() {})) |
| 152 | + .setCoder(SnappyCoder.of(SerializableCoder.of(new TypeDescriptor<BoundedSource<T>>() {}))) |
152 | 153 | .apply(ParDo.of(new BoundedSourceAsSDFWrapperFn<>())) |
153 | 154 | .setCoder(source.getOutputCoder()) |
154 | 155 | .setTypeDescriptor(source.getOutputCoder().getEncodedTypeDescriptor()); |
@@ -216,7 +217,9 @@ public final PCollection<T> expand(PBegin input) { |
216 | 217 | .apply(Impulse.create()) |
217 | 218 | .apply(ParDo.of(new OutputSingleSource<>(source))) |
218 | 219 | .setCoder( |
219 | | - SerializableCoder.of(new TypeDescriptor<UnboundedSource<T, CheckpointMark>>() {})) |
| 220 | + SnappyCoder.of( |
| 221 | + SerializableCoder.of( |
| 222 | + new TypeDescriptor<UnboundedSource<T, CheckpointMark>>() {}))) |
220 | 223 | .apply(ParDo.of(createUnboundedSdfWrapper())) |
221 | 224 | .setCoder(ValueWithRecordIdCoder.of(source.getOutputCoder())); |
222 | 225 |
|
@@ -314,7 +317,7 @@ public void processElement( |
314 | 317 |
|
315 | 318 | @GetRestrictionCoder |
316 | 319 | public Coder<BoundedSourceT> restrictionCoder() { |
317 | | - return SerializableCoder.of(new TypeDescriptor<BoundedSourceT>() {}); |
| 320 | + return SnappyCoder.of(SerializableCoder.of(new TypeDescriptor<BoundedSourceT>() {})); |
318 | 321 | } |
319 | 322 |
|
320 | 323 | /** |
@@ -600,9 +603,10 @@ public WatermarkEstimators.Manual newWatermarkEstimator( |
600 | 603 |
|
601 | 604 | @GetRestrictionCoder |
602 | 605 | public Coder<UnboundedSourceRestriction<OutputT, CheckpointT>> restrictionCoder() { |
603 | | - return new UnboundedSourceRestrictionCoder<>( |
604 | | - SerializableCoder.of(new TypeDescriptor<UnboundedSource<OutputT, CheckpointT>>() {}), |
605 | | - NullableCoder.of(checkpointCoder)); |
| 606 | + return SnappyCoder.of( |
| 607 | + new UnboundedSourceRestrictionCoder<>( |
| 608 | + SerializableCoder.of(new TypeDescriptor<UnboundedSource<OutputT, CheckpointT>>() {}), |
| 609 | + NullableCoder.of(checkpointCoder))); |
606 | 610 | } |
607 | 611 |
|
608 | 612 | /** |
|
0 commit comments