Spring 回调参数如何使用WebHCat/Hive工作?
我只是按照文档中的说明进行操作 我的目标是在蜂巢作业状态成功后调用spring控制器Spring 回调参数如何使用WebHCat/Hive工作?,spring,hadoop,hive,hql,hcatalog,Spring,Hadoop,Hive,Hql,Hcatalog,我只是按照文档中的说明进行操作 我的目标是在蜂巢作业状态成功后调用spring控制器 **here are my inputs :** **url** : http://localhost:50111/templeton/v1/hive?user.name=hduser **Parameter:** callback : http://domain:port/project-name/mycall/$jobId $jobId只是一个参数,一旦处理完成,它将被替换为实际的jobId **
**here are my inputs :**
**url** : http://localhost:50111/templeton/v1/hive?user.name=hduser
**Parameter:**
callback : http://domain:port/project-name/mycall/$jobId
$jobId只是一个参数,一旦处理完成,它将被替换为实际的jobId
** here is my controller : **
@RequestMapping(value = "/mycall/{jobId}", method = RequestMethod.GET)
public void callBack( @PathVariable String jobId) throws IOException {
LOGGER.debug("JobId : {}", jobId );
}
我在node.js中使用express成功地完成了这项工作。不过我会尽力解释的 首先,我使用请求模块提交作业
var cmd = "http://"+targ+":"+port+"/templeton/v1/hive";
request({
method: 'POST',
url: cmd,
form: {
'user.name': user, // just a variable for user.name=
'execute': query, // actual query string
'statusdir': dir, // directory results will go on hdfs
'callback': "http://"+ip+":3000/callback/$jobId", // callback address
}
}, function(err, response, body){
现在是接收回调的路由
router.get('/:jobid', function(req, res) {
var jobid = req.param('jobid');
console.log(jobid, 'get: /callback/:jobid');
i.alert(jobid);
res.status(200).end();
});
/callback位于app.js中,如果您不熟悉节点,它将调用路由