如何在 Windows 上使用 Eclipse 执行级联应用程序
How to execute Cascading app using Eclipse on Windows
我已经从 Git Hub 克隆了 Cascading for the Impatient
。
我用运行gradle
命令创建jar文件。
如果没有 Hadoop cluster
是否可以 运行 使用 Eclipse 的程序?
我是否必须为 运行 Eclipse 中的 Cascading
应用程序设置任何额外的配置?
当我们运行来自eclipse的级联程序或使用本地文件系统时,我们需要使用LocalFlowConnector
。
示例代码:
Properties properties = new Properties();
AppProps.setApplicationJarClass(properties, TestCascading.class);
FlowConnector flowConnector = new LocalFlowConnector();
// create the source tap
FileTap inTap = new FileTap(new TextLine(), "C://Users//rain.txt");
// create the sink tap
FileTap outTap = new FileTap(new TextLine(), "C://Users//out.txt");
// specify a pipe to connect the taps
Pipe copyPipe = new Pipe("copy");
// connect the taps, pipes, etc., into a flow
FlowDef flowDef = FlowDef.flowDef().addSource(copyPipe, inTap).addTailSink(copyPipe, outTap);
// run the flow
Flow flow = flowConnector.connect(flowDef);
flow.complete();
我已经从 Git Hub 克隆了 Cascading for the Impatient
。
我用运行gradle
命令创建jar文件。
如果没有 Hadoop cluster
是否可以 运行 使用 Eclipse 的程序?
我是否必须为 运行 Eclipse 中的 Cascading
应用程序设置任何额外的配置?
当我们运行来自eclipse的级联程序或使用本地文件系统时,我们需要使用LocalFlowConnector
。
示例代码:
Properties properties = new Properties();
AppProps.setApplicationJarClass(properties, TestCascading.class);
FlowConnector flowConnector = new LocalFlowConnector();
// create the source tap
FileTap inTap = new FileTap(new TextLine(), "C://Users//rain.txt");
// create the sink tap
FileTap outTap = new FileTap(new TextLine(), "C://Users//out.txt");
// specify a pipe to connect the taps
Pipe copyPipe = new Pipe("copy");
// connect the taps, pipes, etc., into a flow
FlowDef flowDef = FlowDef.flowDef().addSource(copyPipe, inTap).addTailSink(copyPipe, outTap);
// run the flow
Flow flow = flowConnector.connect(flowDef);
flow.complete();