关于java 操作linux命令的 一些相关
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命令的 一些相关的更多相关文章
- Linux命令大全----系统管理相关命令
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲了Linux命令大全----系统管理相关命令,并附有实例 一.安装 ...
- java运行Linux命令
<%@ page language="java" import="java.util.*,java.io.*" pageEncoding="UT ...
- Java调用Linux命令执行
调用方式 Java调用linux命令执行的方式有两种,一种是直接调用linux命令,一种是将linux命令写到.sh脚本中,然后调用脚本执行. 详细说明 直接调用:使用java中lang包下面的Run ...
- Java 执行linux命令(转)
转自 http://blog.csdn.net/a19881029/article/details/8063758 java程序中要执行linux命令主要依赖2个类:Process和Runtime 首 ...
- Java调用Linux命令(cd的处理)
一.Java调用Linux系统的命令非常简单 这是一个非常常用的调用方法示例: public String executeLinuxCmd(String cmd) { System.out.print ...
- java执行linux命令的工具类
package com.starfast.common.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ja ...
- 【转】SVN linux命令及 windows相关操作(三)
TortoiseSVN是windows下其中一个非常优秀的SVN客户端工具.通过使用它,我们可以可视化的管理我们的版本库.不过由于它只是一个客户端,所以它不能对版本库进行权限管理. TortoiseS ...
- 【转】SVN linux命令及 windows相关操作(一)
从以下博客转载和整理: http://www.cnblogs.com/richcem/archive/2011/01/08/1930823.html http://blog.wpjam.com/m/t ...
- 【转】SVN linux命令及 windows相关操作(二)
转自这里:http://www.uml.org.cn/pzgl/200904246.asp 1 安装及下载client 端 2 什么是SVN(Subversion)? 3 为甚么要用SVN? 4 怎么 ...
随机推荐
- CA证书和TLS介绍
数字签名 用自己的私钥给数据加密就叫数字签名 公钥传输威胁 在A和B的通信中,C可以把自己的公钥发给A,让A把C的公钥当成B的公钥,这样的话.B拿到加密数据反而无法解密,而C却可以解密出数据.从而实现 ...
- vue中根据生日计算年龄
getage() { var birthdays = new Date(this.birthday.replace(/-/g, "/")); var d = new Date(); ...
- KinectFusion测试
谁告诉我说KinectFusion不能直接在Kinect2上直接用.今天心血来潮看了一下Kinect for Windows SDK中的头文件,发现完全可以用啊. 于是用SDK自带的Demo测试了一下 ...
- poj3259: Wormholes(BF模板题)
http://poj.org/problem?id=3259 Description While exploring his many farms, Farmer John has discovere ...
- 论文阅读-使用隐马模型进行NER
Named Entity Recognition in Biomedical Texts using an HMM Model 2004年,引用79 1.摘要 Although there exis ...
- [Java in NetBeans] Lesson 02. Variables, Data Types and Assignment.
这个课程的参考视频在youtube. 主要学到的知识点有: Data Type: int, char, String, double, boolean. When into printf, int ( ...
- 石子合并(区间DP经典例题)
题目链接:https://www.luogu.org/problemnew/show/P1880 #include <cstdio> #include <cmath> #inc ...
- Python random模块random/uniform/randint/choice/getrandbits/shuffle/choice/sample随机函数
1.random.random() 返回0<=n<1之间的随机实数n 2. random.uniform() 弥补了上面函数的不足,它可以设定浮点数的范围,一个是上限,一个是下限. 3. ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统--系统权限及操作指引
系列目录 1.权限包括菜单权限,按钮权限,数据权限 2.角色组和用户之间是多对多的关系,即多个用户可以拥有多个角色组,权限是拥有角色组的并集 1.菜单界面,菜单都是动态数据由模块管理进行设置 2.权限 ...
- 数据加密之DES加密
DES加密即使用DESCryptoServiceProvider加密.DESCryptoServiceProvider在命名空间下:System.Security.Cryptography; 对称加密 ...