From d276d3345e2441f8b439de2ec2a095b0cfba8c45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 22 Jul 2013 00:18:57 +0000 Subject: [PATCH] Some fixes: - added missing interface - added missing space (convention) - used constant for queu name - reduced work unit size --- application/hub/config.php | 5 ++++- application/hub/main/cruncher/class_BaseHubCruncher.php | 2 +- .../wrapper/cruncher/class_CruncherUnitDatabaseWrapper.php | 2 +- application/hub/main/producer/class_BaseProducer.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/application/hub/config.php b/application/hub/config.php index 8c9e48060..04d5b8f6d 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -920,6 +920,9 @@ $cfg->setConfigEntry('cruncher_test_unit_template_type', 'xml/cruncher/producer' // CFG: STACKER-CRUNCHER-TEST-UNIT-MAX-SIZE $cfg->setConfigEntry('stacker_cruncher_test_unit_max_size', 20); +// CFG: STACKER-OUTGOING-QUEUE-MAX-SIZE +$cfg->setConfigEntry('stacker_outgoing_queue_max_size', 2000); + // CFG: CRUNCHER-TEST-UNIT-MAX-COUNT $cfg->setConfigEntry('cruncher_test_unit_max_count', 1000); @@ -951,7 +954,7 @@ $cfg->setConfigEntry('cruncher_init_state_class', 'CruncherInitState'); $cfg->setConfigEntry('cruncher_virgin_state_class', 'CruncherVirginState'); // CFG: CRUNCHER-PER-UNIT-KEY-LIMIT -$cfg->setConfigEntry('cruncher_per_unit_key_limit', 10000); +$cfg->setConfigEntry('cruncher_per_unit_key_limit', 1000); /////////////////////////////////////////////////////////////////////////////// // Chat Configuration diff --git a/application/hub/main/cruncher/class_BaseHubCruncher.php b/application/hub/main/cruncher/class_BaseHubCruncher.php index 4f55a45a5..1b6bdab09 100644 --- a/application/hub/main/cruncher/class_BaseHubCruncher.php +++ b/application/hub/main/cruncher/class_BaseHubCruncher.php @@ -98,7 +98,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable { */ protected function isInBufferQueueFilled () { // Determine it - $isFilled = ($this->bufferInstance->getStackCount('in_queue') > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold')); + $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold')); // And return the result return $isFilled; diff --git a/application/hub/main/database/wrapper/cruncher/class_CruncherUnitDatabaseWrapper.php b/application/hub/main/database/wrapper/cruncher/class_CruncherUnitDatabaseWrapper.php index f99b2f0e1..0d1b0513a 100644 --- a/application/hub/main/database/wrapper/cruncher/class_CruncherUnitDatabaseWrapper.php +++ b/application/hub/main/database/wrapper/cruncher/class_CruncherUnitDatabaseWrapper.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class CruncherUnitDatabaseWrapper extends BaseDatabaseWrapper implements UnitDatabaseWrapper { +class CruncherUnitDatabaseWrapper extends BaseDatabaseWrapper implements UnitDatabaseWrapper, Registerable { // Constants for database table names const DB_TABLE_CRUNCHER_UNITS = 'cruncher_units'; diff --git a/application/hub/main/producer/class_BaseProducer.php b/application/hub/main/producer/class_BaseProducer.php index 38f8c9b68..1045a0153 100644 --- a/application/hub/main/producer/class_BaseProducer.php +++ b/application/hub/main/producer/class_BaseProducer.php @@ -152,7 +152,7 @@ abstract class BaseProducer extends BaseFrameworkSystem { * @param $configEntry Configuration entry where the limit is stored * @return $isReached Whether the limit is reached */ - protected function isOutgoingQueueLimitReached($configEntry) { + protected function isOutgoingQueueLimitReached ($configEntry) { return ($this->getConfigInstance()->getConfigEntry($configEntry) <= $this->getOutgoingQueueInstance()->getStackCount(self::STACKER_NAME_OUT_QUEUE)); } -- 2.39.5