public class EventRecording extends ModuleAdapter
Ring Buffer (single producer, lock free)
____
/ | \
^ /1 _|_ 2\
| |__/ \__|
Producer->|6 | | 3|
|__|___|__|
\ 5 | 4 / <-- Recording Thread
\__|__/ |
V
Actual input channel ring buffer has thousands of events (not 6).
The producer is a single input channel which reads incoming data,
parses it and places it into the ring buffer.
*
Input Channels
(evio bank RB1 RB2
ring buffer) | |
| |
V V
1 RecordingThread: RT1
Grab 1 event and |
place in module's |
output channels |
|
V
Output Channel(s): OC1, OC2, ...
(1 ring buffer for
each channel)
This class is the event recording module. It has one recording thread. This thread takes buffers of Evio banks off of the input channels. There are a number of special rules that apply to the Event Recorder’s handling of channels. There is no restriction on a single input channel. However, there should never be more than 2 input channels in which case one must be an emu socket and the other an ET channel. The emu socket is assumed to carry the main flow of physics events. Any ET input channel is assumed to carry user events and is given a lower priority. This means reading from it should never block.
The only output channel types allowed are ET and file. A maximum of 1 ET output channel is permitted. All control and “first” events are sent over all channels. Any “first” event coming before the prestart event is placed after it instead. User events, however, are placed only into the first file channel. If no file channels exist, they’re placed into the ET channel. A prescaled number of output physics events are sent over the ET channel. Whereas physics events are sent round-robin to all file channels.ModuleAdapter.RateCalculatorThread
Modifier and Type | Field and Description |
---|---|
com.lmax.disruptor.SequenceBarrier[] |
barriersIn
All recording threads share one barrier.
|
com.lmax.disruptor.Sequence[] |
sequencesIn
One sequence for recording thread.
|
attributeMap, avgEventSize, emu, endCallback, epThreadsSetInConfig, errorMsg, eventCountTotal, eventProducingThreads, eventRate, goodChunk_X_EtBufSize, id, inputChanLevels, inputChanNames, inputChannelCount, inputChannels, logger, maxEventSize, minEventSize, moduleState, name, outputChanLevels, outputChanNames, outputChannelCount, outputChannels, outputOrder, paused, prestartCallback, RateCalculator, representStatistics, statGatheringPeriod, statistics, timeStatsOn, timeToBuild, wordCountTotal, wordRate
Constructor and Description |
---|
EventRecording(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributeMap,
Emu emu)
Constructor creates a new EventRecording instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearChannels()
Remove all channels from this EmuModule object.
|
void |
end()
This method implements the END transition of the CODA run control state machine.
|
void |
go()
This method implements the GO transition of the CODA run control state machine.
|
void |
prestart()
This method implements the PRESTART transition of the CODA run control state machine.
|
void |
reset()
This method implements the RESET transition of the CODA run control state machine.
|
addInputChannels, addOutputChannels, adjustStatistics, download, eventToOutputChannel, eventToOutputChannel, getAttr, getEndCallback, getError, getEventProducingThreadCount, getInputChannels, getInputLevels, getInputNames, getIntAttr, getInternalRingCount, getOutputChannels, getOutputLevels, getOutputNames, getOutputOrder, getPrestartCallback, getStatistics, name, pause, registerEndCallback, registerPrestartCallback, representsEmuStatistics, state
public com.lmax.disruptor.Sequence[] sequencesIn
public com.lmax.disruptor.SequenceBarrier[] barriersIn
public EventRecording(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> attributeMap, Emu emu)
name
- name of moduleattributeMap
- map containing attributes of moduleemu
- Emu this module belongs to.public void clearChannels()
clearChannels
in interface EmuModule
clearChannels
in class ModuleAdapter
public void reset()
reset
in interface CODAStateMachine
reset
in class ModuleAdapter
public void go()
go
in interface CODAStateMachine
go
in class ModuleAdapter
public void end()
end
in interface CODAStateMachine
end
in class ModuleAdapter
public void prestart() throws CmdExecException
prestart
in interface CODAStateMachine
prestart
in class ModuleAdapter
CmdExecException
- if error during command execution.