Skip to content

Instantly share code, notes, and snippets.

View mwmitchell's full-sized avatar

Matt Mitchell mwmitchell

View GitHub Profile
package api
import (
"log"
"sync"
"time"
)
type EventBus struct {
mutex sync.RWMutex
package com.foo.bar;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonSerializer;
package foo.bar.proto;
import com.google.protobuf.Descriptors;
import com.google.protobuf.Message;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
package com.lucidworks.connectors.jobs.leader;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.redisson.api.RLockReactive;
#!/usr/bin/env bash
set -e
NS=$(kubectl config view --minify --output 'jsonpath={..namespace}')
>&2 echo "namespace: ${NS}"
BROKER=$(kubectl get pods | grep broker | head -n1 | cut -d" " -f1)
>&2 echo "broker: ${BROKER}"
#!/usr/bin/env bash
set -e
kubectl get pods | grep bookkeeper | cut -d" " -f1 | xargs -I {} sh -c 'echo "instance: {}" && kubectl exec -ti {} -- df -h | grep bookkeeper'
package com.test;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import java.nio.charset.Charset;
import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;
public class ReactiveGroupsDemo {
#!/usr/bin/env bash
DIR=$(dirname "$0")
NS=$($DIR/current-namespace)
PODS=$(kubectl -n $NS get pods -l app.kubernetes.io/name=rpc-service -o name)
for pod in $PODS; do
tstamp=$(date +%s)
package com.test;
import com.google.common.base.Stopwatch;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import reactor.core.Disposable;
package com.lucidworks.fusion.service.connectors.job.emitter;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.io.ByteSource;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;