public class SupervisorUtils extends Object
Constructor and Description |
---|
SupervisorUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
blobNeedsWorkerRestart(Map<String,Object> blobInfo)
Given the blob information returns the value of the workerRestart field, handling it either being a string or 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 String |
getNumaIdForPort(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 LSWorkerHeartbeat |
readWorkerHeartbeatImpl(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 void |
resetInstance() |
static void |
rmrAsUser(Map<String,Object> conf,
String id,
String path) |
static void |
setInstance(SupervisorUtils u) |
static boolean |
shouldUncompressBlob(Map<String,Object> blobInfo)
Given the blob information returns the value of the uncompress field, handling it either being a string or a boolean value, or if it’s not specified then returns false.
|
static Collection<String> |
supervisorWorkerIds(Map<String,Object> conf) |
public static void setInstance(SupervisorUtils u)
public static void resetInstance()
public static String getNumaIdForPort(Integer port, Map<String,Object> supervisorConf)
getNumaIdForPort for a specific supervisor.
port
- portsupervisorConf
- supervisorConfpublic static Set<Integer> getNumaPorts(Map<String,Object> supervisorConf)
gets the set of all configured numa ports for a specific supervisor.
supervisorConf
- supervisorConfpublic static void rmrAsUser(Map<String,Object> conf, String id, String path) throws IOException
IOException
public static boolean shouldUncompressBlob(Map<String,Object> blobInfo)
Given the blob information returns the value of the uncompress field, handling it either being a string or a boolean value, or if it’s not specified then returns false.
public static boolean blobNeedsWorkerRestart(Map<String,Object> blobInfo)
Given the blob information returns the value of the workerRestart field, handling it either being a string or a boolean value, or if it’s not specified then returns false.
blobInfo
- the info for the blob.public static List<LocalResource> blobstoreMapToLocalresources(Map<String,Map<String,Object>> blobstoreMap)
Returns a list of LocalResources based on the blobstore-map passed in.
public static Collection<String> supervisorWorkerIds(Map<String,Object> conf)
public static Map<String,LSWorkerHeartbeat> readWorkerHeartbeats(Map<String,Object> conf)
Map from worker id to heartbeat.
public static Map<String,Object> getNumaMap(Map<String,Object> stormConf)
Return supervisor numa configuration.
stormConf
- stormConfpublic Map<String,LSWorkerHeartbeat> readWorkerHeartbeatsImpl(Map<String,Object> conf)
protected LSWorkerHeartbeat readWorkerHeartbeatImpl(Map<String,Object> conf, String workerId)
Copyright © 2020 The Apache Software Foundation. All rights reserved.