关于java 操作linux命令的 一些相关

 
  
 1     ThreadPoolExecutor pool= new ThreadPoolExecutor(5,10, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
 2         IbcServiceConstants ibcServiceConstants=CfwConstants.ctx.getBean(IbcServiceConstants.class);
 3         String userPath=ibcServiceConstants.getUserLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
 4         String accountPath=ibcServiceConstants.getAccountLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
 5         String memberPath=ibcServiceConstants.getMemberLoginLogDir()+statDate.substring(0, 4)+"/"+statDate.substring(4, 6)+"/"+statDate;
 6         String shellPath=ibcServiceConstants.getHiveShellPath();
 7 
 8         pool.execute(new RunShellThread(shellPath, userPath, "loginuser",statDate));
 9         log.info(" run load loginuser data shellPath:= "+shellPath+" ,userPath:= "+userPath);
10         
11         pool.execute(new RunShellThread(shellPath, accountPath, "loginAccount",statDate));
12         log.info(" run load loginaccount data shellPath:= "+shellPath+" ,accountPath:= "+accountPath);
13         
14         pool.execute(new RunShellThread(shellPath, memberPath, "loginmember",statDate));
15         log.info(" run load loginmember data shellPath:= "+shellPath+" ,memberPath:= "+memberPath);
16         
17         pool.shutdown();
18         while(true){
19             try {
20                 if(pool.isTerminated()){
21                     BigDataTask bigDataTask=CfwConstants.ctx.getBean(BigDataTask.class);
22                     bigDataTask.save(statDate);
23                     break;
24                 }
25                 try {
26                     Thread.sleep(1000l);
27                 } catch (InterruptedException e) {
28                     log.error(" pool  error ", e);
29                 }
30             } catch (Exception e) {
31                 log.error(" pool  aa  error ", e);
32             }
33         }
34     }
 
  

 



//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

 

转载于:https://www.cnblogs.com/hejunhong/p/10309680.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值