Android-cuttlefish cvd tool
Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SyncConnection Class Reference
Collaboration diagram for SyncConnection:
Collaboration graph
[legend]

Public Member Functions

 SyncConnection ()
 
 ~SyncConnection ()
 
bool HaveSendRecv2 () const
 
bool HaveSendRecv2Brotli () const
 
bool HaveSendRecv2LZ4 () const
 
bool HaveSendRecv2Zstd () const
 
bool HaveSendRecv2DryRunSend () const
 
CompressionType ResolveCompressionType (CompressionType compression) const
 
const FeatureSetFeatures () const
 
bool IsValid ()
 
void SetQuiet (bool quiet)
 
void NewTransfer ()
 
void RecordBytesTransferred (size_t bytes)
 
void RecordFileSent (std::string from, std::string to)
 
void RecordFilesTransferred (size_t files)
 
void RecordFilesSkipped (size_t files)
 
void ReportProgress (const std::string &file, uint64_t file_copied_bytes, uint64_t file_total_bytes)
 
void ReportTransferRate (const std::string &file, TransferDirection direction)
 
void ReportOverallTransferRate (TransferDirection direction)
 
bool SendRequest (int id, const std::string &path)
 
bool SendSend2 (std::string_view path, mode_t mode, CompressionType compression, bool dry_run)
 
bool SendRecv2 (const std::string &path, CompressionType compression)
 
bool SendStat (const std::string &path)
 
bool SendLstat (const std::string &path)
 
bool FinishStat (struct stat *st)
 
bool SendLs (const std::string &path)
 
bool FinishLs (const std::function< sync_ls_cb > &callback)
 
bool SendSmallFile (const std::string &path, mode_t mode, const std::string &lpath, const std::string &rpath, unsigned mtime, const char *data, size_t data_length, bool dry_run)
 
bool SendLargeFile (const std::string &path, mode_t mode, const std::string &lpath, const std::string &rpath, unsigned mtime, CompressionType compression, bool dry_run)
 
bool SendLargeFileLegacy (const std::string &path, mode_t mode, const std::string &lpath, const std::string &rpath, unsigned mtime)
 
bool ReportCopyFailure (const std::string &from, const std::string &to, const syncmsg &msg)
 
void CopyDone ()
 
void ReportDeferredCopyFailure (const std::string &msg)
 
bool ReadAcknowledgements (bool read_all=false)
 
