我正在尝试使用最新的EMR加载具有1TB数据的数据库以在AWS上激发.并且运行时间太长以至于在6小时内没有完成,但是在运行6h30m之后,我得到一些错误,宣布Container在丢失的节点上发布然后作业失败.日志是这样的:
16/07/01 22:45:43 WARN scheduler.TaskSetManager: Lost task 144178.0 in stage 0.0 (TID 144178, ip-10-0-2-176.ec2.internal): ExecutorLostFailure (executor 5 exited caused by one of the running tasks) Reason: Container marked as failed: container_1467389397754_0001_01_000006 on host: ip-10-0-2-176.ec2.internal. Exit status: -100. Diagnostics: Container released on a *lost* node
16/07/01 22:45:43 WARN scheduler.TaskSetManager: Lost task 144181.0 in stage 0.0 (TID 144181, ip-10-0-2-176.ec2.internal): ExecutorLostFailure (executor 5 exited caused by one of the running tasks) Reason: Container marked as failed: container_1467389397754_0001_01_000006 on host: ip-10-0-2-176.ec2.internal. Exit …Run Code Online (Sandbox Code Playgroud) 我需要在杜松子酒的中间件中记录响应主体,但我找不到如何获取响应主体.有人可以帮忙吗?
我正在使用这样的中间件:
func Logger() gin.HandlerFunc {
return func(c *gin.Context) {
c.Next()
statusCode := c.Writer.Status()
if statusCode >= 400 {
//ok this is an request with error, let's make a record for it
//log body here
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何从中间件中获取Context的响应体?
我知道在SCALA中我可以通过定义一些隐式函数将类型转换为另一种类型,我的问题是,如何在导入大量软件包后知道可以使用哪些转换?
例如,我有一个字符串,而且我怎么知道它可以转换为什么类型?
编辑澄清,我想在我的scala编译插件中执行它,所以我可能需要在一个reflect.api.tree类型上调用一个函数,然后得到implicits.我正在寻找一些方法来使用答案中提到的隐式[].