[cfile] clean up on IndexBlock{Builder,Iterator,Reader}

This patch contains the following updates:

  * the code in IndexBlockReader::Parse() now catches corruption
    of index block's trailer in a more robust manner
  * fixed index overruns and possible memory corruption in
    IndexBlockReader::GetKeyPointer() when working with not-so-expected
    input for an empty BTree file and when the data read from the index
    file is corrupted
  * removed a few unused fields
  * a few class member functions became static
  * added PREDICT_{TRUE,FALSE} macros for better branch prediction
    where appropriate
  * fixed const-correctness
  * changed CHECK() to DCHECK() for the code paths where the
    assertions might trigger due to the variation of control paths,
    but independent of the input data
  * added more DCHECK() assertions where appropriate
  * updated the code to conform to the project's current style guide
  * addressed a few Clang-Tidy warnings
  * other minor updates

I also added a test to cover various error paths in
IndexBlockReader::Parse() when parsing corrupted index blocks.

Change-Id: If83dd132b577a481a2ddaa09e2657639f8b92c7d
Reviewed-on: http://gerrit.cloudera.org:8080/20690
Reviewed-by: Ashwani Raina <araina@cloudera.com>
Reviewed-by: Abhishek Chennaka <achennaka@cloudera.com>
Tested-by: Abhishek Chennaka <achennaka@cloudera.com>
5 files changed