17 #ifndef DEFAULTLOGUPLOADSTRATEGY_HPP_
18 #define DEFAULTLOGUPLOADSTRATEGY_HPP_
119 typedef std::chrono::system_clock Clock;
120 std::chrono::time_point<Clock> nextUploadAttemptTS_;
void setRetryPeriod(std::size_t period)
The public interface for the log upload strategy.
static const std::size_t DEFAULT_LOG_UPLOAD_CHECK_PERIOD
virtual std::size_t getMaxParallelUploads()
Max amount of log batches allowed to be uploaded parallel.
virtual std::size_t getLogUploadCheckPeriod()
void setMaxParallelUploads(std::size_t count)
std::size_t uploadVolumeThreshold_
static const std::size_t DEFAULT_UPLOAD_COUNT_THRESHOLD
DefaultLogUploadStrategy(IKaaClientContext &context)
std::size_t uploadCountThreshold_
virtual LogUploadStrategyDecision isUploadNeeded(ILogStorageStatus &status)
Decides whether the log upload is needed.
void setTimeoutCheckPeriod(std::size_t period)
void setLogUploadCheckPeriod(std::size_t period)
IKaaClientContext & context_
The default ILogUploadStrategy implementation.
std::size_t getCountThreshold() const
void setCountThreshold(std::size_t maxCount)
static const std::size_t DEFAULT_TIMEOUT_CHECK_PERIOD
void setVolumeThreshold(std::size_t maxVolume)
virtual std::size_t getTimeoutCheckPeriod()
virtual std::size_t getTimeout()
Maximum time to wait the log delivery response.
virtual void onFailure(ILogFailoverCommand &controller, LogDeliveryErrorCode code)
Callback is used when the log delivery is failed.
std::size_t maxParallelUploads_
static const std::size_t DEFAULT_UPLOAD_VOLUME_THRESHOLD
static const std::size_t DEFAULT_RETRY_PERIOD
std::size_t timeoutCheckPeriod_
static const std::size_t DEFAULT_MAX_PARALLEL_UPLOADS
std::size_t uploadTimeout_
void setUploadTimeout(std::size_t timeout)
LogUploadStrategyDecision
Log upload decisions.
static const std::size_t DEFAULT_UPLOAD_TIMEOUT
The public interface to represent the current log storage state.
std::size_t getVolumeThreshold() const
virtual void onTimeout(ILogFailoverCommand &controller)
Callback is used when the log delivery timeout detected.
std::size_t getRetryPeriod()
std::size_t logUploadCheckReriod_