摘要: docker 阅读全文
posted @ 2020-07-31 09:03 王晓天 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 1、运行结果错误。 比如 i++ 操作,表面上看只是一行代码,但实际上它并不是一个原子操作,它的执行步骤主要分为三步,而且在每步操作之间都有可能被打断。 第一个步骤是读取;第二个步骤是增加;第三个步骤是保存。 public class WrongResult { public static void 阅读全文
posted @ 2020-06-27 17:06 王晓天 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1、使用 BlockingQueue ArrayBlockingQueue 完成了很多工作,比如队列满了就去阻塞生产者线程,队列有空就去唤醒生产者线程等。 import java.util.concurrent.*; public class MyProdCons { public static v 阅读全文
posted @ 2020-06-27 15:09 王晓天 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 相同点:它们都可以让线程阻塞。它们都可以响应 interrupt 中断:在等待的过程中如果收到中断信号,都可以进行响应,并抛出 InterruptedException 异常。 不同点:wait 方法必须在 synchronized 保护的代码中使用,而 sleep 方法并没有这个要求。在同步代码中 阅读全文
posted @ 2020-06-27 09:40 王晓天 阅读(425) 评论(0) 推荐(0) 编辑
摘要: For Flink applications to run reliably at large scale, two conditions must be fulfilled: The application needs to be able to take checkpoints reliably 阅读全文
posted @ 2020-06-24 11:49 王晓天 阅读(396) 评论(0) 推荐(0) 编辑
摘要: Motivation In Flink’s checkpointing, each task produces a snapshot of its state that is then written to a distributed store. Each task acknowledges a 阅读全文
posted @ 2020-06-24 10:42 王晓天 阅读(527) 评论(0) 推荐(0) 编辑
摘要: Limitations of Hadoop Hadoop can perform only batch processing, and data will be accessed only in a sequential manner. That means one has to search th 阅读全文
posted @ 2020-06-24 10:10 王晓天 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Incremental Checkpoints Recovery time of incremental checkpoints may be longer or shorter compared to full checkpoints. If your network bandwidth is t 阅读全文
posted @ 2020-06-23 22:39 王晓天 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 假定将单例模式限定为不是全用静态函数实现。1、使用的方便性:如果需要初始化工作,单例模式可以在构造函数里面完成,全静态函数的类需要一个额外的函数来完成初始化工作,而且使用者如果没有调用 initialize 函数,那么后续的操作就会有问题。而构造函数会被默认调用,所以使用起来比较简单,对使用者做出了 阅读全文
posted @ 2020-06-22 16:55 王晓天 阅读(210) 评论(0) 推荐(0) 编辑
摘要: A core element in Flink’s distributed snapshotting are the stream barriers. These barriers are injected into the data stream and flow with the records 阅读全文
posted @ 2020-06-20 11:41 王晓天 阅读(619) 评论(0) 推荐(0) 编辑