From 0f3d022a5cfe24f5af7b9d469cf8b82dab2039dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 18 Apr 2011 21:44:25 +0000 Subject: [PATCH] Bundled all cruncher-related configuration entries together --- application/hub/config.php | 138 +++++++++--------- .../tcp/class_TcpNetworkPackageHandler.php | 18 ++- 2 files changed, 81 insertions(+), 75 deletions(-) diff --git a/application/hub/config.php b/application/hub/config.php index 456bfedf6..f0dfaa5a1 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -42,9 +42,6 @@ $cfg->setConfigEntry('boot_node_udp_listen_port', 9061); // CFG: NODE-DEFAULT-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular') $cfg->setConfigEntry('node_default_mode', 'regular'); -// CFG: CRUNCHER-DEFAULT-MODE (can be only 'mcrypt' at the moment) -$cfg->setConfigEntry('cruncher_default_mode', 'mcrypt'); - // CFG: TEMPLATE-ENGINE $cfg->setConfigEntry('tpl_engine', 'ConsoleOutput'); @@ -141,9 +138,6 @@ $cfg->setConfigEntry('default_hubconsole_command', 'main'); // CFG: HUBCONSOLE-CMD-MAIN-RESOLVER-CLASS $cfg->setConfigEntry('hubconsole_cmd_main_resolver_class', 'HubConsoleCommandResolver'); -// CFG: HUBCONSOLE-CMD-CRUNCHER-RESOLVER-CLASS -$cfg->setConfigEntry('hubconsole_cmd_cruncher_resolver_class', 'HubConsoleCommandResolver'); - // CFG: NETWORK-STATE-RESOLVER-CLASS $cfg->setConfigEntry('network_state_resolver_class', 'NetworkStateResolver'); @@ -156,39 +150,18 @@ $cfg->setConfigEntry('news_process_filter', 'NewsProcessFilter'); // CFG: NODE-PHP-REQUIREMENTS-FILTER $cfg->setConfigEntry('node_php_requirements_filter', 'NodePhpRequirementsFilter'); -// CFG: CRUNCHER-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('cruncher_php_requirements_filter', 'CruncherPhpRequirementsFilter'); - // CFG: NODE-INITIALIZER-FILTER $cfg->setConfigEntry('node_initializer_filter', 'NodeInitializationFilter'); -// CFG: CRUNCHER-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_initializer_filter', 'CruncherInitializationFilter'); - // CFG: NODE-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER $cfg->setConfigEntry('node_activation_task_handler_initializer_filter', 'NodeTaskHandlerInitializerFilter'); -// CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter', 'CruncherTaskHandlerInitializerFilter'); - -// CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter', 'CruncherBootstrapExtraBootstrappingFilter'); - -// CFG: CRUNCHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter', 'CruncherBootstrapBufferQueueInitializerFilter'); - -// CFG: CRUNCHER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter', 'CruncherBootstrapGenericActivationFilter'); - // CFG: NODE-ACTIVATION-SELF-ANNOUNCEMENT-TASK-FILTER $cfg->setConfigEntry('node_activation_self_announcement_task_filter', 'NodeActivationSelfAnnouncementFilter'); // CFG: NODE-WELCOME-TEASER-FILTER $cfg->setConfigEntry('node_welcome_teaser_filter', 'NodeWelcomeTeaserFilter'); -// CFG: CRUNCHER-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('cruncher_welcome_teaser_filter', 'CruncherWelcomeTeaserFilter'); - // CFG: NODE-BOOTSTRAP-GENERATE-HUBID-FILTER $cfg->setConfigEntry('node_bootstrap_generate_nodeid_filter', 'NodeBootstrapGenerateNodeIdFilter'); @@ -219,9 +192,6 @@ $cfg->setConfigEntry('node_shutdown_task_handler_filter', 'NodeShutdownTaskHandl // CFG: NODE-SHUTDOWN-NODE-FILTER $cfg->setConfigEntry('node_shutdown_node_filter', 'NodeShutdownNodeFilter'); -// CFG: CRUNCHER-SHUTDOWN-CRUNCHER-FILTER -$cfg->setConfigEntry('cruncher_shutdown_cruncher_filter', 'CruncherShutdownCruncherFilter'); - // CFG: NEWS-READER-CLASS $cfg->setConfigEntry('news_reader_class', 'ConsoleNewsReader'); @@ -270,9 +240,6 @@ $cfg->setConfigEntry('code_template_type', 'xml'); // CFG: PACKAGE-STACKER-CLASS $cfg->setConfigEntry('network_package_stacker_class', 'FiFoStacker'); -// CFG: CRUNCHER-BUFFER-STACKER-CLASS -$cfg->setConfigEntry('cruncher_buffer_stacker_class', 'FiFoStacker'); - // CFG: PRODUCER-OUTGOING-QUEUE $cfg->setConfigEntry('producer_outgoing_queue', 'FiFoStacker'); @@ -402,15 +369,6 @@ $cfg->setConfigEntry('hub_package_reader_task_class', 'NetworkPackageReaderTask' // CFG: HUB-SOCKET-LISTENER-TASK-CLASS $cfg->setConfigEntry('hub_socket_listener_task_class', 'HubSocketListenerTask'); -// CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS -$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask'); - -// CFG: CRUNCHER-TEST-UNIT-PRODUCER-TASK-CLASS -$cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'CruncherTestUnitProducerTask'); - -// CFG: CRUNCHER-KEY-PRODUCER-TASK-CLASS -$cfg->setConfigEntry('cruncher_key_producer_task_class', 'CruncherKeyProducerTask'); - // CFG: TASK-NETWORK-PACKAGE-WRITER-STARTUP-DELAY $cfg->setConfigEntry('task_network_package_writer_startup_delay', 2500); @@ -438,33 +396,6 @@ $cfg->setConfigEntry('task_socket_listener_interval_delay', 10); // CFG: TASK-SOCKET-LISTENER-MAX-RUNS $cfg->setConfigEntry('task_socket_listener_max_runs', 0); -// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-STARTUP-DELAY -$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_startup_delay', 1000); - -// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-INTERVAL-DELAY -$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_interval_delay', 10); - -// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-MAX-RUNS -$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_max_runs', 0); - -// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-STARTUP-DELAY -$cfg->setConfigEntry('task_cruncher_test_unit_producer_startup_delay', 500); - -// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-INTERVAL-DELAY -$cfg->setConfigEntry('task_cruncher_test_unit_producer_interval_delay', 1000*60*60); - -// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-MAX-RUNS -$cfg->setConfigEntry('task_cruncher_test_unit_producer_max_runs', 0); - -// CFG: TASK-CRUNCHER-KEY-PRODUCER-STARTUP-DELAY -$cfg->setConfigEntry('task_cruncher_key_producer_startup_delay', 750); - -// CFG: TASK-CRUNCHER-KEY-PRODUCER-INTERVAL-DELAY -$cfg->setConfigEntry('task_cruncher_key_producer_interval_delay', 5); - -// CFG: TASK-CRUNCHER-KEY-PRODUCER-MAX-RUNS -$cfg->setConfigEntry('task_cruncher_key_producer_max_runs', 0); - // CFG: TASK-LIST-CLASS $cfg->setConfigEntry('task_list_class', 'TaskList'); @@ -580,6 +511,75 @@ $cfg->setConfigEntry('node_raw_data_input_stream_class', 'RawDataInputStream'); // Cruncher Configuration /////////////////////////////////////////////////////////////////////////////// +// CFG: CRUNCHER-DEFAULT-MODE (can be only 'mcrypt' at the moment) +$cfg->setConfigEntry('cruncher_default_mode', 'mcrypt'); + +// CFG: CRUNCHER-BUFFER-STACKER-CLASS +$cfg->setConfigEntry('cruncher_buffer_stacker_class', 'FiFoStacker'); + +// CFG: HUBCONSOLE-CMD-CRUNCHER-RESOLVER-CLASS +$cfg->setConfigEntry('hubconsole_cmd_cruncher_resolver_class', 'HubConsoleCommandResolver'); + +// CFG: CRUNCHER-PHP-REQUIREMENTS-FILTER +$cfg->setConfigEntry('cruncher_php_requirements_filter', 'CruncherPhpRequirementsFilter'); + +// CFG: CRUNCHER-INITIALIZER-FILTER +$cfg->setConfigEntry('cruncher_initializer_filter', 'CruncherInitializationFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter', 'CruncherTaskHandlerInitializerFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter', 'CruncherBootstrapExtraBootstrappingFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter', 'CruncherBootstrapBufferQueueInitializerFilter'); + +// CFG: CRUNCHER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER +$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter', 'CruncherBootstrapGenericActivationFilter'); + +// CFG: CRUNCHER-WELCOME-TEASER-FILTER +$cfg->setConfigEntry('cruncher_welcome_teaser_filter', 'CruncherWelcomeTeaserFilter'); + +// CFG: CRUNCHER-SHUTDOWN-CRUNCHER-FILTER +$cfg->setConfigEntry('cruncher_shutdown_cruncher_filter', 'CruncherShutdownCruncherFilter'); + +// CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS +$cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask'); + +// CFG: CRUNCHER-TEST-UNIT-PRODUCER-TASK-CLASS +$cfg->setConfigEntry('cruncher_test_unit_producer_task_class', 'CruncherTestUnitProducerTask'); + +// CFG: CRUNCHER-KEY-PRODUCER-TASK-CLASS +$cfg->setConfigEntry('cruncher_key_producer_task_class', 'CruncherKeyProducerTask'); + +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-STARTUP-DELAY +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_startup_delay', 1000); + +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-INTERVAL-DELAY +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_interval_delay', 10); + +// CFG: TASK-CRUNCHER-WORK-UNIT-FETCHER-MAX-RUNS +$cfg->setConfigEntry('task_cruncher_work_unit_fetcher_max_runs', 0); + +// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-STARTUP-DELAY +$cfg->setConfigEntry('task_cruncher_test_unit_producer_startup_delay', 500); + +// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-INTERVAL-DELAY +$cfg->setConfigEntry('task_cruncher_test_unit_producer_interval_delay', 1000*60*60); + +// CFG: TASK-CRUNCHER-TEST-UNIT-PRODUCER-MAX-RUNS +$cfg->setConfigEntry('task_cruncher_test_unit_producer_max_runs', 0); + +// CFG: TASK-CRUNCHER-KEY-PRODUCER-STARTUP-DELAY +$cfg->setConfigEntry('task_cruncher_key_producer_startup_delay', 750); + +// CFG: TASK-CRUNCHER-KEY-PRODUCER-INTERVAL-DELAY +$cfg->setConfigEntry('task_cruncher_key_producer_interval_delay', 5); + +// CFG: TASK-CRUNCHER-KEY-PRODUCER-MAX-RUNS +$cfg->setConfigEntry('task_cruncher_key_producer_max_runs', 0); + // CFG: CRUNCHER-TEST-UNITS-ENABLED $cfg->setConfigEntry('cruncher_test_units_enabled', 'Y'); diff --git a/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php b/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php index 7b644f83b..3dd47493e 100644 --- a/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php @@ -44,6 +44,8 @@ class TcpNetworkPackageHandler extends BaseNetworkPackageHandler implements Netw // Get new instance $handlerInstance = new TcpNetworkPackageHandler(); + // Init stacker instance for processed raw data + $stackerInstance = ObjectFactory::createObjectByConfiguredName(' // Return the prepared instance return $handlerInstance; } @@ -65,6 +67,9 @@ class TcpNetworkPackageHandler extends BaseNetworkPackageHandler implements Netw // Reset error code to unhandled $this->setErrorCode(self::SOCKET_ERROR_UNHANDLED); + // Init variables + $decodedData = false; + // Debug message //* NOISY-DEBUG: */ $this->debugOutput('HANDLER: Handling TCP package from peer ' . $resource); @@ -86,14 +91,15 @@ class TcpNetworkPackageHandler extends BaseNetworkPackageHandler implements Netw // The peer did send nothing to us $this->setErrorCode(self::SOCKET_ERROR_EMPTY_DATA); } else { - // Low-level checks of the raw data went all fine, we can now decode the raw data + /* + * Low-level checks of the raw data went all fine, we can now + * decode the raw data. This may still fail because of invalid + * encoded data. + */ $decodedData = $this->getInputStreamInstance()->streamData($rawData); - - // Is the decoded data false, then streamData() could not validate it - if ($decodedData !== false) { - die('decodedData(' . strlen($decodedData) . ')=' . $decodedData . "\n"); - } // END - if } + + // Add the (maybe above decoded) data and error code to the stacker } } -- 2.39.2