Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up translog interface #7564

Closed
wants to merge 1 commit into from
Closed

Commits on Sep 9, 2014

  1. Simplify translog interface

    get rid of readSource() entirely, it sucked, Operations should be able
    to provide the source themselves.
    
    No more TranslogStream headers, you are now required to pass an
    StreamInput or StreamOutput for all operations, which means no extra
    state is needed and no need to construct new versions when detecting the
    version.
    
    Read and write translog op sizes in TranslogStreams
    
    Previously we handled these integers outside of the translog stream
    itself, which was very unclean because other code had to know about
    reading the size, or about writing the correct header sometimes.
    
    There is some additional code in LocalIndexShardGateway to handle the
    legacy case for older translogs, because we need to read and discard the
    size in order to maintain the compatibility for the streaming
    operations (they did not read or write the size for 1.3.x and earlier).
    
    Additionally, we need to handle a case where the header is truncated
    when recovering from disk
    
    Use a NoopStreamOutput instead of byte arrays
    
    Instead of writing translog operations to a temporary byte array and
    then writing that byte array to the stream, we now write the operation
    twice, once to a No-op stream to get the size, then again to the real
    size.
    
    This trades a little more CPU usage for less memory usage.
    dakrone committed Sep 9, 2014
    Copy the full SHA
    c390caa View commit details
    Browse the repository at this point in the history