Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View electrum's full-sized avatar
🚀
Working on @trinodb and @starburstdata

David Phillips electrum

🚀
Working on @trinodb and @starburstdata
View GitHub Profile
@electrum
electrum / gist:814835
Created February 7, 2011 17:58
Amazon S3 Design Principles

Amazon S3 Design Principles

The following principles of distributed system design were used to meet Amazon S3 requirements:

Decentralization: Use fully decentralized techniques to remove scaling bottlenecks and single points of failure.

Asynchrony: The system makes progress under all circumstances.

Autonomy: The system is designed such that individual components can make decisions based on local information.

@electrum
electrum / bench-assert.txt
Created September 2, 2011 18:32
snappy-1.0.3 benchmarks
Running microbenchmarks.
WARNING: Compiled with assertions enabled, will be slow.
Benchmark Time(ns) CPU(ns) Iterations
---------------------------------------------------
BM_UFlat/0 66408 66404 2856 1.4GB/s html
BM_UFlat/1 715414 715374 270 936.0MB/s urls
BM_UFlat/2 6901 6901 28368 17.1GB/s jpg
BM_UFlat/3 23015 23014 8071 3.8GB/s pdf
BM_UFlat/4 270188 270209 710 1.4GB/s html4
BM_UFlat/5 25094 25089 7388 935.2MB/s cp
import com.sun.management.ThreadMXBean;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
public final class ThreadMemory
{
public static void main(String[] args)
{
ThreadMXBean threadMXBean = (ThreadMXBean) ManagementFactory.getThreadMXBean();
@electrum
electrum / Batchable.java
Created August 28, 2017 14:23
Jdbi Batchable
package org.jdbi.v3.sqlobject;
/**
* A mixin interface to expose batching methods on the SQL object.
*/
public interface Batchable
{
/**
* Begin a SQL batch that will send multiple statements to the database
* at once. After this is called, a single
@electrum
electrum / build-native-mac.sh
Last active July 16, 2020 06:34
Compile native libraries on Mac OS X
brew install snappy
CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ant compile-native
chmod 644 build/native/Mac_OS_X-x86_64-64/lib/*
ls -l /usr/local/lib/libsnappy.dylib
ls -l build/native/Mac_OS_X-x86_64-64/lib/libhadoop.dylib
@electrum
electrum / eclipse-airlift.importorder
Created January 24, 2013 20:50
Eclipse code style for Airlift
#Organize Import Order
#Thu Jan 24 12:47:53 PST 2013
3=\#
2=java
1=javax
0=
@electrum
electrum / README.md
Last active June 2, 2020 12:04
Git Scripts

Install the following programs and configure them with permissions to access your GitHub profile:

These scripts assume the following two remotes exist:

  • origin: your fork
  • upstream: the upstream repository
@electrum
electrum / LoggingInterceptor.java
Created May 13, 2020 19:22
OkHttp LoggingInterceptor
package io.prestosql.client;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import static io.airlift.units.Duration.nanosSince;
import static java.lang.String.format;
@electrum
electrum / README.md
Last active January 14, 2020 21:26
Presto release scripts
!/bin/bash
# kill currently running java process
echo "Java processes: $(pgrep java)"
pkill -9 java
for i in $(seq 1 20)
do
sleep 1
pgrep java || exit