zookeeper-server-start.sh
- starting Zookeeperkafka-server-start.sh
- start Kafkakafka-topics.sh
- manage topics in Kafkakafka-console-producer.sh
- script for sending messages to Kafka topickafka-console-consumer.sh
- script for consuming messages from Kafka topickafka-run-class.sh
- script for running different tools (list of tools can be found here)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpeningTime { | |
internal var isClosed = false | |
internal val customerPresence: StringBuilder = StringBuilder() | |
} | |
fun computePenalty(log: String, closingTime: Int): Int { | |
val logArray = log.split(" ") | |
var penalty = 0 | |
for (i in logArray.indices) { | |
if (i < closingTime) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.piotrkafel.ratelimiter; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.TimeUnit; | |
public class DifferentFixedWindowRateLimiter<T> { | |
private final int windowMaxSize; | |
private final Map<T, Window> store = new ConcurrentHashMap<>(); | |
private final long windowSizeInMillies; |
The below insructions will work on the assumption that
- You are using OSX
- You use Kafka 2.0 version
- Install Kafka on your machine -
brew install kafka
- Start Kafka together with ZooKeeper -
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties
- Make sure
auto.create.topics.enable
property is set totrue
Convenience Factory Methods for Collections (JEP 269)
Provide static factory methods on the List
, Set
and Map
interfaces for creating unmodifiable instances of those collections.
List.of();
List.of(E e1);
List.of(E e1, E e2);