@Test public void testSchemaValidation() throws Exception { Transform<StructuredRecord, StructuredRecord> transform = new Hasher(new Hasher.Config("SHA512", "a,b,e")); MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT); transform.configurePipeline(mockPipelineConfigurer); Assert.assertEquals(INPUT, mockPipelineConfigurer.getOutputSchema()); }
@Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); config.validate(stageConfigurer.getInputSchema(), stageConfigurer.getFailureCollector()); stageConfigurer.getFailureCollector().getOrThrowException(); stageConfigurer.setOutputSchema(stageConfigurer.getInputSchema()); }
Hasher extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); config.validate(stageConfigurer.getInputSchema(), stageConfigurer.getFailureCollector()); stageConfigurer.getFailureCollector().getOrThrowException(); stageConfigurer.setOutputSchema(stageConfigurer.getInputSchema()); } }
Hasher extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); config.validate(stageConfigurer.getInputSchema(), stageConfigurer.getFailureCollector()); stageConfigurer.getFailureCollector().getOrThrowException(); stageConfigurer.setOutputSchema(stageConfigurer.getInputSchema()); } Hasher(Config config); }
Hasher extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); config.validate(stageConfigurer.getInputSchema(), stageConfigurer.getFailureCollector()); stageConfigurer.getFailureCollector().getOrThrowException(); stageConfigurer.setOutputSchema(stageConfigurer.getInputSchema()); } Hasher(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); }
Hasher extends Transform<StructuredRecord, StructuredRecord> { @Override public void configurePipeline(PipelineConfigurer pipelineConfigurer) { StageConfigurer stageConfigurer = pipelineConfigurer.getStageConfigurer(); config.validate(stageConfigurer.getInputSchema(), stageConfigurer.getFailureCollector()); stageConfigurer.getFailureCollector().getOrThrowException(); stageConfigurer.setOutputSchema(stageConfigurer.getInputSchema()); } Hasher(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);  }