小编ale*_*oid的帖子

AWS Glue 与 EMR 无服务器

最近,AWS 发布了 Amazon EMR Serverless(预览版)https://aws.amazon.com/blogs/big-data/announcing-amazon-emr-serverless-preview-run-big-data-applications-without-managing-servers/ - 非常有前途的新服务。

根据我的理解 - AWS Glue 是 Apache Spark 之上的托管服务(用于转换层)。AWS EMR 也主要用于 Apache Spark。因此,EMR Serverless(适用于 Apache Spark)看起来与 AWS Glue 非常相似。

现在我脑子里有一个问题 - 与 AWS Glue 的核心区别是什么以及何时选择 EMR Serverless 而不是 Glue?

潜在的 EMR Serverless,甚至可能成为 AWS Glue 转换层生态系统的一部分?也许 AWS 将用 EMR Serverless 取代 AWS Glue 中的转换层,这样就有意义了。AWS Glue 将扮演 ETL Overlay、Metastore 的角色,并以 EMR Serverless 作为处理层。

amazon-web-services amazon-emr aws-glue emr-serverless

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

DETACH DELETE Neo4j 2.3.x/Cypher

DETACH DELETE在Neo4j 2.3.x中添加新Cypher运算符的行为和目的是什么?

neo4j cypher

15
推荐指数
2
解决办法
6517
查看次数

org.apache.catalina.connector.ClientAbortException:java.io.IOException:APR错误:-32

在我的Spring Boot + Tomcat 8项目中,我配置了@ControllerAdvice如下所示:

@ControllerAdvice
public class GlobalControllerExceptionHandler {

    final static Logger logger = LoggerFactory.getLogger(GlobalControllerExceptionHandler.class);

    private static final String ERROR = "error";

    @ExceptionHandler
    @ResponseBody
    @ResponseStatus(HttpStatus.BAD_REQUEST)
    public Map<String, ResponseError> handleException(Exception e, HttpServletRequest request, HttpServletResponse response) throws IOException {
        logger.debug("API error", e);
        return createResponseError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
    }

    protected Map<String, ResponseError> createResponseError(int httpStatus, String message) {
        Map<String, ResponseError> responseError = new HashMap<String, ResponseError>();
        responseError.put(ERROR, new ResponseError(httpStatus, message));
        return responseError;
    }

}
Run Code Online (Sandbox Code Playgroud)

一切正常,除了客户端发送复杂且不正确的JSON文档并且我的服务器逻辑因以下异常而失败的情况:

2836538 WARN  o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Failed to invoke @ExceptionHandler method: …
Run Code Online (Sandbox Code Playgroud)

tomcat jackson tomcat8 spring-boot spring-restcontroller

14
推荐指数
1
解决办法
3万
查看次数

如何处理Spring Security更新中的defaultRolePrefix ="ROLE_"从3.2.7到4.0.2.RELEASE

我的Spring Boot应用程序可以运行Spring Security 3.2.7.RELEASE.现在,我想将其更新为4.0.2.RELEASE.

经过几个小时的调试后,我发现Spring Security 4.0.2.RELEASE使用了 defaultRolePrefix="ROLE_"

org.springframework.security.access.expression.SecurityExpressionRoot.hasAnyAuthorityName(String prefix, String... roles) 方法

在我的应用程序中,我使用没有此前缀的角色,因此我得到了AccessDeniedException.

如何配置Spring Boot才能使用SecurityExpressionRoot.defaultRolePrefix=""

spring spring-security spring-boot

13
推荐指数
1
解决办法
3328
查看次数

LakeFS、Hudi、Delta Lake合并以及合并冲突

我正在阅读有关 LakeFS 的文档,现在还不清楚什么是 LakeFS 的合并甚至合并冲突。

假设我使用 Apache Hudi 对单个表提供 ACID 支持。我想引入多表 ACID 支持,为此我想将 LakeFS 与 Hudi 一起使用。

如果我理解正确的话,lakeFS 是一个与数据无关的解决方案,对数据本身一无所知。LakeFS 仅建立边界(版本控制)并以某种方式调节对数据的并发访问。

所以合理的问题是——如果 LakeFS 与数据无关,它如何支持合并操作?合并本身对 LakeFS 意味着什么?那里有可能发生合并冲突吗?

data-lake delta-lake apache-hudi lakefs data-lakehouse

13
推荐指数
1
解决办法
509
查看次数

AWS SQS消息保留期

根据文档,AWS SQS消息保留期的最大值为14天.在那之后,消息将从队列中删除.

SQS是否有任何方式在保留期到期后不丢失这些消息?例如,目前尚不清楚或是否可以为此目的使用死信队列?

amazon-sqs amazon-web-services

12
推荐指数
1
解决办法
7992
查看次数

Vaadin 10为新项目

我是Java开发人员,我将开始新项目.我的客户端开发技能非常有限,这就是为什么我真的很喜欢Vaadin框架的想法.我已经评估了Vaadin 10 Bakery App Starter应用程序https://vaadin.com/start#vaadin10,并且为了使这个应用程序启动并运行而自定义的HTML/CSS/JavaScript数量让我感到惊讶.现在我真的很困惑,不明白它如何简化开发人员的生活.

