@Override public DestinationT getDestination(UserT element) { try { return spec.getDestinationFn().getClosure().apply(element, getContext()); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public OutputT formatRecord(UserT record) { try { return ((Fn<UserT, OutputT>) spec.getOutputFn().getClosure()) .apply(record, getContext()); } catch (Exception e) { throw new RuntimeException(e); } }
final FileNaming namingFn; try { namingFn = spec.getFileNamingFn().getClosure().apply(destination, getContext()); } catch (Exception e) { throw new RuntimeException(e);
return fn( (element, c) -> { FileNaming naming = getFileNamingFn().getClosure().apply(element, c); return getOutputDirectory() == null ? naming
private static FileIO.Write.FileNaming resolveFileNaming(FileIO.Write<?, ?> write) throws Exception { return write.resolveFileNamingFn().getClosure().apply(null, null); }
@ProcessElement public void processElement( @Element InputT element, OutputReceiver<OutputT> receiver, ProcessContext c) throws Exception { receiver.output( fn.getClosure().apply(element, Fn.Context.wrapProcessContext(c))); }