Skip to content

Instantly share code, notes, and snippets.

View ivankelly's full-sized avatar

Ivan Kelly ivankelly

View GitHub Profile
package main
import (
"context"
"fmt"
"runtime/pprof"
"sync/atomic"
"time"
"unsafe"
)
ackage org.apache.bookkeeper.client;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LongPollTest {
public static final Logger log = LoggerFactory.getLogger(LongPollTest.class);
public static void main(String[] args) throws Exception {
BookKeeper bkc = new BookKeeper("localhost:2181");
@ivankelly
ivankelly / role-creds.sh
Created February 15, 2019 15:14
turn role info in env variables.
#!/usr/bin/env bash
which jq > /dev/null
if [ $? != 0 ]; then
echo "You need to install jq for this to work"
exit 1
fi
which aws > /dev/null
if [ $? != 0 ]; then
#!/usr/bin/env python
#
#/**
# * Copyright 2018 The Apache Software Foundation
# *
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the

Description:

BookKeeper is a scalable, fault-tolerant, and low-latency storage service optimized for append-only workloads. It has been used as a fundamental service to build high available and replicated services in companies like Twitter, Yahoo and Salesforce. It is also the log segment store for Apache DistributedLog and message store for Apache Pulsar.

Issues:

There are no issues requiring board attention at this time.

@ivankelly
ivankelly / changes.sh
Created October 20, 2017 22:48
stacked changes
~/src/bookkeeper $ git checkout master
Switched to branch 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
~/src/bookkeeper $ git fetch origin
~/src/bookkeeper $ git reset --hard origin/master
HEAD is now at 51a58cbe Increase timeouts in TestDisableEnsembleChange
~/src/bookkeeper $ git checkout -b change-1
~/src/bookkeeper $ git commit -a -m "Test Change 1" [change-1 4177e2f4] Test Change 1
1 file changed, 1 insertion(+)
@ivankelly
ivankelly / summed-and-sorted.sh
Last active June 2, 2017 10:56
tenuring final
$ cat output.txt | awk '/IKDEBUG/ {SUM[$2] += $8} END { for (k in SUM) { print SUM[k] " " k }}' | sort -nr
83682219 java.util.concurrent.ConcurrentHashMap$Node
65864623 java.lang.Long
64053362 org.midonet.util.concurrent.TimedExpirationMap$Metadata
63963100 org.midonet.util.PaddedAtomicInteger
46520121 scala.Tuple2
46519012 java.util.concurrent.ConcurrentLinkedQueue$Node
40975159 org.midonet.packets.NatState$NatBinding
40480819 org.midonet.packets.IPv4Addr
30912221 [Ljava.lang.Object;
@ivankelly
ivankelly / gc-output.txt
Last active June 2, 2017 10:49
tenuring output
15 71.19 56.85 79.86 0.01 0.01 3 0 0 0
IKDEBUG >> printing ages
IKDEBUG [B - age 0 - count 79
IKDEBUG [B - age 1 - count 152
IKDEBUG java.lang.ref.WeakReference - age 0 - count 78
IKDEBUG java.lang.ref.WeakReference - age 1 - count 533
IKDEBUG java.lang.Long - age 0 - count 74
IKDEBUG java.lang.Long - age 1 - count 96
IKDEBUG [Ljava.lang.Object; - age 0 - count 926
IKDEBUG [Ljava.lang.Object; - age 1 - count 832
@ivankelly
ivankelly / build-jdk2.bash
Last active June 2, 2017 13:00
tenure-build-2
~/jdk8u-wtftenure$ cd hotspot/
~/jdk8u-wtftenure/hotspot $ curl -L https://gist.github.com/ivankelly/17e4f89a7e1947814f0ae9d554291ed9/raw | patch -p1
~/jdk8u-wtftenure$ cd -
~/jdk8u-wtftenure$ bash ./configure
~/jdk8u-wtftenure$ make
@ivankelly
ivankelly / wtf-tenuring.patch
Last active June 2, 2017 09:35
tenuring-patch
diff -r b4bdf3484720 src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
--- a/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Thu Jan 05 01:40:00 2017 +0000
+++ b/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Wed Jan 18 13:35:05 2017 +0100
@@ -40,7 +40,7 @@
_term_attempts(0),
_tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
_age_table(false), _scanner(g1h, rp),
- _strong_roots_time(0), _term_time(0) {
+ _strong_roots_time(0), _term_time(0), survivorAges() {
_scanner.set_par_scan_thread_state(this);