C# 클래스 GSF.IO.FileStructure.Media.BufferedFile

A buffered file stream utilizes the MemoryPool to intellectually cache the contents of files.
This class is a special purpose class that can only be used for the TransactionalFileStructure and can not buffer general purpose file. The cache algorithm is a least recently used algorithm. This is accomplised by incrementing a counter every time a page is accessed and dividing by 2 every time a collection occurs from the MemoryPool.
상속: IDiskMediumCoreFunctions
파일 보기 프로젝트 열기: GridProtectionAlliance/openHistorian 1 사용 예제들

공개 메소드들

메소드 설명
BufferedFile ( CustomFileStream stream, MemoryPool pool, FileHeaderBlock header, bool isNewFile ) : System

Creates a file backed memory stream.

ChangeExtension ( string extension, bool isReadOnly, bool isSharingEnabled ) : void

Changes the extension of the current file.

ChangeShareMode ( bool isReadOnly, bool isSharingEnabled ) : void

Reopens the file with different permissions.

CommitChanges ( FileHeaderBlock header ) : void

Executes a commit of data. This will flush the data to the disk use the provided header data to properly execute this function.

CreateIoSession ( ) : BinaryStreamIoSessionBase

Creates a BinaryStreamIoSessionBase that can be used to read from this disk medium.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RollbackChanges ( ) : void

Rolls back all edits to the DiskMedium

비공개 메소드들

메소드 설명
GetBlock ( PageReplacementAlgorithm pageLock, BlockArguments args ) : void

Populates the pointer data inside args for the desired block as specified in args. This function will block if needing to retrieve data from the disk.

GetBlockFromCommittedSpace ( PageReplacementAlgorithm pageLock, long position, IntPtr &pointer ) : void

Processes the GetBlock from the committed area.

The valid length is at least the size of the buffer pools page size.

ReleaseWriteBufferSpace ( ) : void

Releases the buffered data contained in the buffer pool. This is acomplished by disposing of the writer and recreating it.

m_pool_RequestCollection ( object sender, CollectionEventArgs e ) : void

Handles the MemoryPool.RequestCollection event.

메소드 상세

BufferedFile() 공개 메소드

Creates a file backed memory stream.
public BufferedFile ( CustomFileStream stream, MemoryPool pool, FileHeaderBlock header, bool isNewFile ) : System
stream CustomFileStream The to buffer
pool GSF.IO.Unmanaged.MemoryPool The to allocate memory from
header FileHeaderBlock The to be managed when modifications occur
isNewFile bool Tells if this is a newly created file. This will make sure that the /// first 10 pages have the header data copied to it.
리턴 System

ChangeExtension() 공개 메소드

Changes the extension of the current file.
public ChangeExtension ( string extension, bool isReadOnly, bool isSharingEnabled ) : void
extension string the new extension
isReadOnly bool If the file should be reopened as readonly
isSharingEnabled bool If the file should share read privileges.
리턴 void

ChangeShareMode() 공개 메소드

Reopens the file with different permissions.
public ChangeShareMode ( bool isReadOnly, bool isSharingEnabled ) : void
isReadOnly bool If the file should be reopened as readonly
isSharingEnabled bool If the file should share read privileges.
리턴 void

CommitChanges() 공개 메소드

Executes a commit of data. This will flush the data to the disk use the provided header data to properly execute this function.
public CommitChanges ( FileHeaderBlock header ) : void
header FileHeaderBlock
리턴 void

CreateIoSession() 공개 메소드

Creates a BinaryStreamIoSessionBase that can be used to read from this disk medium.
public CreateIoSession ( ) : BinaryStreamIoSessionBase
리턴 GSF.IO.Unmanaged.BinaryStreamIoSessionBase

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

RollbackChanges() 공개 메소드

Rolls back all edits to the DiskMedium
public RollbackChanges ( ) : void
리턴 void