#plumbd configuration file example
# search for xxx and replace with meaningful values
# This is a mess!

queuingSystemHDFSPath = /user/plumb
queuingSystem = ${queuingSystemHDFSPath}/QueueingSystem
localPlumbInstallPath = /opt/plumb
localQueueSysName = ${localPlumbInstallPath}/lander_hard_link_emulation/wip
environment.path.prepend = ${localPlumbInstallPath}/venv/bin
internalScriptsPath = ./scripts
hdfsFileListerScript = ${internalScriptsPath}/lister.sh
scratchSpace = ${sys:user.home}/plumb_scratch
scratchSpaceForYAMLs = ${sys:user.home}/stage_yaml_scratch
HDFSScratchSpace = /user/${sys:user.name}/scratch_space
userProgHDFSDir = ${queuingSystemHDFSPath}/jobserver/user-progs

#keys
serverPrivateKey = ${localQueueSysName}/keys/xxx-plumbhostname/server.key.pem
serverCertChain =  ${localQueueSysName}/keys/xxx-plumbhostname/chain2
rootsCertChain =   ${localQueueSysName}/keys/xxx-plumbhostname/roots.pem

clientPrivateKeyFileName = client.key.pem
clientCertChainFileName = client_chain
clientPrivateKeyDir = ${localQueueSysName}/keys/xxx-plumbhostname
clientCertChainDir  = ${localQueueSysName}/keys/xxx-plumbhostname

adminClientPrivateKeyFileName = client.key.pem
adminClientCertChainFileName = client_chain
adminClientPrivateKeyDir = ${localQueueSysName}/keys/xxx-plumbhostname/adminclient
adminClientCertChainDir =  ${localQueueSysName}/keys/xxx-plumbhostname/adminclient

pathToRegEx = ${localQueueSysName}/sup/regex.py
pathToYamlUtil = ${localQueueSysName}/sup/yamlutil.py
pathToHLEBASHAPI= ${localQueueSysName}/shell/call_lander_api_function_via_rpc.sh

errorRecoveryInterval = 240
maxYARNJobRunTime = 120
maxRetires = 2

yarn_resourcemanager_hostname_key = yarn.resourcemanager.hostname
yarn_resourcemanager_hostname_val = xxx-yarnheadnode
fs_default_name_key = fs.default.name
fs_default_name_val = hdfs://xxx-hdfsnamenode:9000/

#job paths in hdfs
HDFSClientBaseDirPath = ${queuingSystemHDFSPath}/jobserver/user-jobs
submitted = submitted
accepted = accepted
rejected = rejected
retracted = retracted

#ToDo: Do I need following 4 dir?  Since usr name will be before final submitted etc?
HDFSClientDirSubmitted = ${HDFSClientBaseDirPath}/submitted
HDFSClientDirAccepted =  ${HDFSClientBaseDirPath}/accepted
HDFSClientDirRejected =  ${HDFSClientBaseDirPath}/rejected
HDFSClientDirRetracted = ${HDFSClientBaseDirPath}/retracted

HDFSClientDirSubmittedSearch = ${HDFSClientBaseDirPath}/*/submitted
HDFSClientDirAcceptedSearch =  ${HDFSClientBaseDirPath}/*/accepted
HDFSClientDirRejectedSearch =  ${HDFSClientBaseDirPath}/*/rejected
HDFSClientDirRetractedSearch = ${HDFSClientBaseDirPath}/*/retracted
HDFSOptBaseDirPath = ${queuingSystemHDFSPath}/jobserver/opt-jobs

#application server name and listening port
ApplicationServerHostName = xxx-plumbhostname
ApplicationServerListeningPort = 30000

# python based gRPC Server (hard-link-emulation + windowing)
QueueServerHostName = xxx-hlehostname
QueueServerListeningPort = 50051


#Local paths for disp and dup tables
dupName =  __dup__
dispName = __disp__
dupPath =  ${scratchSpace}/${dupName}
dispPath = ${scratchSpace}/${dispName}
#For Hadoop application master, cwd is some place provided by YARN
dupPathForAppMaster =  ./${dupName}
dispPathForAppMaster = ./${dispName}

dupDispStateSavePathInHDFS = ${queuingSystemHDFSPath}/jobserver/dup_disp_table
dispPathInHDFS = ${dupDispStateSavePathInHDFS}/${dispName}
dupPathInHDFS =  ${dupDispStateSavePathInHDFS}/${dupName}

overallOptimizedYAML = pipeline.yaml
overallOptimizedDiagram = pipeline.png
optYamlTextPath = ${HDFSOptBaseDirPath}/${overallOptimizedYAML}
optYamlDiagramPath = ${HDFSOptBaseDirPath}/${overallOptimizedDiagram}

# maximum concurrent YARN workers. Change as needed.  New number will be used without the need to re-start Plumb
# application server
maxAllowedWorkersGlobally = 200
# 1 = yes; 0 = no; In case of no, use maxAllowedWorkersGlobally cores instead
FindTotalVirtualCoresOnClusterDynamically = 1
clusterStatusPort = 8088
clusterMetricsURL = http://${ApplicationServerHostName}:${clusterStatusPort}/ws/v1/cluster/metrics
