#include <StorageDrive.h>
Inherits AZ::IO::StreamStackEntry.
Public Member Functions | |
StorageDrive (u32 maxFileHandles) | |
void | SetNext (AZStd::shared_ptr< StreamStackEntry > next) override |
void | PrepareRequest (FileRequest *request) override |
void | QueueRequest (FileRequest *request) override |
bool | ExecuteRequests () override |
void | UpdateStatus (Status &status) const override |
Gets a combined status update from all the nodes in the stack. | |
void | UpdateCompletionEstimates (AZStd::chrono::steady_clock::time_point now, AZStd::vector< FileRequest * > &internalPending, StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override |
void | CollectStatistics (AZStd::vector< Statistic > &statistics) const override |
Public Member Functions inherited from AZ::IO::StreamStackEntry | |
StreamStackEntry (AZStd::string &&name) | |
virtual const AZStd::string & | GetName () const |
Returns the name that uniquely identifies this entry. | |
virtual void | SetNext (AZStd::shared_ptr< StreamStackEntry > next) |
virtual AZStd::shared_ptr< StreamStackEntry > | GetNext () const |
virtual void | SetContext (StreamerContext &context) |
virtual void | PrepareRequest (FileRequest *request) |
virtual void | QueueRequest (FileRequest *request) |
virtual bool | ExecuteRequests () |
virtual void | UpdateStatus (Status &status) const |
Gets a combined status update from all the nodes in the stack. | |
virtual void | UpdateCompletionEstimates (AZStd::chrono::steady_clock::time_point now, AZStd::vector< FileRequest * > &internalPending, StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) |
virtual void | CollectStatistics (AZStd::vector< Statistic > &statistics) const |
Protected Member Functions | |
size_t | FindFileInCache (const RequestPath &filePath) const |
void | ReadFile (FileRequest *request) |
void | CancelRequest (FileRequest *cancelRequest, FileRequestPtr &target) |
void | FileExistsRequest (FileRequest *request) |
void | FileMetaDataRetrievalRequest (FileRequest *request) |
void | FlushCache (const RequestPath &filePath) |
void | FlushEntireCache () |
void | EstimateCompletionTimeForRequest (FileRequest *request, AZStd::chrono::steady_clock::time_point &startTime, const RequestPath *&activeFile, u64 &activeOffset) const |
void | Report (const Requests::ReportData &data) const |
Protected Attributes | |
TimedAverageWindow< s_statisticsWindowSize > | m_fileOpenCloseTimeAverage |
TimedAverageWindow< s_statisticsWindowSize > | m_getFileExistsTimeAverage |
TimedAverageWindow< s_statisticsWindowSize > | m_getFileMetaDataTimeAverage |
TimedAverageWindow< s_statisticsWindowSize > | m_readTimeAverage |
AverageWindow< u64, float, s_statisticsWindowSize > | m_readSizeAverage |
AZStd::deque< FileRequest * > | m_pendingRequests |
File requests that are queued for processing. | |
AZStd::vector< AZStd::chrono::steady_clock::time_point > | m_fileLastUsed |
The last time a file handle was used to access a file. The handle is stored in m_fileHandles. | |
AZStd::vector< RequestPath > | m_filePaths |
The file path to the file handle. The handle is stored in m_fileHandles. | |
AZStd::vector< AZStd::unique_ptr< SystemFile > > | m_fileHandles |
A list of file handles that's being cached in case they're needed again in the future. | |
u64 | m_activeOffset = 0 |
The offset into the file that's cached by the active cache slot. | |
size_t | m_activeCacheSlot = s_fileNotFound |
The index into m_fileHandles for the file that's currently being read. | |
Protected Attributes inherited from AZ::IO::StreamStackEntry | |
AZStd::string | m_name |
The name that uniquely identifies this entry. | |
AZStd::shared_ptr< StreamStackEntry > | m_next |
The next entry in the stack. | |
StreamerContext * | m_context |
Context information for the entire streaming stack. | |
Static Protected Attributes | |
static const AZStd::chrono::microseconds | s_averageSeekTime |
static constexpr s32 | s_maxRequests = 1 |
Platform agnostic version of a storage drive, such as hdd, ssd, dvd, etc. This stream stack entry is responsible for accessing a storage drive to retrieve file information and data. This entry is designed as a catch-all for any reads that weren't handled by platform specific implementations or the virtual file system. It should by the last entry in the stack as it will not forward calls to the next entry.
|
overridevirtual |
Collect various statistics on this stack entry. These are for profiling and debugging purposes only.
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Executes one or more queued requests. This is needed for synchronously executing requests, but asynchronous requests can already be running from the PrepareRequest call in which case this call is ignored.
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Prepare an external request for processing. This can include resolving file paths, create more specific internal requests, etc. The returned will be queued for further processing by QueueRequest and ExecuteRequest.
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Queues a request to be executed at a later point when ExecuteRequests is called. This can include splitting up the request in more fine-grained steps.
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Set the next entry in the stack or reset it by using a nullptr. If the next entry has already been set, this will overwrite it.
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Updates the estimate of the time the requests will complete. This generally works by bubbling up the estimation and each stack entry adding it's additional overhead if any. When chaining this call, first call the next entry in the stack before adding the current entry's estimate.
now | The current time. This is captured once to avoid repeatedly querying the system clock. |
internalPending | The requests that are pending in the stream stack. These are always estimated as coming after the queued requests. Because this call will go from the top of the stack to the bottom, but estimation is calculated from the bottom to the top, this list should be processed in reverse order. |
pendingBegin | Iterator pointing to the start of the requests that are waiting for a processing slot in the stack. |
pendingEnd | Iterator pointing to the end of the requests that are waiting for a processing slot in the stack. |
Reimplemented from AZ::IO::StreamStackEntry.
|
overridevirtual |
Gets a combined status update from all the nodes in the stack.
Reimplemented from AZ::IO::StreamStackEntry.