About the KXS directory structure¶
This page explains the five main KXS directories and how they're replicated across each package layer.
There are five main directories in KXS: api, config, meta, schema, and src. These same five directories are repeated for each layer (vertical, customer, etc.) in your system. If there is an override at that level, the appropriate directories are populated with a configuration override, a table override, a q code file, etc. If there are no overlays at that level, the directory is empty or missing entirely.
Note
It's important to learn the KXS directory structure before performing upgrades and writing customizations. YAML and q code files placed in the wrong directory by mistake won't run correctly.
Look up your source code¶
Most KX Sensors code, including q files, is located in the src folder. The src/api folder contains q files required to run APIs.
kxs/kxs-core $ ls src
api/ debug/ ha/ mon/ qext/ tmp/
config/ devops/ mdb/ msg/ sapi/ util/
db/ ems/ mdq/ proc/ scripts/
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $ ls src/api
cntDB.q cntDbMisc.q getData.q
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
Look up your enums¶
Enumerations are stored in config/enum in YAML format.
kxs/kxs-core $ ls config/enum
AC.yaml nfyType.yaml
alertState.yaml nodeState.yaml
calcType.yaml org.yaml
cmType.yaml procState.yaml
dbcMergeState.yaml RC.yaml
dbcOp.yaml reissueStage.yaml
dbcStage.yaml routePref.yaml
dbcState.yaml sapiDur.yaml
deliv.yaml sapiPriority.yaml
dsType.yaml sapiProtocol.yaml
EC.yaml sdlMsgType.yaml
feedMode.yaml sev.yaml
feedState.yaml smpType.yaml
fmtType.yaml svcClass.yaml
haEvent.yaml testCtl.yaml
installOp.yaml user.yaml
logLevel.yaml
Look up your service classes¶
Service classes are stored in YAML format in kxs-core/src/proc.
work/kxs $
work/kxs $ cd kxs-core
kxs/kxs-core $ ls
CONTRIBUTING.md build/ docs/ schema/ tests/
README.md config/ gen/ scripts/
api/ deps/ lib/ src/
bin/ dev/ meta/ test/
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $ ls src
api/ db/ devops/ ha/ mdq/ msg/ qext/ scripts/ util/
config/ debug/ ems/ mdb/ mon/ proc/ sapi/ tmp/
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $ ls src/api
cntDB.q cntDbMisc.q getData.q
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $ ls src/proc
cdl/ cp/ hwmon/ mdl/ ntask/ rt/ storage/
common/ dp/ maint/ mon/ repl/ sdl/ svc/
kxs/kxs-core $
kxs/kxs-core $
kxs/kxs-core $
You can also look them up in process.yaml.
process:
values:
- process: <default>
…
- svcClass: DBW
libraries: [ src/proc/storage/dbw/dbw.q ]
init: .dbw.init
…
- svcClass: HDB
libraries: [ src/proc/dp/hdb.q, src/sapi/sapimd.q, src/api/cntDB.q, src/api/getData.q, src/proc/dp/dpapi.q, src/proc/dp/hdbapi.q ]
init: .hdb.init
…
- svcClass: IDB
libraries: [ src/proc/dp/idb.q, src/api/cntDB.q, src/api/getData.q, src/proc/dp/dpapi.q ]
init: .idb.init
…
- svcClass: MAINT
libraries: [ src/proc/maint/maint.q, src/proc/maint/hamaint.q, src/proc/maint/dbcmaint.q, src/proc/maint/encrmaint.q, src/db/ver.q, src/db/vertbl.q, src/sapi/client.q, src/sapi/sapi.q ]
init: .maint.init
The common folder contains all the q files, YAML files, and APIs required by any service class when it starts up.
kxs/kxs-core $ ls src/proc/sdl
dataTransform.q hadlbuff.q sdlAck.q sdlha.q
dataTransformLUT.q importLog.q sdlDefer.q sdlmb.q
dlconns.q oracleDataTransform.q sdlar.q sdlmd.q
hadl.q sdl.q sdlems.q
kxs/kxs-core $
kxs/kxs-core $