@Override public void sink(FlowProcess<JobConf> prcs, SinkCall<Object[], OutputCollector> sc) throws IOException { throw new TapException("cannot use as a sink"); } }
/** * Constructor TapException creates a new TapException instance. * * @param tap of type Tap * @param incomingFields of type Fields * @param selectorFields of type Fields * @param throwable of type Throwable */ public TapException( Tap tap, Fields incomingFields, Fields selectorFields, Throwable throwable ) { super( createMessage( tap, incomingFields, selectorFields ), throwable ); }
if( cause instanceof TapException && ( (TapException) cause ).getPayload() != null ) payload = new TupleEntry( Fields.UNKNOWN, ( (TapException) cause ).getPayload() );
@Override public void sinkConfInit(FlowProcess<JobConf> prcs, Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf) { throw new TapException("cannot use as a sink"); }
@Override public void sourceConfInit(FlowProcess<Properties> flowProcess, Tap<Properties, InputStream, OutputStream> tap, Properties conf) { throw new TapException("SolrScheme can only be used as a sink, not a source"); }
@Override public boolean source(FlowProcess<Properties> conf, SourceCall<Void, InputStream> sourceCall) throws IOException { throw new TapException("SolrScheme can only be used as a sink, not a source"); }
@Override public boolean source(FlowProcess<JobConf> conf, SourceCall<Object[], RecordReader<Tuple, Tuple>> sourceCall) throws IOException { throw new TapException("SolrScheme can only be used as a sink, not a source"); }
@Override public void sourceConfInit(FlowProcess<JobConf> flowProcess, Tap<JobConf, RecordReader<Tuple, Tuple>, OutputCollector<Tuple, Tuple>> tap, JobConf conf) { throw new TapException("SolrScheme can only be used as a sink, not a source"); }
protected FileSystem getDefaultFileSystem( Configuration configuration ) { try { return FileSystem.get( configuration ); } catch( IOException exception ) { throw new TapException( "unable to get handle to underlying filesystem", exception ); } }
@Override protected FileSystem getFileSystem( Configuration conf ) { try { return FileSystem.getLocal( conf ); } catch( IOException exception ) { throw new TapException( "unable to get handle to get local filesystem", exception ); } } }
protected FileSystem getDefaultFileSystem( Configuration configuration ) { try { return FileSystem.get( configuration ); } catch( IOException exception ) { throw new TapException( "unable to get handle to underlying filesystem", exception ); } }
@Override protected FileSystem getFileSystem( Configuration conf ) { try { return FileSystem.getLocal( conf ); } catch( IOException exception ) { throw new TapException( "unable to get handle to get local filesystem", exception ); } } }
public LineNumberReader createInput( InputStream inputStream ) { try { return new LineNumberReader( new InputStreamReader( inputStream, charsetName ) ); } catch( UnsupportedEncodingException exception ) { throw new TapException( exception ); } }
public LineNumberReader createInput( InputStream inputStream ) { try { return new LineNumberReader( new InputStreamReader( inputStream, charsetName ) ); } catch( UnsupportedEncodingException exception ) { throw new TapException( exception ); } }
public PrintWriter createOutput( OutputStream outputStream ) { try { return new PrintWriter( new OutputStreamWriter( outputStream, charsetName ) ); } catch( UnsupportedEncodingException exception ) { throw new TapException( exception ); } }
public PrintWriter createOutput( OutputStream outputStream ) { try { return new PrintWriter( new OutputStreamWriter( outputStream, charsetName ) ); } catch( UnsupportedEncodingException exception ) { throw new TapException( exception ); } }
protected FileSystem getFileSystem( Configuration configuration ) { URI scheme = getURIScheme( configuration ); try { return FileSystem.get( scheme, configuration ); } catch( IOException exception ) { throw new TapException( "unable to get handle to get filesystem for: " + scheme.getScheme(), exception ); } }
protected Output wrapOutput( Output output ) { try { return scheme.sinkWrap( flowProcess, output ); } catch( IOException exception ) { throw new TapException( "could not wrap scheme", exception ); } }
@Override public OutputStream outputStream( OutputStream outputStream ) throws IOException { try { return factory.createCompressorOutputStream( algorithm, outputStream ); } catch( CompressorException exception ) { throw new TapException( exception ); } }
protected TapWith<Properties, InputStream, OutputStream> create( Scheme<Properties, InputStream, OutputStream, ?, ?> scheme, Path path, SinkMode sinkMode ) { try { return Util.newInstance( getClass(), new Object[]{scheme, path, sinkMode} ); } catch( CascadingException exception ) { throw new TapException( "unable to create a new instance of: " + getClass().getName(), exception ); } }