void Printf (const char *fmt,...) __attribute__((__format__(__printf__
 
 va_start (ap, fmt)
 
 va_end (ap)
 
line_printer_ Print (s, LinePrinter::INFO)
 
void Println (const char *fmt,...) __attribute__((__format__(__printf__
 
 va_start (ap, fmt)
 
 va_end (ap)
 
line_printer_ Print (s, LinePrinter::INFO)
 
line_printer_ KeepInfoLine ()
 
void Error (const char *fmt,...) __attribute__((__format__(__printf__
 
 va_start (ap, fmt)
 
 va_end (ap)
 
line_printer_ Print (s, LinePrinter::ERROR)
 
void Warning (const char *fmt,...) __attribute__((__format__(__printf__
 
 va_start (ap, fmt)
 
 va_end (ap)
 
line_printer_ Print (s, LinePrinter::WARNING)
 
void ComputeExpectedTotalBytes (const std::vector< copyinfo > &file_list)
 
void SetExpectedTotalBytes (uint64_t expected_total_bytes)
 

Public Attributes

void va_list ap
 
android::base::StringAppendVs
 
unique_fd fd
 
size_t max
 

Private Member Functions

bool SendQuit ()
 
bool WriteOrDie (const std::string &from, const std::string &to, const void *data, size_t data_length)
 

Static Private Member Functions

template<bool v2>
static bool FinishLsImpl (borrowed_fd fd, const std::function< sync_ls_cb > &callback)
 

Private Attributes

std::deque< std::pair< std::string, std::string > > deferred_acknowledgements_
 
Block acknowledgement_buffer_
 
const FeatureSetfeatures_ = nullptr
 
bool have_stat_v2_
 
bool have_ls_v2_
 
bool have_sendrecv_v2_
 
bool have_sendrecv_v2_brotli_
 
bool have_sendrecv_v2_lz4_
 
bool have_sendrecv_v2_zstd_
 
bool have_sendrecv_v2_dry_run_send_
 
TransferLedger global_ledger_
 
TransferLedger current_ledger_
 
LinePrinter line_printer_
 

Constructor & Destructor Documentation

◆ SyncConnection()

SyncConnection::SyncConnection ( )
inline

◆ ~SyncConnection()

SyncConnection::~SyncConnection ( )
inline

Member Function Documentation

◆ ComputeExpectedTotalBytes()

void SyncConnection::ComputeExpectedTotalBytes ( const std::vector< copyinfo > &  file_list)
inline

◆ CopyDone()

void SyncConnection::CopyDone ( )
inline

◆ Error()

void SyncConnection::Error ( const char *  fmt,
  ... 
)

◆ Features()

const FeatureSet & SyncConnection::Features ( ) const
inline

◆ FinishLs()

bool SyncConnection::FinishLs ( const std::function< sync_ls_cb > &  callback)
inline

◆ FinishLsImpl()

template<bool v2>
static bool SyncConnection::FinishLsImpl ( borrowed_fd  fd,
const std::function< sync_ls_cb > &  callback 
)
inlinestaticprivate

◆ FinishStat()

bool SyncConnection::FinishStat ( struct stat *  st)
inline

◆ HaveSendRecv2()

bool SyncConnection::HaveSendRecv2 ( ) const
inline

◆ HaveSendRecv2Brotli()

bool SyncConnection::HaveSendRecv2Brotli ( ) const
inline

◆ HaveSendRecv2DryRunSend()

bool SyncConnection::HaveSendRecv2DryRunSend ( ) const
inline

◆ HaveSendRecv2LZ4()

bool SyncConnection::HaveSendRecv2LZ4 ( ) const
inline

◆ HaveSendRecv2Zstd()

bool SyncConnection::HaveSendRecv2Zstd ( ) const
inline

◆ IsValid()

bool SyncConnection::IsValid ( )
inline

◆ KeepInfoLine()

line_printer_ SyncConnection::KeepInfoLine ( )

◆ NewTransfer()

void SyncConnection::NewTransfer ( )
inline

◆ Print() [1/4]

line_printer_ SyncConnection::Print ( s  ,
LinePrinter::ERROR   
)

◆ Print() [2/4]

line_printer_ SyncConnection::Print ( s  ,
LinePrinter::INFO   
)

◆ Print() [3/4]

line_printer_ SyncConnection::Print ( s  ,
LinePrinter::INFO   
)

◆ Print() [4/4]

line_printer_ SyncConnection::Print ( s  ,
LinePrinter::WARNING   
)

◆ Printf()

void SyncConnection::Printf ( const char *  fmt,
  ... 
)

◆ Println()

void SyncConnection::Println ( const char *  fmt,
  ... 
)

◆ ReadAcknowledgements()

bool SyncConnection::ReadAcknowledgements ( bool  read_all = false)
inline

◆ RecordBytesTransferred()

void SyncConnection::RecordBytesTransferred ( size_t  bytes)
inline

◆ RecordFileSent()

void SyncConnection::RecordFileSent ( std::string  from,
std::string  to 
)
inline

◆ RecordFilesSkipped()

void SyncConnection::RecordFilesSkipped ( size_t  files)
inline

◆ RecordFilesTransferred()

void SyncConnection::RecordFilesTransferred ( size_t  files)
inline

◆ ReportCopyFailure()

bool SyncConnection::ReportCopyFailure ( const std::string &  from,
const std::string &  to,
const syncmsg msg 
)
inline

◆ ReportDeferredCopyFailure()

void SyncConnection::ReportDeferredCopyFailure ( const std::string &  msg)
inline

◆ ReportOverallTransferRate()

void SyncConnection::ReportOverallTransferRate ( TransferDirection  direction)
inline

◆ ReportProgress()

void SyncConnection::ReportProgress ( const std::string &  file,
uint64_t  file_copied_bytes,
uint64_t  file_total_bytes 
)
inline

◆ ReportTransferRate()

void SyncConnection::ReportTransferRate ( const std::string &  file,
TransferDirection  direction 
)
inline

◆ ResolveCompressionType()

CompressionType SyncConnection::ResolveCompressionType ( CompressionType  compression) const
inline

◆ SendLargeFile()

bool SyncConnection::SendLargeFile ( const std::string &  path,
mode_t  mode,
const std::string &  lpath,
const std::string &  rpath,
unsigned  mtime,
CompressionType  compression,
bool  dry_run 
)
inline

◆ SendLargeFileLegacy()

bool SyncConnection::SendLargeFileLegacy ( const std::string &  path,
mode_t  mode,
const std::string &  lpath,
const std::string &  rpath,
unsigned  mtime 
)
inline

◆ SendLs()

bool SyncConnection::SendLs ( const std::string &  path)
inline

◆ SendLstat()

bool SyncConnection::SendLstat ( const std::string &  path)
inline

◆ SendQuit()

bool SyncConnection::SendQuit ( )
inlineprivate

◆ SendRecv2()

bool SyncConnection::SendRecv2 ( const std::string &  path,
CompressionType  compression 
)
inline

◆ SendRequest()

bool SyncConnection::SendRequest ( int  id,
const std::string &  path 
)
inline

◆ SendSend2()

bool SyncConnection::SendSend2 ( std::string_view  path,
mode_t  mode,
CompressionType  compression,
bool  dry_run 
)
inline

◆ SendSmallFile()

bool SyncConnection::SendSmallFile ( const std::string &  path,
mode_t  mode,
const std::string &  lpath,
const std::string &  rpath,
unsigned  mtime,
const char *  data,
size_t  data_length,
bool  dry_run 
)
inline

◆ SendStat()

bool SyncConnection::SendStat ( const std::string &  path)
inline

◆ SetExpectedTotalBytes()

void SyncConnection::SetExpectedTotalBytes ( uint64_t  expected_total_bytes)
inline

◆ SetQuiet()

void SyncConnection::SetQuiet ( bool  quiet)
inline

◆ va_end() [1/4]

SyncConnection::va_end ( ap  )

◆ va_end() [2/4]

SyncConnection::va_end ( ap  )

◆ va_end() [3/4]

SyncConnection::va_end ( ap  )

◆ va_end() [4/4]

SyncConnection::va_end ( ap  )

◆ va_start() [1/4]

SyncConnection::va_start ( ap  ,
fmt   
)

◆ va_start() [2/4]

SyncConnection::va_start ( ap  ,
fmt   
)

◆ va_start() [3/4]

SyncConnection::va_start ( ap  ,
fmt   
)

◆ va_start() [4/4]

SyncConnection::va_start ( ap  ,
fmt   
)

◆ Warning()

void SyncConnection::Warning ( const char *  fmt,
  ... 
)

◆ WriteOrDie()

bool SyncConnection::WriteOrDie ( const std::string &  from,
const std::string &  to,
const void *  data,
size_t  data_length 
)
inlineprivate

Member Data Documentation

◆ acknowledgement_buffer_

Block SyncConnection::acknowledgement_buffer_
private

◆ ap

void va_list SyncConnection::ap
Initial value:
{
std::string s
android::base::StringAppendV & s
Definition: file_sync_client.cpp:899

◆ current_ledger_

TransferLedger SyncConnection::current_ledger_
private

◆ deferred_acknowledgements_

std::deque<std::pair<std::string, std::string> > SyncConnection::deferred_acknowledgements_
private

◆ fd

unique_fd SyncConnection::fd

◆ features_

const FeatureSet* SyncConnection::features_ = nullptr
private

◆ global_ledger_

TransferLedger SyncConnection::global_ledger_
private

◆ have_ls_v2_

bool SyncConnection::have_ls_v2_
private

◆ have_sendrecv_v2_

bool SyncConnection::have_sendrecv_v2_
private

◆ have_sendrecv_v2_brotli_

bool SyncConnection::have_sendrecv_v2_brotli_
private

◆ have_sendrecv_v2_dry_run_send_

bool SyncConnection::have_sendrecv_v2_dry_run_send_
private

◆ have_sendrecv_v2_lz4_

bool SyncConnection::have_sendrecv_v2_lz4_
private

◆ have_sendrecv_v2_zstd_

bool SyncConnection::have_sendrecv_v2_zstd_
private

◆ have_stat_v2_

bool SyncConnection::have_stat_v2_
private

◆ line_printer_

LinePrinter SyncConnection::line_printer_
private

◆ max

size_t SyncConnection::max

◆ s

android::base::StringAppendV & SyncConnection::s

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