@Override public Tap getPartitionTap( Tap sink, Partition partition, int openThreshold ) { return new PartitionTap( (Hfs) sink, partition, openThreshold ); }
@Override public Tap getPartitionTap( Tap sink, Partition partition, int openThreshold ) { return new PartitionTap( (Hfs) sink, partition, openThreshold ); }
@Test public void testPartitionedWriteReadHDFS() throws Exception { copyFromLocal( inputFileLhs ); Tap source = new FileTap( new cascading.scheme.local.TextDelimited( new Fields( "num", "char" ), " " ), inputFileLhs ); Hfs original = new Hfs( new TextDelimited( new Fields( "num", "char" ), " " ), getOutputPath( "/intermediate" ), SinkMode.REPLACE ); Tap intermediate = new LocalHfsAdaptor( new PartitionTap( original, new DelimitedPartition( new Fields( "num" ), "/" ) ) ); Tap sink = new FileTap( new cascading.scheme.local.TextDelimited( new Fields( "num", "char" ), " " ), getOutputPath( "/final" ), SinkMode.REPLACE ); Pipe pipe = new Pipe( "test" ); Flow first = new LocalFlowConnector( getPlatform().getProperties() ).connect( source, intermediate, pipe ); first.complete(); validateLength( first, 13 ); Flow second = new LocalFlowConnector( getPlatform().getProperties() ).connect( intermediate, sink, pipe ); second.complete(); validateLength( second, 13 ); } }