Skip to content

Instantly share code, notes, and snippets.

@mitch-seymour
mitch-seymour / docker-compose.yml
Created September 23, 2022 15:14
Docker compose with user
version: '3.7'
services:
redpanda:
user: '101:101'
image: docker.redpanda.com/vectorized/redpanda:v22.2.1
container_name: redpanda-1
command:
- redpanda
- start
- --smp
@mitch-seymour
mitch-seymour / docker-compose.yml
Created September 23, 2022 14:49
test new docker-compose
version: '3.7'
services:
redpanda:
image: docker.redpanda.com/vectorized/redpanda:v22.2.1
container_name: redpanda-1
command:
- redpanda
- start
- --config
- /configs/redpanda.yaml
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: trafficshadows.smispec.mitchseymour.com
spec:
group: smispec.mitchseymour.com
scope: Namespaced
names:
kind: TrafficShadow
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: trafficsplits.split.smispec.io
spec:
group: split.smispec.io
scope: Namespaced
names:
kind: TrafficSplit
class MyTopologyTest {
  @Test
  public void testDecodeId() {
    String key = "1XRZTUW3";
    byte[] value = new byte[] {};
    String actualValue = MyTopology.decodeKey(key, value);
    String expectedValue = "decoded-1XRZTUW3";
    assertThat(actualValue).isEqualTo(expectedValue);
 }
{
  "outputs": [
    {
      "topic": "greetings",
      "timestamp": 0,
      "value": {
        "greeting": "Hello, Isabelle"
      },
 "key": 0
+---------+---------------------+----------------------------------+
|TITLE_ID |BEFORE               |AFTER               |CREATED_AT   |
+---------+---------------------+--------------------+-------------+
|1        |{SEASON_ID=1,        |{SEASON_ID=1,       |2021-02-08...|
            EPISODE_COUNT=12}     EPISODE_COUNT=8}
Connector Name  | Type   | Class | Status
--------------------------------------------------------------
postgres-source | SOURCE | ...   | FAILED
--------------------------------------------------------------
KeyValueBytesStoreSupplier storeSupplier = Stores.lruMap("counts", 10);

StreamsBuilder builder = new StreamsBuilder();
KStream<String, String> stream = builder.stream("patient-events");

stream
    .groupByKey()
    .count(
 Materialized.as(storeSupplier)
Map<String, String> topicConfigs = new HashMap<>();
topicConfigs.put("segment.bytes", "536870912");
topicConfigs.put("min.cleanable.dirty.ratio", "0.3");

StreamsBuilder builder = new StreamsBuilder();
KStream<byte[], String> stream = builder.stream("patient-events");

KTable<byte[], Long> counts =
 stream