Nodes and Carriage Mechanisms

The following piece should present the decisions behind the Node architecture and the carriage mechanism pluggability.

@startuml

package "Processing Nodes" {
[Consumer Nodes]
[Synthesizer Nodes]
[Producer Nodes]
[Producer Nodes] -- IProducerNode
[Synthesizer Nodes] -- IProducerNode
[Synthesizer Nodes] -- IConsumerNode
[Consumer Nodes] -- IConsumerNode
IProducerNode -- INode
IConsumerNode -- INode
}

package "Carriage Mechanisms" {
[Producer Nodes] -> IProducerCarriage : emit_data
[Websocket] - IProducerCarriage
[Websocket] ..> HTTP :use
IConsumerCarriage - [Websocket]
[Websocket] -up-> INode : process_document
[Synthesizer Nodes] -> IProducerCarriage : emit_data

note bottom of [Websocket]
  Carriage mechanisms may
  or may not work
  both directions.
end note

}

note top of [Producer Nodes]
  Producers produce only
end note

note top of [Synthesizer Nodes]
  Synthesizers produce
  and consume as well.
end note

note top of [Consumer Nodes]
  Consumers consume only
end note
@enduml

Processing node and Carriage mechanism components

Processing Nodes

The processing nodes are the key components of this package and facilitate several different use-cases laid out in the Node conformance section of the specification (EBU Tech3370). A node can be a producer or a consumer or both. This requirement is fulfilled by the class structure depicted below.

@startuml

interface INode {
  ..methods..
  +{abstract} process_document()
}
interface IConsumerNode {
  ..properties..
  +{abstract} consumer_carriage
  ..classmethods..
  +expects()
  ..methods..
  +{abstract}register_consumer_carriage()
}
interface IProducerNode {
  ..properties..
  +{abstract} producer_carriage
  ..classmethods..
  +provides()
  ..methods..
  +{abstract}register_producer_carriage()
}

abstract class __AbstractNode {
  -_node_id : String
  ..properties..
  +node_id
  ..methods..
  __repr__()
}
abstract class AbstractConsumerNode {
  -_consumer_carriage
  ..properties..
  +consumer_carriage
  ..methods..
  +register_consumer_carriage()
}
abstract class AbstractProducerNode {
  -_producer_carriage
  ..properties..
  +producer_carriage
  ..methods..
  +register_producer_carriage()
}
abstract class AbstractCombinedNode {
}

class SimpleProducer {
  -_input_blocks : List<String>
  -_document_sequence : EBUTT3DocumentSequence
  -_reference_clock : Clock
  ..properties..
  +document_sequence
  +reference_clock
  ..methods..
  +process_document()
}

class SimpleConsumer {
  -_reference_clock : Clock
  -_sequence : EBUTT3DocumentSequence
  ..properties..
  +reference_clock
  ..methods..
  +process_document()
}

class BufferDelayNode {
  ..methods..
  +process_document()
}

class RetimingDelayNode{
  ..methods..
  +process_document()
}

class EBUTTDEncoder {
  ..methods..
  +process_document()
}

class DistributingNode {
  ..methods..
  +process_document()
}

class ReSequencer {
  ..methods..
  +process_document()
  +get_segment()
  +get_next_segment()
}

class HandoverNode {
  ..methods..
  +process_document()
}

INode <|-- __AbstractNode
__AbstractNode <|-- AbstractConsumerNode
IConsumerNode <|-- AbstractConsumerNode
__AbstractNode <|-- AbstractProducerNode
IProducerNode <|-- AbstractProducerNode
AbstractConsumerNode <|-- AbstractCombinedNode
AbstractProducerNode <|-- AbstractCombinedNode

AbstractProducerNode <|-- SimpleProducer
AbstractProducerNode <|-- ReSequencer
AbstractConsumerNode <|-- SimpleConsumer
AbstractCombinedNode <|-- EBUTTDEncoder
AbstractCombinedNode <|-- BufferDelayNode
AbstractCombinedNode <|-- RetimingDelayNode
AbstractCombinedNode <|-- DistributingNode
AbstractCombinedNode <|-- HandoverNode
SimpleConsumer <|-- ReSequencer

@enduml

Processing node classes

Carriage mechanisms

The carriage mechanisms are divided into 2 distinct kinds: producer and consumer carriages (not to be confused with producer and consumer nodes).

Producer carriages serve the purpose of sending/serialising a document once a processing node has finished processing them and push them via their domain forward.

Consumers carriages on the other hand receive a (probably serialised) document from their own domain and their job is to make sure the document is picked up (possibly parsed and validated) and given to the consumer processing node that the carriage mechanism object is registered to.

The class hierarchy providing the necessary steps looks the following way:

@startuml

interface ICarriageMechanism
interface IConsumerCarriage {
  .. properties ..
  +{abstract} consumer_node
  .. classmethods ..
  +provides()
  .. methods ..
  +{abstract} on_new_data()
  +{abstract} register_consumer_node()
}
interface IProducerCarriage {
  .. properties ..
  +{abstract} producer_node
  .. classmethods ..
  +expects()
  .. methods ..
  +{abstract} emit_data()
  +{abstract} register_producer_node()
}

abstract AbstractConsumerCarriage {
  .. properties ..
  +consumer_node
  .. methods ..
  +register_consumer_node()
}
abstract AbstractProducerCarriage {
  .. properties ..
  +producer_node
  .. methods ..
  +register_producer_node()
}
abstract AbstractCombinedCarriage

class WebsocketConsumerCarriage {
  -_provides : String
  .. methods ..
  +on_new_data()
}
class WebsocketProducerCarriage {
  -_expects : String
  .. methods ..
  +emit_data()
}
class FilesystemConsumerImpl {
  -_provides : String
  .. methods ..
  +on_new_data()
}
class FilesystemProducerImpl {
  -_expects : String
  .. methods ..
  +emit_data()
}
class SimpleFolderExport {
  -_expects : String
  .. methods ..
  +emit_data()
}
class RotatingFolderExport{
  .. methods ..
  +emit_data()
}

class DirectCarriageImpl {
  -_expects : Any
  -_provides : Any
  .. methods ..
  +emit_data()
  +on_new_data()
}


ICarriageMechanism <|-- IProducerCarriage
ICarriageMechanism <|-- IConsumerCarriage

IProducerCarriage <|-- AbstractProducerCarriage
IConsumerCarriage <|-- AbstractConsumerCarriage
AbstractProducerCarriage <|-- AbstractCombinedCarriage
AbstractConsumerCarriage <|-- AbstractCombinedCarriage

AbstractConsumerCarriage <|-- WebsocketConsumerCarriage
AbstractProducerCarriage <|-- WebsocketProducerCarriage

AbstractConsumerCarriage <|-- FilesystemConsumerImpl
AbstractProducerCarriage <|-- FilesystemProducerImpl

AbstractCombinedCarriage <|-- DirectCarriageImpl

AbstractProducerCarriage <|-- SimpleFolderExport
SimpleFolderExport <|-- RotatingFolderExport

@enduml

Carriage mechanism classes