Skip to content

Instantly share code, notes, and snippets.

package dev.responsive.demo;
import static dev.responsive.kafka.api.async.AsyncFixedKeyProcessorSupplier.createAsyncProcessorSupplier;
import dev.responsive.kafka.api.ResponsiveKafkaStreams;
import dev.responsive.kafka.api.stores.ResponsiveKeyValueParams;
import dev.responsive.kafka.api.stores.ResponsiveStores;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
@rodesai
rodesai / ExampleApplication.java
Created August 13, 2024 19:48
Example Kafka Streams Application w/ Remote API Calls
package dev.responsive.examples.async;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Map;
@rodesai
rodesai / Main.java
Created October 23, 2023 06:01
Responsive Sizing Example
package dev.responsive.example;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.util.concurrent.RateLimiter;
import dev.responsive.example.Main2.Event.Type;
import dev.responsive.example.Main2.OrderProgress.Status;
import dev.responsive.kafka.api.ResponsiveKafkaStreams;
import java.io.IOException;
@rodesai
rodesai / Main.java
Created October 23, 2023 06:00
Responsive Sizing Example
package dev.responsive.example;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.util.concurrent.RateLimiter;
import dev.responsive.example.Main2.Event.Type;
import dev.responsive.example.Main2.OrderProgress.Status;
import dev.responsive.kafka.api.ResponsiveKafkaStreams;
import java.io.IOException;
@rodesai
rodesai / example.java
Created October 23, 2023 06:00
Responsive Sizing Example
package dev.responsive.example;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.util.concurrent.RateLimiter;
import dev.responsive.example.Main2.Event.Type;
import dev.responsive.example.Main2.OrderProgress.Status;
import dev.responsive.kafka.api.ResponsiveKafkaStreams;
import java.io.IOException;
@rodesai
rodesai / gist:56663a8c517127f89d7cfd2f4a238833
Created October 23, 2023 05:59
Responsive Sizing Example
package dev.responsive.example;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.util.concurrent.RateLimiter;
import dev.responsive.example.Main2.Event.Type;
import dev.responsive.example.Main2.OrderProgress.Status;
import dev.responsive.kafka.api.ResponsiveKafkaStreams;
import java.io.IOException;
2021-02-10 19:08:50
Full thread dump OpenJDK 64-Bit Server VM (11.0.2+7 mixed mode, sharing):
Threads class SMR info:
_java_thread_list=0x00007fa0e00055c0, length=32, elements={
0x00007fa1100c7000, 0x00007fa1100c9000, 0x00007fa1100d0000, 0x00007fa1100d2800,
0x00007fa1100d4800, 0x00007fa1100d6800, 0x00007fa1100fe800, 0x00007fa1109f0800,
0x00007fa0d402b800, 0x00007fa0d4049800, 0x00007fa0d4054800, 0x00007fa0c4001000,
0x00007fa110a67800, 0x00007fa110a81800, 0x00007fa110d2e000, 0x00007fa0b4022800,
0x00007fa11106e000, 0x00007fa111070000, 0x00007fa111072000, 0x00007fa111073800,
@rodesai
rodesai / gist:725255bfb871b34b1dff3e9eaeec7a00
Created October 6, 2020 06:44
reproduce-memory-growth.c
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#define SIZE 32 * 1024
#define CACHE_SIZE 196608
@rodesai
rodesai / stream-stream-join-plan
Last active December 12, 2019 08:13
Plan for stream-stream join
{
"@type": "ksqlPlanV1",
"statementText": "CREATE STREAM INNER_JOIN AS SELECT\n T.NAME NAME,\n T.VALUE VALUE,\n TT.F1 F1,\n TT.F2 F2\nFROM TEST T\nINNER JOIN TEST_STREAM TT WITHIN 11 SECONDS ON ((T.ID = TT.ID))\nEMIT CHANGES",
"ddlCommand": {
"@type": "createStreamV1",
"sourceName": "INNER_JOIN",
"schema": "`ROWKEY` STRING KEY, `NAME` STRING, `VALUE` BIGINT, `F1` STRING, `F2` BIGINT",
"topicName": "INNER_JOIN",
"formats": {
"keyFormat": {
@rodesai
rodesai / aggregate-plan
Last active December 12, 2019 08:15
plan for average aggregation
{
"@type": "ksqlPlanV1",
"statementText": "CREATE TABLE AVG AS SELECT\n TEST.ID ID,\n (SUM(TEST.VALUE) / COUNT(TEST.ID)) AVG\nFROM TEST TEST\nGROUP BY TEST.ID\nHAVING ((SUM(TEST.VALUE) / COUNT(TEST.ID)) > 25)\nEMIT CHANGES",
"ddlCommand": {
"@type": "createTableV1",
"sourceName": "AVG",
"schema": "`ROWKEY` STRING KEY, `ID` BIGINT, `AVG` BIGINT",
"keyField": "ID",
"topicName": "AVG",
"formats": {