我现在可以作为项目启动器使用的唯一应用程序是着名的QuickTickets Dashboard https://demo.vaadin.com/dashboard/,其中所有UI都是纯Java实现的.目前最大的问题是这个应用程序是在Vaadin 8上实现的,我无法为Vaadin 10找到它的版本.你有类似Vaadin 10的东西吗?如果不是,您是否有从Vaadin 8到Vaadin 10的迁移指南,我可以使用它来尝试将此应用程序移植到Vaadin 10?

vaadin vaadin8 vaadin10 vaadin-flow

12
推荐指数
3
解决办法
3861
查看次数

休息,Spring自己的OAuth2服务器+ OAuth2提供商,如Facebook,谷歌,雅虎

在Spring Boot应用程序中,我使用Spring Security和Spring OAuth2保护了我的Spring MVC REST端点.我有自己的Authorization\Resource服务器,所以为了与我们的API通信,客户端(AngularJS)需要从我的API授权服务器获取acessToken.

一切正常,但对于我的API的身份验证/授权,用户需要创建他的帐户并向我们提供他的用户名/密码.

我想简化此过程,并建议用户通过Google/Facebook/Twitter oAuth提供商对我的API进行身份验证.

现在我还不清楚它是如何运作的.例如我的一个想法 - Facebook将发布自己的accessToken并将其传递回我的API.基于此accessToken,我的API将发出自己的accessToken并将其传递回客户端应用程序(AngularJS).或者我应该直接将Facebook accessToken传递给客户端应用程序?

所述案例的正确架构是什么?它应该如何工作?

也许有一些例子可以演示基于Spring框架的这种架构?

spring spring-security oauth-2.0 spring-social spring-security-oauth2

11
推荐指数
1
解决办法
3277
查看次数

Spring Batch访问步骤内的作业参数

我有一个以下的Spring Batch Job配置:

@Configuration
@EnableBatchProcessing
public class JobConfig {

    @Autowired
    private JobBuilderFactory jobBuilderFactory;

    @Autowired
    private StepBuilderFactory stepBuilderFactory;

    @Bean
    public Job job() {
        return jobBuilderFactory.get("job")
                .flow(stepA()).on("FAILED").to(stepC())
                .from(stepA()).on("*").to(stepB()).next(stepC())
                .end().build();
    }

    @Bean
    public Step stepA() {
        return stepBuilderFactory.get("stepA").tasklet(new RandomFailTasket("stepA")).build();
    }

    @Bean
    public Step stepB() {
        return stepBuilderFactory.get("stepB").tasklet(new PrintTextTasklet("stepB")).build();
    }

    @Bean
    public Step stepC() {
        return stepBuilderFactory.get("stepC").tasklet(new PrintTextTasklet("stepC")).build();
    }

}
Run Code Online (Sandbox Code Playgroud)

我正在使用以下代码开始工作:

    try {
                    Map<String,JobParameter> parameters = new HashMap<>();
                    JobParameter ccReportIdParameter = new JobParameter("03061980");
                    parameters.put("ccReportId", ccReportIdParameter);

                    jobLauncher.run(job, new JobParameters(parameters));
                } catch (JobExecutionAlreadyRunningException | JobRestartException | …
Run Code Online (Sandbox Code Playgroud)

java spring spring-batch

11
推荐指数
1
解决办法
1万
查看次数

Spring Boot 2和OAuth2/JWT配置

我正在尝试将Spring boot 1.5应用程序移植到Spring Boot 2

现在我无法获得OAuth2访问令牌.

这是我成功使用Spring Boot 1.5的代码:

public static String loginAndGetAccessToken(String username, String password, int port) {

    ResourceOwnerPasswordResourceDetails resourceDetails = new ResourceOwnerPasswordResourceDetails();
    resourceDetails.setUsername(username);
    resourceDetails.setPassword(password);
    resourceDetails.setAccessTokenUri(String.format("http://localhost:%d/api/oauth/token", port));
    resourceDetails.setClientId("clientapp");
    resourceDetails.setClientSecret("123456");
    resourceDetails.setGrantType("password");
    resourceDetails.setScope(Arrays.asList("read", "write"));

    DefaultOAuth2ClientContext clientContext = new DefaultOAuth2ClientContext();

    OAuth2RestTemplate restTemplate = new OAuth2RestTemplate(resourceDetails, clientContext);
    restTemplate.setMessageConverters(Arrays.asList(new MappingJackson2HttpMessageConverter()));

    return restTemplate.getAccessToken().toString();
}
Run Code Online (Sandbox Code Playgroud)

它失败并出现以下异常:

java.lang.IllegalStateException: An OAuth 2 access token must be obtained or an exception thrown.
    at org.springframework.security.oauth2.client.token.AccessTokenProviderChain.obtainAccessToken(AccessTokenProviderChain.java:124)
    at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221)
    at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173)
Run Code Online (Sandbox Code Playgroud)

看起来http://localhost:%d/api/oauth/token端点现在是安全的,无法访问

这是我的配置:

OAuth2ServerConfig

@Configuration
public class OAuth2ServerConfig {

    public …
Run Code Online (Sandbox Code Playgroud)

spring spring-mvc spring-boot spring-oauth2

11
推荐指数
1
解决办法
5296
查看次数