Source:
<code>public Reader(Configuration conf, Option... opts) throws IOException { FileOption fileOpt = Options.getOption(FileOption.class, opts); InputStreamOption streamOpt = Options.getOption(InputStreamOption.class, opts); StartOption startOpt = Options.getOption(StartOption.class, opts); LengthOption lenOpt = Options.getOption(LengthOption.class, opts); BufferSizeOption bufOpt = Options.getOption(BufferSizeOption.class, opts); OnlyHeaderOption headerOnly = Options.getOption(OnlyHeaderOption.class, opts); if ((fileOpt == null) == (streamOpt == null)) { throw new IllegalArgumentException("File or stream option must be specified"); } if (fileOpt == null && bufOpt != null) { throw new IllegalArgumentException("buffer size can only be set when" + " a file is specified."); } Path filename = null; FSDataInputStream file; final long len; FileSystem fs = null; try { if (fileOpt != null) { filename = fileOpt.getValue(); fs = filename.getFileSystem(conf); int bufSize = bufOpt == null ? getBufferSize(conf) : bufOpt.getValue(); len = null == lenOpt ? fs.getFileStatus(filename).getLen() : lenOpt.getValue(); file = openFile(fs, filename, bufSize, len); } else { len = null == lenOpt ? Long.MAX_VALUE : lenOpt.getValue(); file = streamOpt.getValue(); } long start = startOpt == null ? 0 : startOpt.getValue(); initialize(filename, file, start, len, conf, headerOnly != null); <START> } catch (RemoteException re) { <END> log.error("Failed creating a WAL Reader: " + re.getMessage()); if (re.getClassName().equals(leaseException)) { if (fs != null) { fs.close(); } } throw re; } }</code><technical_language>other RemoteException, explain need catch this</technical_language>

Target:
public Reader(Configuration conf, Option... opts) throws IOException { FileOption fileOpt = Options.getOption(FileOption.class, opts); InputStreamOption streamOpt = Options.getOption(InputStreamOption.class, opts); LengthOption lenOpt = Options.getOption(LengthOption.class, opts); BufferSizeOption bufOpt = Options.getOption(BufferSizeOption.class, opts); if ((fileOpt == null) == (streamOpt == null)) { throw new IllegalArgumentException("File or stream option must be specified"); } if (fileOpt == null && bufOpt != null) { throw new IllegalArgumentException("buffer size can only be set when a file is specified."); } Path filename = null; FSDataInputStream file; final long len; FileSystem fs = null; try { if (fileOpt != null) { filename = fileOpt.getValue(); fs = filename.getFileSystem(conf); int bufSize = bufOpt == null ? getBufferSize(conf) : bufOpt.getValue(); len = null == lenOpt ? fs.getFileStatus(filename).getLen() : lenOpt.getValue(); file = openFile(fs, filename, bufSize, len); } else { len = null == lenOpt ? Long.MAX_VALUE : lenOpt.getValue(); file = streamOpt.getValue(); } StartOption startOpt = Options.getOption(StartOption.class, opts); long start = startOpt == null ? 0 : startOpt.getValue(); OnlyHeaderOption headerOnly = Options.getOption(OnlyHeaderOption.class, opts); initialize(filename, file, start, len, conf, headerOnly != null); } catch (RemoteException re) { log.error("Failed creating a WAL Reader: " + re.getMessage()); if (re.getClassName().equals(WALConstants.LEASE_EXCEPTION_CLASS_NAME)) { if (fs != null) { fs.close(); } } throw re; } }