Introduced lazy config loading. Faster in general.

Instead of allocating all memory up front for every possible command
option this new approach just expects certain variable names. If those
variables are used in a function the manager_property, server_property
or world_property command ensures that the variable has been loaded
from config files.

This approach uses sed to retrieve a single line from a config file
when necessary, instead of reading every line at startup.
This commit is contained in:
Marcus Whybrow 2012-07-20 02:41:37 +01:00
parent c46db621e0
commit 60a6af24c2
2 changed files with 674 additions and 266 deletions

930
init/msm

File diff suppressed because it is too large Load Diff

View File

@ -27,13 +27,11 @@ oneTimeSetUp() {
setUp() {
source "$DEFUALT_CONF"
# Create the testing conf from the default one
mkdir -p "$TMP_DIR" && chown "$USERNAME" "$TMP_DIR"
cp "$DEFUALT_CONF" "$MSM_CONF" && chown "$USERNAME" "$MSM_CONF"
# Overwrite the directories to use for testin purposes
# Overwrite the directories to use for testing purposes
echo "" >> "$MSM_CONF"
echo "# Auto appended by test script:" >> "$MSM_CONF"
echo "SERVER_STORAGE_PATH=\"${TMP_DIR}/servers\"" >> "$MSM_CONF"
@ -46,8 +44,6 @@ setUp() {
echo "DEFAULT_SCREEN_NAME=\"msmtest-{SERVER_NAME}\"" >> "$MSM_CONF"
echo "DEFAULT_INVOCATION=\"java -Xmx${TEST_RAM}M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -jar {JAR} nogui\"" >> "$MSM_CONF"
source "$MSM_CONF"
# Variables accessible by all tests, which are set by the stdall, stderr,
# stdout and quiet utility functions.
declare OUTPUT