public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STREAM_ID |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static Object |
deserialize(byte[] serialized) |
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 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 <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) |
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 |
newCuratorStarted(Map conf,
List<String> servers,
Object port) |
static org.apache.curator.framework.CuratorFramework |
newCuratorStarted(Map conf,
List<String> servers,
Object port,
String root) |
static Object |
newInstance(String klass) |
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) |
static void |
sleep(long millis) |
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 Object deserialize(byte[] serialized)
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 IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public 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)
public static org.apache.curator.framework.CuratorFramework newCurator(Map conf, List<String> servers, Object port)
public static org.apache.curator.framework.CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port, String root)
public static org.apache.curator.framework.CuratorFramework newCuratorStarted(Map conf, List<String> servers, Object port)
public static TreeMap<Integer,Integer> integerDivided(int sum, int numPieces)
sum
- numPieces
- public static byte[] toByteArray(ByteBuffer buffer)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.