Skip to content

Instantly share code, notes, and snippets.

View erikdw's full-sized avatar
🏠
Working from home

Erik Weathers erikdw

🏠
Working from home
View GitHub Profile
@erikdw
erikdw / setjdk.sh
Created February 5, 2018 21:23
setjdk shell function. This is what I've used in zsh, should work in bash too.
# Example usage: setjdk 1.8
function setjdk {
local ver=${1?Usage: setjdk <version>}
export JAVA_HOME=$(/usr/libexec/java_home -v $ver)
PATH=$(echo $PATH | tr ':' '\n' | grep -v Java | tr '\n' ':')
export PATH=$JAVA_HOME/bin:$PATH
}
diff --git storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
index 0fa60f129..dd4e8db78 100644
--- storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
+++ storm-core/src/jvm/org/apache/storm/daemon/supervisor/ReadClusterState.java
@@ -145,6 +145,7 @@ public class ReadClusterState implements Runnable, AutoCloseable {
}
}
HashSet<Integer> allPorts = new HashSet<>(assignedPorts);
+ iSuper.assigned(allPorts);
allPorts.addAll(slots.keySet());
diff --git storm/src/main/storm/mesos/MesosSupervisor.java storm/src/main/storm/mesos/MesosSupervisor.java
index 4d3b05b..2cbb777 100644
--- storm/src/main/storm/mesos/MesosSupervisor.java
+++ storm/src/main/storm/mesos/MesosSupervisor.java
@@ -41,9 +41,13 @@ import storm.mesos.util.MesosCommon;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
@erikdw
erikdw / 0. Build mesos.md
Last active September 14, 2017 22:56
Issue with task not launching
# git clone github.com:mesos/mesos
# cd mesos
# mkdir build
# ... blah blah ...
# build it
# cd build
@erikdw
erikdw / MetaspaceResearch.md
Created September 8, 2017 18:54 — forked from changreytang/MetaspaceResearch.md
Research the impacts of the replacement of PermGen with Metaspace from JDK7 to JDK8

Metaspace Research

What is PermGen?

  • The Permanent Generation memory pool contains permanent class metadata and descriptors information when classes are loaded
    • PermGen space is always reserved for classes and items that are attached to them (i.e., static members)
  • PermGem space is contiguous in memory to the Java heap and have the same rounds of Garbage Collection but it is not part of the Java heap

What is Metaspace?

  • In JDK8, the PermGen space has been entirely replaced by Metaspace which is no longer contiguous to the Java heap and now exists in native memory
@erikdw
erikdw / capifony.sh
Created August 17, 2017 21:52 — forked from KernelFolla/capifony.sh
run legacy capifony using docker, works on osx and linux
#!/bin/bash
IMAGE="mjanser/capifony"
CURRDIR=$(pwd)
if [ "$(uname)" == "Darwin" ]; then
# under Mac OS X platform
command -v jq >/dev/null 2>&1 || { echo >&2 "please install jq with \"brew install jq\" or \"port install jq\""; exit 1; }
docker pull $IMAGE
ENTRYPOINT=$(docker inspect $IMAGE | jq -r '.[0].ContainerConfig.Entrypoint[0]')
% cd storm
% mvn validate
% (find . -name 'checkstyle-result.xml' -exec cat {} \;) | grep 'consecutive capital letters' | cut -d';' -f2 | cut -d'&' -f1 | sort | uniq -c | sort
diff --git Vagrantfile Vagrantfile
index bbbca8b..775fada 100755
--- Vagrantfile
+++ Vagrantfile
@@ -65,7 +65,7 @@ fi
install_package "libcurl3"
install_package "zookeeperd"
install_package "aria2"
-install_package "mesos=0.25.0-0.2.70.ubuntu1404"
+install_package "mesos=1.0.1-2.0.93.ubuntu1404"
@erikdw
erikdw / HelloCovariance.java
Last active October 6, 2016 09:54 — forked from AlainODea/HelloCovariance.java
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class HelloCovariance {
public static void main(String[] args) {
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>();
Set<String> keySet = properties.keySet();
}
}
2016-06-19T07:55:05.924+0000 s.m.u.MesosCommon [INFO] Available resources at workerhostname: 
  cpu: Resource cpus - Total available : 19.500000 Total available by reservation type : [ , [DYNAMICALLY_RESERVED : 0.0, STATICALLY_RESERVED : 0.0, UNRESERVED : 19.5] ], 
  memory: Resource mem - Total available : 88561.000000 Total available by reservation type : [ , [DYNAMICALLY_RESERVED : 0.0, STATICALLY_RESERVED : 0.0, UNRESERVED : 88561.0] ],
  ports : [31003-31003,31005-32000]

Example of new log:

2016-06-19T09:21:43.075+0000 s.m.u.MesosCommon [INFO] Available resources at workerhostname: