Skip to content

Instantly share code, notes, and snippets.

Avatar

Lee Dongjin dongjinleekr

View GitHub Profile
@dongjinleekr
dongjinleekr / keybase.md
Created May 5, 2020
Proof of my identity for Keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am dongjinleekr on github.
  • I am dongjinleekr (https://keybase.io/dongjinleekr) on keybase.
  • I have a public key ASBY5pir8DtYwtcEP9Ybe3NLsqGgdKjBk_zYOmRoJMdJhAo

To claim this, I am signing this object:

View Safe unboxing in Java
public class Numbers {
private Numbers() {
}
public static boolean valueOf(Boolean b) {
return valueOf(b, false);
}
public static boolean valueOf(Boolean b1, boolean b2) {
if (null == b1) {
@dongjinleekr
dongjinleekr / AccumulatingMapValues.java
Created Feb 7, 2017
Accumulating Map Values in Java 8
View AccumulatingMapValues.java
// Uses a function instance with internal state, along with mapping the map values only.
// see: http://stackoverflow.com/questions/23213891/how-to-map-values-in-a-map-in-java-8
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.function.Function;
import static java.util.stream.Collectors.toMap;
@dongjinleekr
dongjinleekr / consumer.sh
Last active Sep 29, 2020
Kafka benchmark commands
View consumer.sh
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
You can’t perform that action at this time.