| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_STREAM_ID |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserialize(byte[] serialized,
Class<T> clazz) |
static void |
downloadFromMaster(Map conf,
String file,
String localFile) |
static boolean |
exceptionCauseIsInstanceOf(Class klass,
Throwable throwable) |
static Map |
findAndReadConfigFile(String name) |
static Map |
findAndReadConfigFile(String name,
boolean mustExist) |
static List<URL> |
findResources(String name) |
static <S,T> T |
get(Map<S,T> m,
S key,
T def) |
static boolean |
getBoolean(Object o,
boolean defaultValue) |
static ComponentCommon |
getComponentCommon(StormTopology topology,
String id) |
static Integer |
getInt(Object o) |
static Integer |
getInt(Object o,
Integer defaultValue) |
static Object |
getSetComponentObject(ComponentObject obj) |
static List<org.apache.zookeeper.data.ACL> |
getWorkerACL(Map conf) |
static byte[] |
gunzip(byte[] data) |
static byte[] |
gzip(byte[] data) |
static void |
handleUncaughtException(Throwable t) |
static TreeMap<Integer,Integer> |
integerDivided(int sum,
int numPieces)
(defn integer-divided [sum num-pieces]
(let [base (int (/ sum num-pieces))
num-inc (mod sum num-pieces)
num-bases (- num-pieces num-inc)]
(if (= num-inc 0)
{base num-bases}
{base num-bases (inc base) num-inc}
)))
|
static boolean |
isSystemId(String id) |
static boolean |
isValidConf(Map<String,Object> stormConf) |
static boolean |
isZkAuthenticationConfiguredStormServer(Map conf)
Is the cluster configured to interact with ZooKeeper in a secure way?
This only works when called from within Nimbus or a Supervisor process.
|
static boolean |
isZkAuthenticationConfiguredTopology(Map conf)
Is the topology configured to have ZooKeeper authentication.
|
static <T> T |
javaDeserialize(byte[] serialized,
Class<T> clazz) |
static byte[] |
javaSerialize(Object obj) |
static <T> String |
join(Iterable<T> coll,
String sep) |
static clojure.lang.IFn |
loadClojureFn(String namespace,
String name) |
static org.apache.curator.framework.CuratorFramework |
newCurator(Map conf,
List<String> servers,
Object port,
String root) |
static org.apache.curator.framework.CuratorFramework |
newCurator(Map conf,
List<String> servers,
Object port,
String root,
ZookeeperAuthInfo auth) |
static org.apache.curator.framework.CuratorFramework |
newCurator(Map conf,
List<String> servers,
Object port,
ZookeeperAuthInfo auth) |
static org.apache.curator.framework.CuratorFramework |
newCuratorStarted(Map conf,
List<String> servers,
Object port,
String root,
ZookeeperAuthInfo auth) |
static org.apache.curator.framework.CuratorFramework |
newCuratorStarted(Map conf,
List<String> servers,
Object port,
ZookeeperAuthInfo auth) |
static Object |
newInstance(String klass) |
static void |
readAndLogStream(String prefix,
InputStream in) |
static Map |
readCommandLineOpts() |
static Map |
readDefaultConfig() |
static Map |
readStormConfig() |
static <K,V> Map<V,K> |
reverseMap(Map<K,V> map) |
static long |
secureRandomLong() |
static byte[] |
serialize(Object obj) |
protected static void |
setupBuilder(org.apache.curator.framework.CuratorFrameworkFactory.Builder builder,
String zkStr,
Map conf,
ZookeeperAuthInfo auth) |
static void |
sleep(long millis) |
static String |
threadDump() |
static byte[] |
toByteArray(ByteBuffer buffer) |
static List<Object> |
tuple(Object... values) |
public static final String DEFAULT_STREAM_ID
public static byte[] serialize(Object obj)
public static <T> T deserialize(byte[] serialized,
Class<T> clazz)
public static byte[] javaSerialize(Object obj)
public static <T> T javaDeserialize(byte[] serialized,
Class<T> clazz)
public static byte[] gzip(byte[] data)
public static byte[] gunzip(byte[] data)
public static void sleep(long millis)
public static Map readDefaultConfig()
public static Map readCommandLineOpts()
public static Map readStormConfig()
public static Object getSetComponentObject(ComponentObject obj)
public static <S,T> T get(Map<S,T> m, S key, T def)
public static void downloadFromMaster(Map conf, String file, String localFile) throws AuthorizationException, IOException, org.apache.thrift.TException
AuthorizationExceptionIOExceptionorg.apache.thrift.TExceptionpublic static boolean isSystemId(String id)
public static ComponentCommon getComponentCommon(StormTopology topology, String id)
public static boolean getBoolean(Object o, boolean defaultValue)
public static long secureRandomLong()
public static org.apache.curator.framework.CuratorFramework newCurator(Map conf, List<String> servers, Object port, String root)
public static org.apache.curator.framework.CuratorFramework newCurator(Map conf, List<String> servers, Object port, String root, ZookeeperAuthInfo auth)
protected static void setupBuilder(org.apache.curator.framework.CuratorFrameworkFactory.Builder builder,
String zkStr,
Map conf,
ZookeeperAuthInfo auth)
public static org.apache.curator.framework.CuratorFramework newCurator(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth)
public static org.apache.curator.framework.CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root, ZookeeperAuthInfo auth)
public static org.apache.curator.framework.CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, ZookeeperAuthInfo auth)
public static TreeMap<Integer,Integer> integerDivided(int sum, int numPieces)
sum - numPieces - public static byte[] toByteArray(ByteBuffer buffer)
public static void readAndLogStream(String prefix, InputStream in)
public static boolean exceptionCauseIsInstanceOf(Class klass, Throwable throwable)
public static boolean isZkAuthenticationConfiguredStormServer(Map conf)
conf - the storm configuration, not the topology configurationpublic static boolean isZkAuthenticationConfiguredTopology(Map conf)
conf - the topology configurationpublic static String threadDump()
public static void handleUncaughtException(Throwable t)
Copyright © 2015. All rights reserved.