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);
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);
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)The below insructions will work on the assumption that
brew install kafka
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties
auto.create.topics.enable
property is set to true
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; |
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) { |