TFileTransport chunks up the file on disk so that there are known "good" 
boundaries. If part of the file gets corrupted or partially written, you know 
you will always be able to seek to some offset (i.e. a multiple of 200MB or 
something) and resume reading from the beginning of a record.

I haven't been in the TFileTransport code in ages, so I'm not entirely sure on 
the specifics. But that's the general gist - TfileTransport does include 
special formatting in the file to aid in recoverability.

We really should change all the naming here.
TFileTransport should be TChunkedFileTransport or TRecoverableFileTransport
TSimpleFileTransport should be TFileTransport

Cheers,
mcslee

From: Codano [mailto:[email protected]]
Sent: Monday, November 15, 2010 3:45 PM
To: [email protected]; [email protected]; Adam Simpkins; Mark Slee
Subject: Re: Java version of TFileTransport

Mark, Adam:

I tried writing with TSimpleFileTransport and reading with TIOStreamTransport 
and indeed it worked. What benefit does TFileTransport offer compared to 
TSimpleFileTransport?

Bryan:

When I used the following combo, the Java code simply reads 4 bytes from the 
FileInputStream (verified via FIS::available()) and then leave the fields of 
the record uninitialized. There was no exception nor any other error condition 
flagged.

c++: ( TBinaryProtocol ( TFileTransport ) )

java: ( TBinaryProtocol ( TIOStreamTransport ) )

c++: ( TBinaryProtocol ( TFileTransport ) )

java: ( TBinaryProtocol ( TFramedTransport ( TIOStreamTransport ) ) )

Reply via email to