evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::RecordRingItem Class Reference

This class provides the items which are supplied by the RecordSupply class. More...

#include <RecordRingItem.h>

Public Member Functions

 RecordRingItem ()
 Default constructor. More...
 
 RecordRingItem (const RecordRingItem &item)
 Copy constructor (sort of). More...
 
 ~RecordRingItem ()=default
 
RecordRingItemoperator= (const RecordRingItem &other)=delete
 
void reset ()
 Assignment operator. More...
 
std::shared_ptr< RecordOutput > & getRecord ()
 Get the contained record. More...
 
ByteOrdergetOrder ()
 Get the byte order used to build record. More...
 
int64_t getSequence () const
 Get the sequence at which this object was taken from ring by one of the "get" calls. More...
 
std::shared_ptr
< Disruptor::ISequence > & 
getSequenceObj ()
 Get the Sequence object allowing ring consumer to get/release this item. More...
 
void fromProducer (int64_t seq)
 Set the sequence of an item obtained through RecordSupply#get(). More...
 
void fromConsumer (int64_t seq, std::shared_ptr< Disruptor::ISequence > &seqObj)
 Set the sequence of an item obtained through RecordSupply#getToCompress(uint32_t). More...
 
bool splitFileAfterWrite ()
 Get whether a file writer splits the file after writing this record. More...
 
void splitFileAfterWrite (bool split)
 Set whether a file writer splits the file after writing this record. More...
 
bool forceToDisk ()
 Get whether a file writer forces this record to be physically written to disk. More...
 
void forceToDisk (bool force)
 Set whether a file writer forces this record to be physically written to disk. More...
 
bool isCheckDisk ()
 Get whether there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file. More...
 
void setCheckDisk (bool check)
 Set whether there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file. More...
 
bool isLastItem ()
 Get whether this is the last item in the supply to be used. More...
 
void setLastItem (bool last)
 Set whether this is the last item in the supply to be used. More...
 
bool isAlreadyReleased () const
 Has this item already been released by the RecordSupply? More...
 
void setAlreadyReleased (bool released)
 Set whether this item has already been released by the RecordSupply. More...
 
uint64_t getId () const
 Get item's id. More...
 
void setId (uint64_t idVal)
 Set this item's id number. More...
 

Static Public Member Functions

static const std::function
< std::shared_ptr
< RecordRingItem >) > & 
eventFactory ()
 Function to create RecordRingItems by RingBuffer. More...
 
static void setEventFactorySettings (ByteOrder &order, uint32_t maxEventCount, uint32_t maxBufferSize, Compressor::CompressionType &compressionType)
 Method to set RecordRingItem parameters for objects created by eventFactory. More...
 

Detailed Description

This class provides the items which are supplied by the RecordSupply class.

Date
11/05/2019
Author
timmer

Constructor & Destructor Documentation

evio::RecordRingItem::RecordRingItem ( )

Default constructor.

Used in RecordSupply by eventFactory to create RecordRingItems for supply.

evio::RecordRingItem::RecordRingItem ( const RecordRingItem item)

Copy constructor (sort of).

Used in EventWriter for when disk is full and a copy of the item to be written is made for later writing. Original item is released so ring can function. Note, not everything is copied (sequenceObj) since in usage, the original item has already been released. Also, isAlreadyReleased() is true.

NOT to be used except internally by evio.

Parameters
itemring item to copy.
evio::RecordRingItem::~RecordRingItem ( )
default

Member Function Documentation

const std::function< std::shared_ptr< RecordRingItem >) > & evio::RecordRingItem::eventFactory ( )
static

Function to create RecordRingItems by RingBuffer.

Referenced by evio::RecordSupply::RecordSupply().

bool evio::RecordRingItem::forceToDisk ( )

Get whether a file writer forces this record to be physically written to disk.

Returns
true if file writer forces this record to be physically written to disk.
void evio::RecordRingItem::forceToDisk ( bool  force)

