/**
  * Populates FileIndexDescriptor with common things like name, checksum, etc.
  *
  * @param path
  * @return
  * @throws IOException
  */
 protected FileIndexDescriptor buildFileIndexDescriptor(Path path) throws IOException {
   FileIndexDescriptor fid = new FileIndexDescriptor();
   fid.setSourcePath(path.toString());
   fid.setDocType(getExpectedDocType());
   FileChecksum cksum = path.getFileSystem(getConf()).getFileChecksum(path);
   com.twitter.elephanttwin.gen.FileChecksum fidCksum =
       new com.twitter.elephanttwin.gen.FileChecksum(
           cksum.getAlgorithmName(), ByteBuffer.wrap(cksum.getBytes()), cksum.getLength());
   fid.setChecksum(fidCksum);
   fid.setIndexedFields(getIndexedFields());
   fid.setIndexType(getIndexType());
   fid.setIndexVersion(getIndexVersion());
   return fid;
 }