小编She*_*eel的帖子

如何将自定义描述添加到Spark Job以在Spark Web UI中显示

当我们向Spark提交应用程序时,在执行任何操作后,Spark Web UI会显示Job和Stages等count at MyJob.scala:15.但在我的应用程序中有多个,count并且有save操作.因此,理解UI非常困难.而不是count at MyJob.scala:15,我们可以添加自定义描述,以提供更详细的工作信息.

谷歌搜索时发现https://issues.apache.org/jira/browse/SPARK-3468https://github.com/apache/spark/pull/2342,作者附上图片,详细描述如'Count','缓存和计数','有延迟的工作'.那么我们能实现同样的目标 我使用的是Spark 2.0.0.

apache-spark

16
推荐指数
1
解决办法
4631
查看次数

Spring Security OAuth2 从默认过滤器链中禁用 BasicAuthenticationFilter

在授权服务器中,由于对客户端 ID 的某些操作,需要添加自定义 BasicAuthenticationFilter。大多数实现与 相同BasicAuthenticationFilter。以下是相同的片段,

@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) {
    ...
    ...
    String username = someDecoder(tokens[0]); // Kind of something
    ...
    ...
}
Run Code Online (Sandbox Code Playgroud)

我的自定义过滤器放置BasicAuthenticationFilter在过滤器链之前。

http.addFilterBefore(new CustomBasicAuthenticationFilter(authenticationManager(), authenticationEntryPoint()),
    BasicAuthenticationFilter.class);
Run Code Online (Sandbox Code Playgroud)

这个自定义过滤器工作得很棒,并且用户也成功通过了身份验证。但由于 BasicAuthenticationFilter 仍然存在于链中,该过滤器也会被执行并尝试再次对用户进行身份验证,但由于未操纵客户端凭据而失败。请参阅BasicAuthenticationFilter-GitHub

因此,要从过滤器链中删除/禁用,请BasicAuthenticationFilter遵循此SOQ,建议使用BeanPostProcessor. 但是在 Spring Boot 过滤器链中使用 bean 名称springSecurityFilterChain和 class注册FilterChainProxy。作为FilterChainProxy-GitHub返回不可修改的SecurityFilterChain. 所以接下来不可能改变FilterChainProxybean。

那么如何实现相同或任何其他方式BasicAuthenticationFilter从 Spring Security 过滤器链中删除/禁用或任何其他过滤器。

使用 Spring Boot 1.5.1 和 Spring Security OAuth2 …

java spring spring-security spring-boot spring-security-oauth2

5
推荐指数
1
解决办法
5043
查看次数