LogDevice API
Public Types | Public Member Functions | List of all members
facebook::logdevice::BufferedWriter::AppendCallback Class Reference

#include <BufferedWriter.h>

Public Types

enum  RetryDecision { ALLOW, DENY }
 
using Context = void *
 
using ContextSet = std::vector< std::pair< Context, std::string > >
 

Public Member Functions

virtual void onSuccess (logid_t, ContextSet, const DataRecordAttributes &)
 
virtual void onFailure (logid_t, ContextSet, Status)
 
virtual RetryDecision onRetry (logid_t, const ContextSet &, Status)
 

Detailed Description

Callback interface. All methods get called on an unspecified thread. Applications should subclass and override desired notification methods.

Member Function Documentation

◆ onFailure()

virtual void facebook::logdevice::BufferedWriter::AppendCallback::onFailure ( logid_t  ,
ContextSet  ,
Status   
)
inlinevirtual

Called when a batch of records for the same log failed to be appended, and BufferedWriter exhausted all retries it was configured to do (if any).

Payload strings (available in `contexts') are no longer needed within BufferedWriter so the application is free to steal them.

◆ onRetry()

virtual RetryDecision facebook::logdevice::BufferedWriter::AppendCallback::onRetry ( logid_t  ,
const ContextSet &  ,
Status   
)
inlinevirtual

Called when a batch of records for the same log failed to be appended, but BufferedWriter is planning to retry.

If ALLOW is returned, BufferedWriter will proceed to schedule the retry for this batch. If DENY is returned, BufferedWriter will not retry and will instead invoke onFailure() shortly after.

◆ onSuccess()

virtual void facebook::logdevice::BufferedWriter::AppendCallback::onSuccess ( logid_t  ,
ContextSet  ,
const DataRecordAttributes &   
)
inlinevirtual

Called when a batch of records for the same log was successfully appended.

Payload strings (available in `contexts') are no longer needed within BufferedWriter so the application is free to steal them. All of the records share the same LSN and timestamp, available in `attrs'.


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