From 8698925e0303ccf1c42bb46c74e15fb6b39b1dbf Mon Sep 17 00:00:00 2001 From: zhaowei8188127 <18810460332@163.com> Date: Thu, 6 Jun 2013 15:59:00 +0800 Subject: [PATCH] change java7 to java6 --- haflow.module.jar | Bin 1416 -> 1419 bytes maven-install/haflow-demo-module.jar | Bin 0 -> 11815 bytes ...ava7-module.pom => haflow-demo-module.pom} | 7 +- maven-install/java7-module.jar | Bin 11954 -> 0 bytes pom.xml | 29 +++--- .../java/haflow/hdfs/client/HdfsHelper.java | 13 +-- .../haflow/hdfs/client/HdfsStaticHelper.java | 49 +++++++--- .../haflow/hdfs/client/TestClassPath.java | 8 +- .../{JavaClient.java => OozieHelper.java} | 17 +++- .../haflow/service/FlowDeployService.java | 92 +++++++++++++++++- .../haflow/service/FlowExecuteService.java | 43 ++++---- .../service/FlowExecuteServiceTest.java | 4 - .../java/haflow/utility/ModuleLoader.java | 10 +- src/main/resources/hibernate.cfg.xml | 4 +- 14 files changed, 197 insertions(+), 79 deletions(-) create mode 100644 maven-install/haflow-demo-module.jar rename maven-install/{java7-module.pom => haflow-demo-module.pom} (69%) delete mode 100644 maven-install/java7-module.jar rename src/main/java/haflow/oozie/client/{JavaClient.java => OozieHelper.java} (79%) diff --git a/haflow.module.jar b/haflow.module.jar index 1c2004933deb62d42e4f197bbcedbc88e7b785d8..c4458e6ff48ad353ed614b947d11c2b59114a70b 100644 GIT binary patch delta 946 zcmeC+?&jtV@MdNaVc_84VCb$oHjy`u*%3(P+0-)|inRJ?z0RoJYUd#Maihkr!h*M6 zTbeSmGu<6`c^$uPs5*H{<}#!Dv#s_A^GTamHK;f&AN4(YLA<8Jb1*Lr-#Kp(3qb)IeCh;TK0bh-PNHp3}0-WKkHy@b8P?p zl=$1__VdoYeBPrSFmtEfH#QNg#>00O+?2k;!osyj?8kgAS2-pd)rQxPmTY?D`(0J1 z`0n#{XWn>;H*M%LUE}Z9!W&Y@5a7+uvF87YY(+)}hSxxh2u5J|O@7L#Tfg7$uz|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cI4>eG}t%aQy@`o<;8*mY_DmU_2M*6{4e zruX-D$6G%?iNsNQmP-wD&#~ouu8E7=E$ReVZ~>lz5PiND!B%3R?IK!O5dr1ud^T4s zIn9{LZs8=BqBcR&tCXt!*RPRyWot?{{rlcfQx? zeG+z$gb7z422Ep|&i>tg%l=NlKZPcmq6yH5L!&QH;I^XVsDHa}wdfYl;!SZM#*gO5 z@W$lQI=M-mh^X>&4)v&;rPx?f5mb5vEP@FQEXk!yN1L3>-cM6RzSgWaT2Bu<-_*4EGU%QC#u`FX{4+PRFL<29 zCAH=hgcL2I+u+vcpf1Ybx!AB%MX{01pq;m&5=n|dG{ORHVX0K((CT=?VZwT_@ODE; zC34Zjb7pbQwqRXdVq2?%jiX^$nPG@K(i0K#(*V#>0p?r*A~4VATqx-9?cr6*=QD4_ zAMICAFm#ZgWRqVBelN7df0w@_DJsfPz(P(8NV{U zUdV+%rT;(h`ah|LFX{R<>A!N1UU*|aMfG_F{Qe66`z8E#_tO6t7TNDnf1R?u@S1)K z4dnka>Ysg+-vj+RZg?5m{gg(e|Mx(DGs62l*ssmcmkGvC!9@FygZ;%k zsz2ot^Zzg2zcpB2!v0r<{|<*=I%Gd3^SO+E_RId>>IKF8l@4F7#M{}bT<>hOir{p*MI-ye_h)w9Fj ZA)BHM;CZ2gfS^48_&k4$6aV;f{2#()P=^2j literal 0 HcmV?d00001 diff --git a/maven-install/java7-module.pom b/maven-install/haflow-demo-module.pom similarity index 69% rename from maven-install/java7-module.pom rename to maven-install/haflow-demo-module.pom index 0a8dc92..7d42af5 100644 --- a/maven-install/java7-module.pom +++ b/maven-install/haflow-demo-module.pom @@ -3,10 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 1.0 com.otcaix.haflow - java7-module + haflow-demo-module jar - java7 - java7 module - http://www.baidu.com + demo + haflow-demo-module 1.0 \ No newline at end of file diff --git a/maven-install/java7-module.jar b/maven-install/java7-module.jar deleted file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NX~0cP2`mOyzd16qhtuVY#EKc;uE{*({6 z_x1L2{pD|t{Tv%j>>`?~uE-@Kd%GrU#d|GLn z^u+bVNL~d?+|gbk;=pvEzfoJOGofsV4h_nZ*o8}PAun1G;}!3o&$+s{!ee*;0&485hcC!}^Z>r>>h8d(P}kp|5e)!-n#0gx?#f#A3rhS z1^0XQkxZtgG#vv}T|RW89!^5Vk7*E^ov;;@X+*-(Jv$U+uTb9^5#ho0LH00G_~>mR zymjS-n78g(P!VA4_KuI6LOL=sgv>Vr7tl|`IbV{6cs%5u!Bld7ouPQVHv9j^;DSS- zgZGTJ%0RMUHJDNPx`_icJ%o1XD0cday{t{ ze;DqgBIjq%-_?hIpZ7_B_`^j1!uwAK`=2K9gcg3-hkpw53laVl_2 z|3%dQR4e|P=V$rSll1I|$v^IZUmxM058;>Di~m1_XuoFtxl#8djrw5}(ErD*zq2U6 zCi=N!@znSGVO2=~`$T`!1^hMH&;03A6Xb`Xqy5*({-P!FYrda(uqRgbhn+lfRsY+y z`>Phrzj3rrY5!H>zry1ulI@2jK9c889%^$DgjpxBBF7Gx;An7meir diff --git a/pom.xml b/pom.xml index b9c5577..7514333 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ org.hibernate hibernate-core - 4.3.0.Beta2 + 4.3.0.Beta3 @@ -95,7 +95,7 @@ com.otcaix.haflow - java7-module + haflow-demo-module 1.0 @@ -105,18 +105,23 @@ - - haflow - - - org.eclipse.jetty - jetty-maven-plugin - 9.0.3.v20130506 - - - + + + + + org.mortbay.jetty + maven-jetty-plugin + 8.1.11.v20130520 + + + org.kohsuke.jetty + jetty-maven-plugin + 7.0.0pre1 + + + diff --git a/src/main/java/haflow/hdfs/client/HdfsHelper.java b/src/main/java/haflow/hdfs/client/HdfsHelper.java index 7fd9ee7..30b14dc 100644 --- a/src/main/java/haflow/hdfs/client/HdfsHelper.java +++ b/src/main/java/haflow/hdfs/client/HdfsHelper.java @@ -14,6 +14,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils; +import org.springframework.stereotype.Component; /** * Read top 10 lines, from files on hadoop @@ -21,6 +22,7 @@ import org.apache.hadoop.io.IOUtils; * @author ZhaoWei * */ +@Component public class HdfsHelper { public static final String filePath = "hdfs://m150:9000/ztest/split/part-r-00000"; public static final String newFile = "hdfs://m150:9000/ztest/test/part-r-00000"; @@ -29,14 +31,13 @@ public class HdfsHelper { private FileSystem hdfs; public static void main(String[] args) throws IOException { - Configuration conf = new Configuration(); - - HdfsHelper reader = new HdfsHelper(conf); + HdfsHelper reader = new HdfsHelper(); reader.ReadFile(filePath); } - - public HdfsHelper(Configuration conf){ + + public HdfsHelper(){ try { + Configuration conf = new Configuration(); hdfs = FileSystem.get(conf); } catch (IOException e) { e.printStackTrace(); @@ -94,7 +95,7 @@ public class HdfsHelper { try { Path srcPath = new Path(srcFile); Path dstPath = new Path(dstFile); - hdfs.copyFromLocalFile(srcPath, dstPath); + hdfs.copyFromLocalFile(false, true, srcPath, dstPath); } catch (IOException e) { e.printStackTrace(); } diff --git a/src/main/java/haflow/hdfs/client/HdfsStaticHelper.java b/src/main/java/haflow/hdfs/client/HdfsStaticHelper.java index fb61db1..69ed24b 100644 --- a/src/main/java/haflow/hdfs/client/HdfsStaticHelper.java +++ b/src/main/java/haflow/hdfs/client/HdfsStaticHelper.java @@ -21,18 +21,20 @@ import org.apache.hadoop.util.Progressable; public class HdfsStaticHelper { public static void main(String[] args) { - try { - uploadTohdfs(); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - }; +// try { +// uploadTohdfs(); +// } catch (FileNotFoundException e) { +// e.printStackTrace(); +// } catch (IOException e) { +// e.printStackTrace(); +// }; + + PutFile("D:/haflow/flows/NewFlow", "hdfs://m150:9000/ztest/test1"); } public static void uploadTohdfs() throws FileNotFoundException, IOException { - String localSrc = "D://a.txt"; - String dst = "hdfs://m150:9000/ztest/test/a.txt"; + String localSrc = "D:/haflow/flows/NewFlow/workflow.xml"; + String dst = "hdfs://m150:9000/ztest/test/newflow"; InputStream in = new BufferedInputStream(new FileInputStream(localSrc)); Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(dst), conf); @@ -41,11 +43,26 @@ public class HdfsStaticHelper { System.out.println("."); } }); - System.out.println("上传文件成功"); + System.out.println("finised uploading!"); IOUtils.copyBytes(in, out, 4096, true); } - /** 从HDFS上读取文件 */ + public static void PutFile( String srcFile, String dstFile) { + + FileSystem hdfs; + + Configuration conf = new Configuration(); + try { + hdfs = FileSystem.get(conf); + Path srcPath = new Path(srcFile); + Path dstPath = new Path(dstFile); + hdfs.copyFromLocalFile(srcPath, dstPath); + } catch (IOException e) { + e.printStackTrace(); + } + + } + public static void readHdfs() throws FileNotFoundException, IOException { String dst = "hdfs://192.168.1.11:9000/usr/yujing/test.txt"; Configuration conf = new Configuration(); @@ -60,15 +77,18 @@ public class HdfsStaticHelper { out.write(ioBuffer, 0, readLen); readLen = hdfsInStream.read(ioBuffer); } - System.out.println("读文件成功"); + System.out.println("finished reading!"); out.close(); hdfsInStream.close(); fs.close(); } /** - * 以append方式将内容添加到HDFS上文件的末尾;注意:文件更新,需要在hdfs-site.xml中添dfs. - * append.supporttrue + * 以append方式将内容添加到HDFS上文件的末尾;注意:文件更新,需要在hdfs-site.xml中添 + * + * dfs.append.support + * true + * */ public static void appendToHdfs() throws FileNotFoundException, IOException { String dst = "hdfs://192.168.1.11:9000/usr/yujing/test.txt"; @@ -85,7 +105,6 @@ public class HdfsStaticHelper { fs.close(); } - /** 从HDFS上删除文件 */ public static void deleteFromHdfs() throws FileNotFoundException, IOException { String dst = "hdfs://192.168.1.11:9000/usr/yujing"; diff --git a/src/main/java/haflow/hdfs/client/TestClassPath.java b/src/main/java/haflow/hdfs/client/TestClassPath.java index 5ad5941..c1dc250 100644 --- a/src/main/java/haflow/hdfs/client/TestClassPath.java +++ b/src/main/java/haflow/hdfs/client/TestClassPath.java @@ -1,14 +1,12 @@ package haflow.hdfs.client; -import haflow.module.general.JavaModule; - import java.io.File; public class TestClassPath { public static void main(String[] args) { - String path = JavaModule.class.getProtectionDomain().getCodeSource().getLocation().getFile(); - File jarFile = new File(path); - System.out.println(path); +// String path = JavaModule.class.getProtectionDomain().getCodeSource().getLocation().getFile(); +// File jarFile = new File(path); +// System.out.println(path); } } diff --git a/src/main/java/haflow/oozie/client/JavaClient.java b/src/main/java/haflow/oozie/client/OozieHelper.java similarity index 79% rename from src/main/java/haflow/oozie/client/JavaClient.java rename to src/main/java/haflow/oozie/client/OozieHelper.java index 8d06a4c..06feb6a 100644 --- a/src/main/java/haflow/oozie/client/JavaClient.java +++ b/src/main/java/haflow/oozie/client/OozieHelper.java @@ -6,7 +6,7 @@ import org.apache.oozie.client.OozieClient; import org.apache.oozie.client.OozieClientException; import org.apache.oozie.client.WorkflowJob; -public class JavaClient { +public class OozieHelper { public static void main(String[] args) throws OozieClientException, InterruptedException { @@ -42,4 +42,19 @@ public class JavaClient { System.out.println(wc.getJobInfo(jobId)); } + + // get a OozieClient for local Oozie + OozieClient wc = new OozieClient("http://m150:11000/oozie/"); + + // create a workflow job configuration + Properties conf = wc.createConfiguration(); + + public OozieHelper(){ + + } + + public String runJob(String flowName){ + + return null; + } } diff --git a/src/main/java/haflow/service/FlowDeployService.java b/src/main/java/haflow/service/FlowDeployService.java index 77b5887..4770cc2 100644 --- a/src/main/java/haflow/service/FlowDeployService.java +++ b/src/main/java/haflow/service/FlowDeployService.java @@ -1,26 +1,67 @@ package haflow.service; +import haflow.hdfs.client.HdfsHelper; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStreamWriter; import java.nio.channels.FileChannel; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class FlowDeployService { - public long copyJarFile(File srcFile, File dstPath, String dstName){ + private final String workspace = "D:/haflow/flows/"; + private final String workspace_hdfs = "hdfs://m150:9000/user/root/examples/apps/"; + + private HdfsHelper hdfsHelper; + + public HdfsHelper getHdfsHelper() { + return hdfsHelper; + } + + @Autowired + public void setHdfsHelper(HdfsHelper hdfsHelper) { + this.hdfsHelper = hdfsHelper; + } + + public boolean deployFlow(String flowName, String workflowXml, Set jarPaths){ + String deployPath = workspace + flowName; + this.rmr(new File(deployPath)); + this.saveXmlToFlow(workflowXml, deployPath); + + for (String jarPath : jarPaths) { + if(jarPath.endsWith(".jar")){ + File jarFile = new File(jarPath); + File dstPath = new File(deployPath + "/lib"); + System.out.println(jarPath); + this.copyJarFile(jarFile, dstPath, jarFile.getName()); + } + } + + this.hdfsHelper.PutFile(deployPath, workspace_hdfs + flowName); + return true; + } + + private long copyJarFile(File srcFile, File dstPath, String dstName){ File dst = new File(dstPath, dstName); if(!srcFile.exists()){ System.out.println(srcFile.getAbsolutePath() + " do not exist!"); - }else if( !dstPath.exists()){ - System.out.println(dstPath.getAbsolutePath() + " do not exist!"); }else if(dst.exists()){ System.out.println(dst.getAbsolutePath() + " already exists!"); }else{ + if( !dstPath.exists()){ + boolean made = mkdir(dstPath); + if( made ) + System.out.println(dstPath.getAbsolutePath() + " created!"); + } + //start copy file try { @SuppressWarnings("resource") @@ -40,4 +81,49 @@ public class FlowDeployService { } return 0; } + + private boolean saveXmlToFlow(String xml, String filePath){ + File dir = new File(filePath); + mkdir(dir); + OutputStreamWriter fw; + try { + fw = new OutputStreamWriter(new FileOutputStream(new File(filePath, "workflow.xml"))); + fw.write(xml); + fw.close(); + return true; + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + private boolean rmr(File dir){ + if( dir != null && dir.exists()){ + if( dir.isDirectory()){ + File[] subs = dir.listFiles(); + for( File sub : subs){ + rmr(sub); + } + return dir.delete(); + }else if( dir.isFile()){ + return dir.delete(); + } + } + return true; + } + + private boolean mkdir(File dir){ + if( !dir.exists() ){ + boolean made = dir.mkdirs(); + if(made){ + System.out.println("made dir " + dir.getAbsolutePath()); + }else{ + System.err.println("failed to make dir " + dir.getAbsolutePath()); + return false; + } + } + return true; + } } diff --git a/src/main/java/haflow/service/FlowExecuteService.java b/src/main/java/haflow/service/FlowExecuteService.java index cc8f071..b9a9d17 100644 --- a/src/main/java/haflow/service/FlowExecuteService.java +++ b/src/main/java/haflow/service/FlowExecuteService.java @@ -7,16 +7,15 @@ import haflow.flow.entity.Topological; import haflow.module.ModuleMetadata; import haflow.module.basic.EndModule; import haflow.module.basic.StartModule; -import haflow.module.general.JavaModule; import haflow.profile.NodeConfigurationProfile; import haflow.ui.model.RunFlowResultModel; import haflow.utility.ModuleLoader; import haflow.utility.SessionHelper; import haflow.utility.XmlHelper; -import java.io.File; import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -125,8 +124,8 @@ public class FlowExecuteService { startNodes.get(0)); Topological topo = new Topological(graph); List sorted = topo.getOrder(); - StringBuilder sb = new StringBuilder(); - sb.append("" + "\n"); if (sorted != null) { for (int i = 0; i < sorted.size(); i++) {//move end node to the end @@ -142,7 +141,13 @@ public class FlowExecuteService { break; } } - for (int i = 0; i < sorted.size(); i++) { + for (int i = 0; i < sorted.size(); i++) {//generate xml + if( i == sorted.size()-1 ){ + workflowXml.append("" + + "Work flow failed, " + + "error message[${wf:errorMessage(wf:lastErrorNode())}]" + + "" + "\n"); + } int w = sorted.get(i); Node node = graph.getNode(w); Class moduleClass = moduleClasses.get(node @@ -169,32 +174,24 @@ public class FlowExecuteService { } Document doc = module.generate(configurations); String part = this.xmlHelper.getXmlString(doc); - sb.append(part + "\n"); + workflowXml.append(part + "\n"); } }else{ messageBuilder.append("Error: Flow is has Circles!"); - } -// sb.append("" + -// "Work flow failed, " + -// "error message[${wf:errorMessage(wf:lastErrorNode())}]" + -// "" + "\n"); - sb.append("" + "\n"); - System.out.println(sb.toString()); - messageBuilder.append("Generated xml : \n" + sb.toString()); + } + workflowXml.append("" + "\n"); + System.out.println(workflowXml.toString()); +// messageBuilder.append("Generated xml : \n" + workflowXml.toString()); - //deploy workflow - String flowName = flow.getName(); + //deploy workflow + Set jarPaths = new HashSet(); for (Node node : nodes) { Class module = moduleClasses.get(node.getModuleId() .toString()); - String path = JavaModule.class.getProtectionDomain().getCodeSource().getLocation().getFile(); - if(path.endsWith(".jar")){ - File jarFile = new File(path); - File dstPath = new File("D:/haflow/flows/" + flowName); - System.out.println(path); - this.flowDeployService.copyJarFile(jarFile, dstPath, jarFile.getName()); - } + String path = module.getProtectionDomain().getCodeSource().getLocation().getFile(); + jarPaths.add(path); } +// this.flowDeployService.deployFlow(flow.getName(), workflowXml.toString(), jarPaths); } diff --git a/src/main/java/haflow/service/FlowExecuteServiceTest.java b/src/main/java/haflow/service/FlowExecuteServiceTest.java index d1cdc84..397ccce 100644 --- a/src/main/java/haflow/service/FlowExecuteServiceTest.java +++ b/src/main/java/haflow/service/FlowExecuteServiceTest.java @@ -1,10 +1,7 @@ package haflow.service; -import haflow.service.FlowExecuteService; - import java.util.UUID; -import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -12,7 +9,6 @@ public class FlowExecuteServiceTest { private ApplicationContext context; - @Test public void test() { context = new ClassPathXmlApplicationContext(new String[] {"servlet-context.xml"}); FlowExecuteService fes = context.getBean(FlowExecuteService.class); diff --git a/src/main/java/haflow/utility/ModuleLoader.java b/src/main/java/haflow/utility/ModuleLoader.java index 7784622..4e885bf 100644 --- a/src/main/java/haflow/utility/ModuleLoader.java +++ b/src/main/java/haflow/utility/ModuleLoader.java @@ -1,15 +1,15 @@ package haflow.utility; +import haflow.entity.Module; +import haflow.entity.ModuleConfiguration; +import haflow.module.ModuleMetadata; + import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.UUID; -import haflow.entity.Module; -import haflow.entity.ModuleConfiguration; -import haflow.module.ModuleMetadata; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,6 +31,7 @@ public class ModuleLoader { Map modules = new HashMap(); List classNames = this.getClassHelper().getClassNames( "haflow", true); + classNames.addAll(this.getClassHelper().getClassNames("hmodule", true)); for (String className : classNames) { Class moduleClass = Class.forName(className); if (moduleClass.isAnnotationPresent(haflow.module.Module.class)) { @@ -78,6 +79,7 @@ public class ModuleLoader { Map> moduleClasses = new HashMap>(); List classNames = this.getClassHelper().getClassNames( "haflow", true); + classNames.addAll(this.getClassHelper().getClassNames("hmodule", true)); for (String className : classNames) { Class moduleClass = Class.forName(className); if (moduleClass.isAnnotationPresent(haflow.module.Module.class)) { diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml index aa92dce..09b1cfd 100644 --- a/src/main/resources/hibernate.cfg.xml +++ b/src/main/resources/hibernate.cfg.xml @@ -8,8 +8,8 @@ root 123456 20 - true - true + false + false true utf-8 org.hibernate.dialect.MySQLDialect