Guest User

Untitled

a guest
Oct 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public class
  2. Main
  3. {
  4. public static void
  5. main( String[] args )
  6. {
  7. String inPath = args[ 0 ];
  8. String outPath = args[ 1 ];
  9.  
  10. Properties properties = new Properties();
  11. AppProps.setApplicationJarClass( properties, Main.class );
  12. HadoopFlowConnector flowConnector = new HadoopFlowConnector( properties );
  13.  
  14. // create the source tap
  15. Tap inTap = new Hfs( new TextDelimited( true, "\t" ), inPath );
  16.  
  17. // create the sink tap
  18. Tap outTap = new Hfs( new TextDelimited( true, "\t" ), outPath );
  19.  
  20. // specify a pipe to connect the taps
  21. Pipe copyPipe = new Pipe( "copy" );
  22.  
  23. // connect the taps, pipes, etc., into a flow
  24. FlowDef flowDef = FlowDef.flowDef()
  25. .addSource( copyPipe, inTap )
  26. .addTailSink( copyPipe, outTap );
  27.  
  28. // run the flow
  29. flowConnector.connect( flowDef ).complete();
  30. }
  31. }
Add Comment
Please, Sign In to add comment