/** * Constructor Dfs creates a new Dfs instance. * * @param scheme of type Scheme * @param uri of type URI */ @ConstructorProperties({"scheme", "uri"}) public Dfs( Scheme scheme, URI uri ) { super( scheme, uri.getPath() ); init( uri ); }
private void init( URI uri ) { if( !uri.getScheme().equalsIgnoreCase( "hdfs" ) ) throw new IllegalArgumentException( "uri must use the hdfs scheme" ); setUriScheme( URI.create( uri.getScheme() + "://" + uri.getAuthority() ) ); }
Tap tap = new Dfs( new SequenceFile( new Fields( "foo" ) ), "some/path" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), "hdfs://localhost:5001/some/path" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), new URI( "hdfs://localhost:5001/some/path" ) ); new Dfs( new SequenceFile( new Fields( "foo" ) ), "s3://localhost:5001/some/path" ); fail( "not valid url" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), new URI( "s3://localhost:5001/some/path" ) ); fail( "not valid url" );
Tap tap = new Dfs( new SequenceFile( new Fields( "foo" ) ), "some/path" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), "hdfs://localhost:5001/some/path" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), new URI( "hdfs://localhost:5001/some/path" ) ); new Dfs( new SequenceFile( new Fields( "foo" ) ), "s3://localhost:5001/some/path" ); fail( "not valid url" ); new Dfs( new SequenceFile( new Fields( "foo" ) ), new URI( "s3://localhost:5001/some/path" ) ); fail( "not valid url" );
/** * Constructor Dfs creates a new Dfs instance. * * @param scheme of type Scheme * @param uri of type URI */ @ConstructorProperties({"scheme", "uri"}) public Dfs( Scheme scheme, URI uri ) { super( scheme, uri.getPath() ); init( uri ); }
private void init( URI uri ) { if( !uri.getScheme().equalsIgnoreCase( "hdfs" ) ) throw new IllegalArgumentException( "uri must use the hdfs scheme" ); setUriScheme( URI.create( uri.getScheme() + "://" + uri.getAuthority() ) ); }
/** * Constructor Dfs creates a new Dfs instance. * * @param scheme of type Scheme * @param uri of type URI * @param sinkMode of type SinkMode */ @ConstructorProperties({"scheme", "uri", "sinkMode"}) public Dfs( Scheme scheme, URI uri, SinkMode sinkMode ) { super( scheme, uri.getPath(), sinkMode ); init( uri ); }
/** * Constructor Dfs creates a new Dfs instance. * * @param scheme of type Scheme * @param uri of type URI * @param sinkMode of type SinkMode */ @ConstructorProperties({"scheme", "uri", "sinkMode"}) public Dfs( Scheme scheme, URI uri, SinkMode sinkMode ) { super( scheme, uri.getPath(), sinkMode ); init( uri ); }