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. SAP 创建 component

    1: 进入x3c 系统,输入 T-CODE     BSP_WD_CMPWB 2: 输入以Z开头的组件名. 点击create using wizard 3:  输入应用属性 4: 定义 bol mod ...

  2. Eclipse中git上如何把自己的分支保存到远端

    1   Team——>remote——>push 2  next 3  选择自己的分支,然后点击 Add Spec 4  查看是否是自己的分支——>自己的分支,然后Finish PS ...

  3. pro*c的使用

    一.什么是Pro*c程序 在oracle数据库管理系统中,有三种访问数据库的方法:       1.用 SQL*Plus,直接输入sql命令以命令行交换的方式访问数据库       2.用一些应用开发 ...

  4. word2vec 评测 size_diff

    This is a test for word2vecWed Nov 07 16:47:19 2018dir of model1: ./model/window3_ min_count2_worker ...

  5. 【LeetCode每天一题】Merge Two Sorted Lists(合并两个排序链表)

    Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t ...

  6. [ Linux运维学习 ] 路径及实战项目合集

    我们知道运维工程师(Operations)最基本的职责就是负责服务的稳定性并确保整个服务的高可用性,同时不断优化系统架构.提升部署效率.优化资源利用率,确保服务可以7*24H不间断地为用户提供服务. ...

  7. TextBox显示提示信息

    属性placeholder可以设置TextBox 提示信息如: <asp:TextBox ID ="txt1" runat ="server"  Tool ...

  8. shell编程:case语句

  9. 力攻突破M20的5分钟BOLL

  10. sqli-labs(五)——盲注(boolean盲注以及时间盲注)

    第八关: 没有查询信息,输入id=1' 报错 ,也没有报错信息,这里应该是个盲注 使用boolean的盲注吧 先判断boolean的盲注可行 输入id=1' and '1'='1' %23 页面正常 ...