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

Classes

struct  PrefetchState
 

Public Member Functions

 IncrementalServer (unique_fd adb_fd, unique_fd output_fd, std::vector< File > files)
 
bool Serve ()
 

Private Types

enum class  SendResult { Sent , Skipped , Error }
 
using TimePoint = decltype(std::chrono::high_resolution_clock::now())
 

Private Member Functions

bool SkipToRequest (void *buffer, size_t *size, bool blocking)
 
std::optional< RequestCommandReadRequest (bool blocking)
 
void erase_buffer_head (int count)
 
SendResult SendDataBlock (FileId fileId, BlockIdx blockIdx, bool flush=false)
 
bool SendTreeBlock (FileId fileId, int32_t fileBlockIdx, BlockIdx blockIdx)
 
bool SendTreeBlocksForDataBlock (FileId fileId, BlockIdx blockIdx)
 
bool SendDone ()
 
void RunPrefetching ()
 
void Send (const void *data, size_t size, bool flush)
 
void Flush ()
 
bool ServingComplete (std::optional< TimePoint > startTime, int missesCount, int missesSent)
 

Private Attributes

unique_fd const adb_fd_
 
unique_fd const output_fd_
 
std::vector< Filefiles_
 
std::vector< char > buffer_
 
std::deque< PrefetchStateprefetches_
 
int compressed_ = 0
 
int uncompressed_ = 0
 
long long sentSize_ = 0
 
std::vector< char > pendingBlocksBuffer_
 
char * pendingBlocks_ = nullptr
 
bool servingComplete_ = false
 

Static Private Attributes

static constexpr auto kChunkFlushSize = 31 * kBlockSize
 

Member Typedef Documentation

◆ TimePoint

Member Enumeration Documentation

◆ SendResult

Enumerator
Sent 
Skipped 
Error 

Constructor & Destructor Documentation

◆ IncrementalServer()

incremental::IncrementalServer::IncrementalServer ( unique_fd  adb_fd,
unique_fd  output_fd,
std::vector< File files 
)
inline

Member Function Documentation

◆ erase_buffer_head()

void incremental::IncrementalServer::erase_buffer_head ( int  count)
inlineprivate

◆ Flush()

void incremental::IncrementalServer::Flush ( )
private

◆ ReadRequest()

std::optional< RequestCommand > incremental::IncrementalServer::ReadRequest ( bool  blocking)
private

◆ RunPrefetching()

void incremental::IncrementalServer::RunPrefetching ( )
private

◆ Send()

void incremental::IncrementalServer::Send ( const void *  data,
size_t  size,
bool  flush 
)
private

◆ SendDataBlock()

auto incremental::IncrementalServer::SendDataBlock ( FileId  fileId,
BlockIdx  blockIdx,
bool  flush = false 
)
private

◆ SendDone()

bool incremental::IncrementalServer::SendDone ( )
private

◆ SendTreeBlock()

bool incremental::IncrementalServer::SendTreeBlock ( FileId  fileId,
int32_t  fileBlockIdx,
BlockIdx  blockIdx 
)
private

◆ SendTreeBlocksForDataBlock()

bool incremental::IncrementalServer::SendTreeBlocksForDataBlock ( FileId  fileId,
BlockIdx  blockIdx 
)
private

◆ Serve()

bool incremental::IncrementalServer::Serve ( )

◆ ServingComplete()

bool incremental::IncrementalServer::ServingComplete ( std::optional< TimePoint startTime,
int  missesCount,
int  missesSent 
)
private

◆ SkipToRequest()

bool incremental::IncrementalServer::SkipToRequest ( void *  buffer,
size_t *  size,
bool  blocking 
)
private

Member Data Documentation

◆ adb_fd_

unique_fd const incremental::IncrementalServer::adb_fd_
private

◆ buffer_

std::vector<char> incremental::IncrementalServer::buffer_
private

◆ compressed_

int incremental::IncrementalServer::compressed_ = 0
private

◆ files_

std::vector<File> incremental::IncrementalServer::files_
private

◆ kChunkFlushSize

constexpr auto incremental::IncrementalServer::kChunkFlushSize = 31 * kBlockSize
staticconstexprprivate

◆ output_fd_

unique_fd const incremental::IncrementalServer::output_fd_
private

◆ pendingBlocks_

char* incremental::IncrementalServer::pendingBlocks_ = nullptr
private

◆ pendingBlocksBuffer_

std::vector<char> incremental::IncrementalServer::pendingBlocksBuffer_
private

◆ prefetches_

std::deque<PrefetchState> incremental::IncrementalServer::prefetches_
private

◆ sentSize_

long long incremental::IncrementalServer::sentSize_ = 0
private

◆ servingComplete_

bool incremental::IncrementalServer::servingComplete_ = false
private

◆ uncompressed_

int incremental::IncrementalServer::uncompressed_ = 0
private

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