1) using proper include statements
2) using file_rename instead of native rename
3) changed check which determines whether segment is empty or not ( this was necessary as we don't write OP_START_LOG_SEGMENT transaction as hadoop guys do)