Class SupervisorUtils
- java.lang.Object
-
- org.apache.storm.daemon.supervisor.SupervisorUtils
-
public class SupervisorUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description SupervisorUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanblobNeedsWorkerRestart(Map<String,Object> blobInfo)Given the blob information returns the value of the workerRestart field, handling it being a boolean value, or if it's not specified then returns false.static List<LocalResource>blobstoreMapToLocalresources(Map<String,Map<String,Object>> blobstoreMap)Returns a list of LocalResources based on the blobstore-map passed in.static StringgetNumaIdForPort(Integer port, Map<String,Object> supervisorConf)getNumaIdForPort for a specific supervisor.static Map<String,Object>getNumaMap(Map<String,Object> stormConf)Return supervisor numa configuration.static Set<Integer>getNumaPorts(Map<String,Object> supervisorConf)gets the set of all configured numa ports for a specific supervisor.static List<Integer>getSlotsPorts(Map<String,Object> supervisorConf)protected LSWorkerHeartbeatreadWorkerHeartbeatImpl(Map<String,Object> conf, String workerId)static Map<String,LSWorkerHeartbeat>readWorkerHeartbeats(Map<String,Object> conf)Map from worker id to heartbeat.Map<String,LSWorkerHeartbeat>readWorkerHeartbeatsImpl(Map<String,Object> conf)static voidresetInstance()static voidrmrAsUser(Map<String,Object> conf, String id, String path)static voidsetInstance(SupervisorUtils u)static booleanshouldUncompressBlob(Map<String,Object> blobInfo)Given the blob information returns the value of the uncompress field, handling it being a boolean value, or if it's not specified then returns false.static Collection<String>supervisorWorkerIds(Map<String,Object> conf)
-
-
-
Method Detail
-
setInstance
public static void setInstance(SupervisorUtils u)
-
resetInstance
public static void resetInstance()
-
getNumaIdForPort
public static String getNumaIdForPort(Integer port, Map<String,Object> supervisorConf)
getNumaIdForPort for a specific supervisor.- Parameters:
port- portsupervisorConf- supervisorConf- Returns:
- getNumaIdForPort
-
getNumaPorts
public static Set<Integer> getNumaPorts(Map<String,Object> supervisorConf)
gets the set of all configured numa ports for a specific supervisor.- Parameters:
supervisorConf- supervisorConf- Returns:
- set of all numa ports
-
rmrAsUser
public static void rmrAsUser(Map<String,Object> conf, String id, String path) throws IOException
- Throws:
IOException
-
shouldUncompressBlob
public static boolean shouldUncompressBlob(Map<String,Object> blobInfo)
Given the blob information returns the value of the uncompress field, handling it being a boolean value, or if it's not specified then returns false.
-
blobNeedsWorkerRestart
public static boolean blobNeedsWorkerRestart(Map<String,Object> blobInfo)
Given the blob information returns the value of the workerRestart field, handling it being a boolean value, or if it's not specified then returns false.- Parameters:
blobInfo- the info for the blob.- Returns:
- true if the blob needs a worker restart by way of the callback else false.
-
blobstoreMapToLocalresources
public static List<LocalResource> blobstoreMapToLocalresources(Map<String,Map<String,Object>> blobstoreMap)
Returns a list of LocalResources based on the blobstore-map passed in.
-
supervisorWorkerIds
public static Collection<String> supervisorWorkerIds(Map<String,Object> conf)
-
readWorkerHeartbeats
public static Map<String,LSWorkerHeartbeat> readWorkerHeartbeats(Map<String,Object> conf)
Map from worker id to heartbeat.
-
getNumaMap
public static Map<String,Object> getNumaMap(Map<String,Object> stormConf)
Return supervisor numa configuration.- Parameters:
stormConf- stormConf- Returns:
- getNumaMap
-
readWorkerHeartbeatsImpl
public Map<String,LSWorkerHeartbeat> readWorkerHeartbeatsImpl(Map<String,Object> conf)
-
readWorkerHeartbeatImpl
protected LSWorkerHeartbeat readWorkerHeartbeatImpl(Map<String,Object> conf, String workerId)
-
-