public abstract class BeehiveAppLoader extends Object
This class is responsible for connecting this Beehive server to the validator, constructing its LocalWorkpoolServer,
and loading its nodes into its StorageSystem. How each node loads its nodes into its StorageSystem is
dependent on the FileLoader configuration:
StorageSystem
If a server is assigned the role of the master, it is responsible for ensuring that each server in the cluster is fully loaded and started before the Application can start.
Once Application has fully initialized, it is then responsible for creating its Workers and starting them
| Constructor and Description |
|---|
BeehiveAppLoader() |
| Modifier and Type | Method and Description |
|---|---|
Vector<String> |
createHostList(String myHostname)
Constructs a list of the hostnames of its peers in the cluster.
|
StorageSystem |
getDataStorage() |
String |
getHostlistFile() |
String |
getLocation() |
int |
getMyId() |
int |
getNumNodes() |
int |
getNumThreads() |
LocalWorkpoolImpl |
getWorkpool() |
void |
init(String[] args,
String classname,
HashMap<Byte,String> nodeClassNameMap,
HashMap<Byte,Class> nodeClassMap)
This is run on each Beehive server in the cluster.
|
boolean |
isMaster() |
boolean |
isRecordStats() |
boolean |
isUseCaching() |
boolean |
isUseNodeData() |
boolean |
isWriteThroughCache() |
abstract void |
loadGraphData(String input_file,
HashtableServer server,
int numNodes,
StorageSystem dataStorage)
Each Application is responsible for defining how it is to load its graph file into the Beehive System.
|
void |
printToResultFile(String[] args,
int numThreads,
String classname) |
void |
readConfigParams(Config configParams) |
void |
setDataStorage(StorageSystem dataStorage) |
void |
setHostlistFile(String hostlistFile) |
void |
setLocation(String location) |
void |
setMaster(boolean master) |
void |
setMyId(int myId) |
void |
setNumNodes(int numNodes) |
void |
setNumThreads(int numThreads) |
void |
setRecordStats(boolean recordStats) |
void |
setUseCaching(boolean useCaching) |
void |
setUseNodeData(boolean useNodeData) |
void |
setWorkpool(LocalWorkpoolImpl workpool) |
void |
setWriteThroughCache(boolean writeThroughCache) |
public void init(String[] args, String classname, HashMap<Byte,String> nodeClassNameMap, HashMap<Byte,Class> nodeClassMap) throws Exception
args - Arguments provided at runtime. Includes the following in the corresponding order:
ValidationService classname - The name of the Application that is being runnodeClassNameMap - A mapping from a unique byte identifier to the name of each subclass of Node,
including Node itself, that is to be used in the Application.nodeClassMap - A mapping from a unique byte identifier to the Class object of each subclass of Node,
including Node itself, that is to be used in the Application. It is not
required that the byte identifier be identical to that in classname.Exception - Thrown if the application could not connect to the cluster and/or validatorpublic abstract void loadGraphData(String input_file, HashtableServer server, int numNodes, StorageSystem dataStorage)
input_file - The file containing the graph that is to be loaded at this particular Beehive serverserver - The local HashtableServer to this Beehive servernumNodes - The total number of nodes in the input_filedataStorage - The local StorageSystem to this Beehive serverpublic Vector<String> createHostList(String myHostname)
myHostname - This server's hostname so that it can be excluded from the list of peer hostnamespublic void printToResultFile(String[] args, int numThreads, String classname) throws Exception
Exceptionpublic void readConfigParams(Config configParams)
public boolean isUseCaching()
public void setUseCaching(boolean useCaching)
public boolean isRecordStats()
public void setRecordStats(boolean recordStats)
public boolean isWriteThroughCache()
public void setWriteThroughCache(boolean writeThroughCache)
public int getMyId()
public void setMyId(int myId)
public String getHostlistFile()
public void setHostlistFile(String hostlistFile)
public LocalWorkpoolImpl getWorkpool()
public void setWorkpool(LocalWorkpoolImpl workpool)
public StorageSystem getDataStorage()
public void setDataStorage(StorageSystem dataStorage)
public String getLocation()
public void setLocation(String location)
public int getNumNodes()
public void setNumNodes(int numNodes)
public boolean isUseNodeData()
public void setUseNodeData(boolean useNodeData)
public boolean isMaster()
public void setMaster(boolean master)
public int getNumThreads()
public void setNumThreads(int numThreads)