Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dagang Wei functicons

🎯
Focusing
View GitHub Profile
@functicons
functicons / WordCount.scala
Created Dec 30, 2018 — forked from miguno/WordCount.scala
WordCount application in Scala 2.11+, using Kafka's Streams API (Kafka version 0.11.0.0)
View WordCount.scala
import java.lang.Long
import java.util.Properties
import java.util.concurrent.TimeUnit
import org.apache.kafka.common.serialization._
import org.apache.kafka.streams._
import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable}
import scala.collection.JavaConverters.asJavaIterableConverter
View benchmark-commands.txt
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@functicons
functicons / serialize-deserialize-lambda-and-class.java
Created Jun 7, 2018
Serialize and deserialize Java lambda functions and classes.
View serialize-deserialize-lambda-and-class.java
package com.example;
import java.io.*;
import java.util.function.Function;
/**
* Serialize and deserialize lambda functions and classes.
*/
public class Main {
public static void main(String[] args) throws Exception {
@functicons
functicons / ExtractOriginalMethodNameFromReferenceExample.java One can use a SerializedLambda to unreflect the actual method referred to by a MethodReference
View ExtractOriginalMethodNameFromReferenceExample.java
package de.tdlabs.training.hacks;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static java.util.Arrays.asList;
@functicons
functicons / ExtractOriginalMethodNameFromReferenceExample.java One can use a SerializedLambda to unreflect the actual method referred to by a MethodReference
View ExtractOriginalMethodNameFromReferenceExample.java
package de.tdlabs.training.hacks;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static java.util.Arrays.asList;
@functicons
functicons / GitHub-Forking.md
Created May 9, 2018 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j