ThreadPoolExecutor pool= new ThreadPoolExecutor(5,10, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
IbcServiceConstants ibcServiceConstants=CfwConstants.ctx.getBean(IbcServiceConstants.class);
String userPath=ibcServiceConstants.getUserLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
String accountPath=ibcServiceConstants.getAccountLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
String memberPath=ibcServiceConstants.getMemberLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
String shellPath=ibcServiceConstants.getHiveShellPath(); pool.execute(new RunShellThread(shellPath, userPath, "loginuser",statDate));
log.info(" run load loginuser data shellPath:= "+shellPath+" ,userPath:= "+userPath); pool.execute(new RunShellThread(shellPath, accountPath, "loginAccount",statDate));
log.info(" run load loginaccount data shellPath:= "+shellPath+" ,accountPath:= "+accountPath); pool.execute(new RunShellThread(shellPath, memberPath, "loginmember",statDate));
log.info(" run load loginmember data shellPath:= "+shellPath+" ,memberPath:= "+memberPath); pool.shutdown();
while(true){
try {
if(pool.isTerminated()){
BigDataTask bigDataTask=CfwConstants.ctx.getBean(BigDataTask.class);
bigDataTask.save(statDate);
break;
}
try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
log.error(" pool error ", e);
}
} catch (Exception e) {
log.error(" pool aa error ", e);
}
}
}


//spring注解给属性付初始值
@Value("${hive.load.data.shell}")
public void setHiveShellPath(String hiveShellPath) {
this.hiveShellPath = hiveShellPath;
} public String getMemberLoginLogDir() {
return memberLoginLogDir;
}
@Value("${memberlogin.log.hadoop.dir}")
public void setMemberLoginLogDir(String memberLoginLogDir) {
this.memberLoginLogDir = memberLoginLogDir;
}
另一种方法 https://blog.csdn.net/jiaomicha/article/details/40539523

关于java 操作linux命令的 一些相关的更多相关文章

  1. Linux命令大全----系统管理相关命令

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka       摘要:本文主要讲了Linux命令大全----系统管理相关命令,并附有实例 一.安装 ...

  2. java运行Linux命令

    <%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UT ...

  3. Java调用Linux命令执行

    调用方式 Java调用linux命令执行的方式有两种,一种是直接调用linux命令,一种是将linux命令写到.sh脚本中,然后调用脚本执行. 详细说明 直接调用:使用java中lang包下面的Run ...

  4. Java 执行linux命令(转)

    转自 http://blog.csdn.net/a19881029/article/details/8063758 java程序中要执行linux命令主要依赖2个类:Process和Runtime 首 ...

  5. Java调用Linux命令(cd的处理)

    一.Java调用Linux系统的命令非常简单 这是一个非常常用的调用方法示例: public String executeLinuxCmd(String cmd) { System.out.print ...

  6. java执行linux命令的工具类

    package com.starfast.common.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ja ...

  7. 【转】SVN linux命令及 windows相关操作(三)

    TortoiseSVN是windows下其中一个非常优秀的SVN客户端工具.通过使用它,我们可以可视化的管理我们的版本库.不过由于它只是一个客户端,所以它不能对版本库进行权限管理. TortoiseS ...

  8. 【转】SVN linux命令及 windows相关操作(一)

    从以下博客转载和整理: http://www.cnblogs.com/richcem/archive/2011/01/08/1930823.html http://blog.wpjam.com/m/t ...

  9. 【转】SVN linux命令及 windows相关操作(二)

    转自这里:http://www.uml.org.cn/pzgl/200904246.asp 1 安装及下载client 端 2 什么是SVN(Subversion)? 3 为甚么要用SVN? 4 怎么 ...

随机推荐

  1. Python3学习之路~6.4 析构函数

    析构函数是在实例释放.销毁的时候执行的,通常用于做一些收尾工作.比如说,关闭一些数据库连接.打开的临时文件等. #Author:Zheng Na class Role: # 构造函数 def __in ...

  2. 009-Iterator 和 for...of 循环

    一.概述 原文地址:http://es6.ruanyifeng.com/#docs/iterator 二.详细 2.1.概念 遍历器(Iterator)是一种机制.它是一种接口,为各种不同的数据结构提 ...

  3. wxPython:文本对话框TextEntryDialog

    wxTextEntryDialog(wxWindow* parent, const wxString& message, const wxString& caption = " ...

  4. edraw的符号制作

    1.选中要制作的符号,在"符号"->"保存符号",这将保存为两个文件,1个是ede,另一个是png文件. 2. 3.名称,提示,随意写,只要你明白什么意思 ...

  5. swiper 视频轮番

    百度搜索:swiper 视频轮番 转载1:https://blog.csdn.net/Aimee1608/article/details/79637929 项目中使用swiper插件嵌套video标签 ...

  6. abap 通过importing 和 exporting 调用其它函数

    1:其它函数的(输入或输出)参数名都在=号左边.

  7. Java中输出正则表达式匹配到的内容

    import java.util.regex.Matcher; import java.util.regex.Pattern; public class A { public static void ...

  8. excel 常用法

    粘贴格式化数据 数据如下 206190 98604 20991 2807.20 236584 113705 24599 3268.68 272083 128111 29021 3721.33 2487 ...

  9. [pat]A1072 Gas Station

    这道题的结点编号是字符串类型,处理的过程很有意思,用getID将house和GasStation进行区分 #include<bits/stdc++.h> using namespace s ...

  10. 配置完centos 6以后,大概需要安装的软件(主要是yum)

    根据实践,把我的经验说一下,以后我自己也可以按照这个快速安装软件. 1. 配置源.百度网盘的tools/download/linux已经放了几个挺重要的 东西了. yum -y install epe ...