摘要:
Kafka作用: 解决系统间的耦合 异步通信 削峰填谷 kafa的stream简单,入门要求低,方便部署 Kafka学习的重点 消息队列Message Queue Kafka Streaming 流处理 消息队列: 至多一次:一个消息只能被一个消费者消费一次,消费完queue就删除。 没有限制:一个 阅读全文
摘要:
策略模式:封装的是做一个事情的具体方法。封装以后可以选择任意的具体的方法。 实现: 各种具体方法使用Strategy接口,Context包含了strategy,通过改变它来调用不同的strategy 好处: 被封装的各种具体方法是一个class,可以被继承,可以根据需要被来控制程序而不改变程序本身的 阅读全文
摘要:
Design Pattern : Singleton (设计模式:单例) 单例模式(Singleton):单例对象的类必须保证只有一个实例存在。许多时候整个系统只需要拥有一个的全局对象,这样有利于我们协调系统整体的行为。 几种实现方法: 方法一: 这种方法很简单,就是把instance变成priva 阅读全文
摘要:
Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). Example 1: Example 2: Exa 阅读全文
摘要:
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements 阅读全文
摘要:
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
摘要:
Given a string containing only three types of characters: '(', ')' and ' ', write a function to check whether this string is valid. We define the vali 阅读全文
摘要:
Given an array nums of n integers where n 1, return an array output such that output[i] is equal to the product of all the elements of nums except num 阅读全文
摘要:
You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: direction can be 0 (for left 阅读全文
摘要:
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: Note: The length of the giv 阅读全文