public String createVersion() throws IOException { Long mostRecent = mostRecentVersion(); long version = Time.currentTimeMillis(); if (mostRecent != null && version <= mostRecent) { version = mostRecent + 1; } return createVersion(version); }
public static NimbusClient getNimbusClient(Map conf) { if (client != null) { return client; } if (conf == null) { conf = Utils.readStormConfig(); } client = NimbusClient.getConfiguredClient(conf); return client; }
@Override public void cleanup() { invalidate(); if (remoteClient != null) { remoteClient.close(); } }
public void succeedVersion(String path) throws IOException { long version = validateAndGetVersion(path); // should rewrite this to do a file move createNewFile(tokenPath(version)); }
@Override public void shutdown() { if (client != null) { client.close(); client = null; } } }
public static int getNumAcked(String stormId) { synchronized (acked) { return get(acked, stormId, 0); } }
@Override public byte[] serialize(T obj) { if (obj != null) return Utils.serialize(obj); else return null; }
@Override public Collection create(Kryo kryo, Input input, Class<Collection> type) { return new ListDelegate(); } }
private Map<Integer, List<List<Object>>> getQueues() { Map<Integer, List<List<Object>>> ret = (Map<Integer, List<List<Object>>>) RegisteredGlobalState.getState(_id); if (ret != null) return ret; else return _initialPartitions; }
@Override public T deserialize(byte[] b) { if (b != null) return (T) Utils.javaDeserialize(b); else return null; } }
public void clear() { while (population() != 0L) { poll(); } }
public static Object javaDeserialize(byte[] serialized) { return javaDeserializeWithCL(serialized, WorkerClassLoader.getInstance()); }
@Override public void consumeExecuteQueue() { // Consume control queue first, and then async consume execute queue controlQueue.consumeBatchWhenAvailable(this); exeQueue.consumeBatch(this); } }
@Override public MutableObject newInstance() { return new MutableObject(); } }
/** * Static method to execute a shell command. Covers most of the simple cases without requiring the user to implement the <code>Shell</code> interface. * * @param cmd shell command to execute. * @return the output of the executed command. */ public static String execCommand(String... cmd) throws IOException { return execCommand(null, cmd, 0L); }
/** * Go thrift gzip serializer */ public static byte[] serialize(Object obj) { /** * JStorm disables the thrift.gz.serializer */ // return serializationDelegate.serialize(obj); return javaSerialize(obj); }
@Override public List<Object> retreiveAvailableBatch() throws AlertException, InterruptedException, TimeoutException { // get all events in disruptor queue return getConsumeBatch(); }
public static int getNumFailed(String stormId) { synchronized (failed) { return get(failed, stormId, 0); } }
/** * Go thrift gzip serializer */ public static <T> T deserialize(byte[] serialized, Class<T> clazz) { /** * @@@ JStorm disable the thrift.gz.serializer */ // return serializationDelegate.deserialize(serialized, clazz); return (T) javaDeserialize(serialized); }
public static int getNumAcked(String stormId) { synchronized (acked) { return get(acked, stormId, 0); } }