Set whether a file writer forces this record to be physically written to disk.

Parameters
forceif true, file writer forces this record to be physically written to disk, else false.
void evio::RecordRingItem::fromConsumer ( int64_t  seq,
std::shared_ptr< Disruptor::ISequence > &  seqObj 
)

Set the sequence of an item obtained through RecordSupply#getToCompress(uint32_t).

Parameters
seqsequence used to get item.
seqObjsequence object used to get/release item.
void evio::RecordRingItem::fromProducer ( int64_t  seq)

Set the sequence of an item obtained through RecordSupply#get().

Parameters
seqsequence used to get item.
uint64_t evio::RecordRingItem::getId ( ) const

Get item's id.

Id is 0 if unused.

Returns
id number.
ByteOrder & evio::RecordRingItem::getOrder ( )

Get the byte order used to build record.

Returns
byte order used to build record.
std::shared_ptr< RecordOutput > & evio::RecordRingItem::getRecord ( )

Get the contained record.

Record is reset.

Returns
contained record.
int64_t evio::RecordRingItem::getSequence ( ) const

Get the sequence at which this object was taken from ring by one of the "get" calls.

Returns
sequence at which this object was taken from ring by one of the "get" calls.
std::shared_ptr< Disruptor::ISequence > & evio::RecordRingItem::getSequenceObj ( )

Get the Sequence object allowing ring consumer to get/release this item.

Returns
Sequence object allowing ring consumer to get/release this item.
bool evio::RecordRingItem::isAlreadyReleased ( ) const

Has this item already been released by the RecordSupply?

Returns
true if item already been released by the RecordSupply.
bool evio::RecordRingItem::isCheckDisk ( )

Get whether there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file.

Returns
true if there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file.
bool evio::RecordRingItem::isLastItem ( )

Get whether this is the last item in the supply to be used.

Returns
true this is the last item in the supply to be used.
RecordRingItem& evio::RecordRingItem::operator= ( const RecordRingItem other)
delete
void evio::RecordRingItem::reset ( )

Assignment operator.

Parameters
otherright side object.
Returns
left side object.Method to reset this item each time it is retrieved from the supply.
void evio::RecordRingItem::setAlreadyReleased ( bool  released)

Set whether this item has already been released by the RecordSupply.

Parameters
releasedtrue if this item has already been released by the RecordSupply, else false.
void evio::RecordRingItem::setCheckDisk ( bool  check)

Set whether there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file.

Parameters
checkif true, there is not enough free space on the disk partition for the next, complete file to be written, resulting in not creating or writing to file.
void evio::RecordRingItem::setEventFactorySettings ( ByteOrder order,
uint32_t  maxEventCount,
uint32_t  maxBufferSize,
Compressor::CompressionType compressionType 
)
static

Method to set RecordRingItem parameters for objects created by eventFactory.

Parameters
orderbyte order.
maxEventCountmax number of events each record can hold. Value <= O means use default (1M).
maxBufferSizemax number of uncompressed data bytes each record can hold. Value of < 8MB results in default of 8MB.
compressionTypetype of data compression to do.

Referenced by evio::RecordSupply::RecordSupply().

void evio::RecordRingItem::setId ( uint64_t  idVal)

Set this item's id number.

Parameters
idValid number.
void evio::RecordRingItem::setLastItem ( bool  last)

Set whether this is the last item in the supply to be used.

Used in WriterMT when closing.

Parameters
lastif true, this is the last item in the supply to be used.
bool evio::RecordRingItem::splitFileAfterWrite ( )

Get whether a file writer splits the file after writing this record.

Returns
true if file writer splits the file after writing this record.
void evio::RecordRingItem::splitFileAfterWrite ( bool  split)

Set whether a file writer splits the file after writing this record.

Parameters
splitif true, file writer splits the file after writing this record, else false.

The documentation for this class was generated from the following files: