code: static ParityFilePair verifyParity(FileStatus src, FileStatus parity,
        Codec codec, Configuration conf, FileSystem destFs) throws IOException {
      if (parity.getModificationTime() != src.getModificationTime()) {
        return null;
      }
      int stripeLength = codec.stripeLength;
      int parityLegnth = codec.parityLength;
      long expectedSize = 0;
      List<FileStatus> lfs = null;
      if (codec.isDirRaid) {
        FileSystem srcFs = src.getPath().getFileSystem(conf);
        lfs = RaidNode.listDirectoryRaidFileStatus(conf, srcFs, 
            src.getPath());
        if (lfs == null) {
          return null;
        }
  
        long blockNum = DirectoryStripeReader.getBlockNum(lfs);
        long parityBlockSize = DirectoryStripeReader.getParityBlockSize(conf,
            lfs); 
        int parityBlocks = (int)Math.ceil(
            ((double)blockNum) / stripeLength) * parityLegnth;
        expectedSize = parityBlocks * parityBlockSize;
      } else {
        double sourceBlocks = Math.ceil(
            ((double)src.getLen()) / src.getBlockSize());
        int parityBlocks = (int)Math.ceil(
            sourceBlocks / stripeLength) * parityLegnth;
        expectedSize = parityBlocks * src.getBlockSize();
      }
      if (parity.getLen() != expectedSize) {
        RaidNode.LOG.error("Bad parity file:" + parity.getPath() +
            " File size doen't match. parity:" + parity.getLen() +
            " expected:" + expectedSize);
        return null;
      }
      return new ParityFilePair(parity.getPath(), parity, destFs, lfs);
    }
docs: /*
  verify and return ParityFilePair if succeed, or return null