private long currentTrailerSize() {
    long size = -1L;
    if (reader instanceof AbstractProtobufWALReader) {
      final AbstractProtobufWALReader pbwr = (AbstractProtobufWALReader) reader;
      size = pbwr.trailerSize();
    }
    return size;
  }
Returns whether the file is opened for writing.
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java