Transformer Pipeline Module API Reference  8.0.3.342099-79b6f512
Configuration: Pipeline Threads Selector

The thread selector configuration allows a user to select the thread a symbol will be processed on. Use thread-selector-file to configure the name of a pipeline file which should contain the function configured in thread-selector-func. The pipeline file should be placed on the pipeline path pipeline-paths.

The function will be called with the symbol name and the configured number of pipeline threads num-threads. The function should return the thread the symbol should be processed on. If -1 or a value greater than num-threads is returned, default thread selection is used. Below is an example thread-selector-func. It assumes a symbol which is of the form "/THREAD/<digits>"

require("log")
-- Select the thread number based on the number in the subject
-- Assume the subjects to be selected are /THREAD/<thread number>
function select_thread(subject, num_threads)
-- Get the number part of the subject
if ( string.find(subject, "/THREAD/") == nil ) then
log.log(log.INFO, "Not selecting thread for <"..subject.."> num_threads "..num_threads.."\n")
return -1
end
local thread_num = tonumber(string.gsub(subject, "/THREAD/", ""))
thread_num = tonumber(thread) % num_threads
log.log(log.INFO, "Selecting thread " ..thread_num.." for <"..subject.."> num_threads "..num_threads.."\n")
return (tonumber(thread) % num_threads)
end

thread-selector-file

Type: String
Default: None

Pipeline file to execute to select thread


thread-selector-func

Type: String
Default: None

Pipeline function to execute to select thread



Generated on Wed Dec 4 2024 17:41:41 for Transformer Pipeline Module API Reference