@Test public void testInvalidNumberOfCopies() { CloneRecord.Config config = new CloneRecord.Config(0); Transform<StructuredRecord, StructuredRecord> transform = new CloneRecord(config); MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT); transform.configurePipeline(mockPipelineConfigurer); MockFailureCollector failureCollector = (MockFailureCollector) mockPipelineConfigurer.getStageConfigurer().getFailureCollector(); Assert.assertEquals(1, failureCollector.getValidationFailures().size()); }
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); config.validate(pipelineConfigurer.getStageConfigurer().getFailureCollector()); pipelineConfigurer.getStageConfigurer().setOutputSchema(pipelineConfigurer.getStageConfigurer().getInputSchema()); }
CloneRecord extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); config.validate(pipelineConfigurer.getStageConfigurer().getFailureCollector()); pipelineConfigurer.getStageConfigurer().setOutputSchema(pipelineConfigurer.getStageConfigurer().getInputSchema()); } }
CloneRecord extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); config.validate(pipelineConfigurer.getStageConfigurer().getFailureCollector()); pipelineConfigurer.getStageConfigurer().setOutputSchema(pipelineConfigurer.getStageConfigurer().getInputSchema()); } CloneRecord(Config config); }
CloneRecord extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); config.validate(pipelineConfigurer.getStageConfigurer().getFailureCollector()); pipelineConfigurer.getStageConfigurer().setOutputSchema(pipelineConfigurer.getStageConfigurer().getInputSchema()); } CloneRecord(Config config); @Override void configurePipeline(PipelineConfigurer pipelineConfigurer); @Override void prepareRun(StageSubmitterContext context); @Override void initialize(TransformContext context); @Override void transform(StructuredRecord in, Emitter<StructuredRecord> emitter); }
CloneRecord extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); config.validate(pipelineConfigurer.getStageConfigurer().getFailureCollector()); pipelineConfigurer.getStageConfigurer().setOutputSchema(pipelineConfigurer.getStageConfigurer().getInputSchema()); } CloneRecord(Config config); @Override void configurePipeline(PipelineConfigurer pipelineConfigurer); @Override void prepareRun(StageSubmitterContext context); @Override void initialize(TransformContext context); @Override void transform(StructuredRecord in, Emitter<StructuredRecord> emitter);  }