GetPrefetchInfo
Document management, Performance, Concurrency
Description
Returns a JSON object describing the state, configuration and progress of a prefetch job
The object carries the state name and numeric state code, the data kind, index and priority given to StartPrefetch, the pass, planned-range and source-read counts, the fetched bytes with the byte budget and read-ahead setting, and the latest availability status reported by the planner
Syntax
Delphi
Function TByteRangeStream.GetPrefetchInfo(JobHandle: Integer; Out Info: WideString): Boolean;Parameters
| JobHandle | A handle returned by StartPrefetch |
|---|---|
| Info | Receives the JSON object; set to an empty string when the call fails |
Return values
| True | The handle identifies a job of this stream and Info holds its description |
|---|---|
| False | The handle is invalid, or no prefetch job was ever started on this stream |
Remarks
The keys are state, stateCode, dataKind, index, priority, passes, plannedRanges, sourceReads, fetchedBytes, maxBytes, readAheadBytes, availabilityStatus and availability
availability holds the planner report when that report is a JSON object and null otherwise; an error key is added when the job recorded an error text
The call works for running and finished jobs alike, so it can be polled for progress
See also
GetRangeSourcePrefetchInfo, GetRangeSourcePrefetchState, StartRangeSourcePrefetch