11 #ifndef EVIO_6_0_RECORDRINGITEM_H
12 #define EVIO_6_0_RECORDRINGITEM_H
20 #include "Disruptor/Sequence.h"
45 static int factoryMaxEventCount;
47 static int factoryMaxBufferSize;
52 static uint64_t idValue;
56 std::shared_ptr<RecordOutput> record;
62 int64_t sequence = 0UL;
65 std::shared_ptr<Disruptor::ISequence> sequenceObj =
nullptr;
68 std::atomic<bool> splitFileAfterWriteBool{
false};
71 std::atomic<bool> forceToDiskBool{
false};
77 std::atomic<bool> checkDisk{
false};
81 std::atomic<bool> lastItem{
false};
84 bool alreadyReleased =
false;
93 static const std::function< std::shared_ptr<RecordRingItem> () >&
eventFactory();
107 std::shared_ptr<RecordOutput> &
getRecord();
113 void fromConsumer(int64_t seq, std::shared_ptr<Disruptor::ISequence> & seqObj);
130 uint64_t
getId()
const;
131 void setId(uint64_t idVal);
138 #endif //EVIO_6_0_RECORDRINGITEM_H
void setLastItem(bool last)
Set whether this is the last item in the supply to be used.
Definition: RecordRingItem.cpp:250
CompressionType
Enum of supported data compression types.
Definition: Compressor.h:65
std::shared_ptr< RecordOutput > & getRecord()
Get the contained record.
Definition: RecordRingItem.cpp:148
Numerical values associated with endian byte order.
Definition: ByteOrder.h:53
void reset()
Assignment operator.
Definition: RecordRingItem.cpp:131
static const std::function< std::shared_ptr< RecordRingItem >) > & eventFactory()
Function to create RecordRingItems by RingBuffer.
Definition: RecordRingItem.cpp:32
std::shared_ptr< Disruptor::ISequence > & getSequenceObj()
Get the Sequence object allowing ring consumer to get/release this item.
Definition: RecordRingItem.cpp:169
void fromConsumer(int64_t seq, std::shared_ptr< Disruptor::ISequence > &seqObj)
Set the sequence of an item obtained through RecordSupply#getToCompress(uint32_t).
Definition: RecordRingItem.cpp:184
uint64_t getId() const
Get item's id.
Definition: RecordRingItem.cpp:272
bool forceToDisk()
Get whether a file writer forces this record to be physically written to disk.
Definition: RecordRingItem.cpp:209
bool isLastItem()
Get whether this is the last item in the supply to be used.
Definition: RecordRingItem.cpp:242
bool splitFileAfterWrite()
Get whether a file writer splits the file after writing this record.
Definition: RecordRingItem.cpp:194
void setId(uint64_t idVal)
Set this item's id number.
Definition: RecordRingItem.cpp:279
This class provides the items which are supplied by the RecordSupply class.
Definition: RecordRingItem.h:34
ByteOrder & getOrder()
Get the byte order used to build record.
Definition: RecordRingItem.cpp:155
~RecordRingItem()=default
RecordRingItem & operator=(const RecordRingItem &other)=delete
bool isCheckDisk()
Get whether there is not enough free space on the disk partition for the next, complete file to be wr...
Definition: RecordRingItem.cpp:226
bool isAlreadyReleased() const
Has this item already been released by the RecordSupply?
Definition: RecordRingItem.cpp:257
void setCheckDisk(bool check)
Set whether there is not enough free space on the disk partition for the next, complete file to be wr...
Definition: RecordRingItem.cpp:235
void setAlreadyReleased(bool released)
Set whether this item has already been released by the RecordSupply.
Definition: RecordRingItem.cpp:265
void fromProducer(int64_t seq)
Set the sequence of an item obtained through RecordSupply#get().
Definition: RecordRingItem.cpp:176
static void setEventFactorySettings(ByteOrder &order, uint32_t maxEventCount, uint32_t maxBufferSize, Compressor::CompressionType &compressionType)
Method to set RecordRingItem parameters for objects created by eventFactory.
Definition: RecordRingItem.cpp:52
int64_t getSequence() const
Get the sequence at which this object was taken from ring by one of the "get" calls.
Definition: RecordRingItem.cpp:162
RecordRingItem()
Default constructor.
Definition: RecordRingItem.cpp:64
static const ByteOrder ENDIAN_LOCAL
Local host's byte order.
Definition: ByteOrder.h:61