@Override public void open(Configuration parameters) throws Exception { super.open(parameters); }
@Override public void close() throws Exception { outputFormat.close(); super.close(); } }
@Override public void setRuntimeContext(RuntimeContext context) { super.setRuntimeContext(context); if (format instanceof RichOutputFormat) { ((RichOutputFormat) format).setRuntimeContext(context); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); partCounter = 0; this.writer = writerTemplate.duplicate(); bucketState = new BucketState(); }
@Override public void close() throws Exception { super.close(); } }).setParallelism(1);
@Override public void setRuntimeContext(RuntimeContext context) { super.setRuntimeContext(context); if (format instanceof RichOutputFormat) { ((RichOutputFormat) format).setRuntimeContext(context); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); this.client = new SiteToSiteClient.Builder().fromConfig(clientConfig).build(); }
@Override public void close() throws Exception { super.close(); client.close(); }
@Override public void setRuntimeContext(RuntimeContext context) { super.setRuntimeContext(context); if (format instanceof RichOutputFormat) { ((RichOutputFormat) format).setRuntimeContext(context); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask(); dos = new DataOutputStream( new BufferedOutputStream( new FileOutputStream(allPartitions.get(subtaskIdx)))); }
@Override public void close() throws Exception { super.close(); if (currentTransactionHolder != null) { abort(currentTransactionHolder.handle); currentTransactionHolder = null; } }
@Override public void setRuntimeContext(RuntimeContext context) { super.setRuntimeContext(context); if (format instanceof RichOutputFormat) { ((RichOutputFormat) format).setRuntimeContext(context); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); StreamingRuntimeContext context = (StreamingRuntimeContext) getRuntimeContext(); writer.open(context.getIndexOfThisSubtask(), context.getNumberOfParallelSubtasks()); }
@Override public void close() throws Exception { super.close(); }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); this.processingTimeService = ((StreamingRuntimeContext) getRuntimeContext()).getProcessingTimeService(); long currentProcessingTime = processingTimeService.getCurrentProcessingTime(); processingTimeService.registerTimer(currentProcessingTime + bucketCheckInterval, this); }
@Override public void close() { try { super.close(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); RuntimeContext ctx = getRuntimeContext(); outputFormat.setRuntimeContext(ctx); outputFormat.open(ctx.getIndexOfThisSubtask(), ctx.getNumberOfParallelSubtasks()); }
@Override public void close() throws Exception { super.close(); dos.close(); }
@Override public void open(Configuration parameters) throws Exception { super.open(parameters); state = new State<>(); processingTimeService = ((StreamingRuntimeContext) getRuntimeContext()).getProcessingTimeService(); long currentProcessingTime = processingTimeService.getCurrentProcessingTime(); processingTimeService.registerTimer(currentProcessingTime + inactiveBucketCheckInterval, this); this.clock = new Clock() { @Override public long currentTimeMillis() { return processingTimeService.getCurrentProcessingTime(); } }; }
@Override public void close() throws Exception { Assert.assertEquals(expectedSum, runningSum); super.close(); }