Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2762

Unknown resource closed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.2
    • 1.10.0
    • java
    • None

    Description

      DataFileReader will open the resource file, but it only deals with the resource closing in abnormal situations, and it does not inform the user that he needs to actively release the resource.

      
        /** Construct a reader for a file. */
        protected DataFileReader(SeekableInput sin, DatumReader<D> reader, boolean closeOnError) throws IOException {
          super(reader);
          try {
            this.sin = new SeekableInputStream(sin);
            initialize(this.sin);
            blockFinished();
          } catch (final Throwable e) {
            if (closeOnError) {
              IOUtils.closeQuietly(sin);
            }
            throw e;
          }
        }
      
      

       I think we should add a description in the comment to help the user read it.

      Attachments

        Issue Links

          Activity

            People

              zeshuai007 Zezeng Wang
              zeshuai007 Zezeng Wang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: