Solr
  1. Solr
  2. SOLR-4224

refactor JavaBinCodec input stream definition to enhance reuse

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 6.0
    • Component/s: clients - java
    • Labels:
      None

      Description

      JavaBinCodec currently requires use of the concrete "FastInputStream" when unmarshalling a record. A JavaBinCodec API that takes an interface or abstract implementation would allow greater reuse.

      In my particular case I am trying to use JavaBinCodec to marshal/unmarshal from an data source that doesn't allow buffering. The semantics are such that I can read only a single record from the input source. The buffering in FastInputStream is reading information contained in the second record. No state other than the input data source itself is available to "cache" the FastInputStream between calls. As a result I'm losing the second record. I would like to provide an InputStream/DataInput that doesn't do any buffering.

      1. SOLR-4224.patch
        16 kB
        Patrick Hunt

        Activity

        Hide
        Patrick Hunt added a comment -

        The attached patch implements a refactoring that allows an arbitrary InputStream/DataInput implementation to be used. I've taken an approach that minimizes impact of the changes. It's pretty mechanical - replace FastInputStream in the JavaBinCodec API definition with an abstract specification.

        Show
        Patrick Hunt added a comment - The attached patch implements a refactoring that allows an arbitrary InputStream/DataInput implementation to be used. I've taken an approach that minimizes impact of the changes. It's pretty mechanical - replace FastInputStream in the JavaBinCodec API definition with an abstract specification.
        Hide
        Mark Miller added a comment -

        This seems like a good change to me. I'll take this for 4.3.

        Show
        Mark Miller added a comment - This seems like a good change to me. I'll take this for 4.3.
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] markrmiller
        http://svn.apache.org/viewvc?view=revision&revision=1491459

        SOLR-4224: Refactor JavaBinCodec input stream definition to enhance reuse.

        Show
        Commit Tag Bot added a comment - [trunk commit] markrmiller http://svn.apache.org/viewvc?view=revision&revision=1491459 SOLR-4224 : Refactor JavaBinCodec input stream definition to enhance reuse.
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] markrmiller
        http://svn.apache.org/viewvc?view=revision&revision=1491461

        SOLR-4224: Refactor JavaBinCodec input stream definition to enhance reuse.

        Show
        Commit Tag Bot added a comment - [branch_4x commit] markrmiller http://svn.apache.org/viewvc?view=revision&revision=1491461 SOLR-4224 : Refactor JavaBinCodec input stream definition to enhance reuse.
        Hide
        Mark Miller added a comment -

        Thanks Patrick!

        Show
        Mark Miller added a comment - Thanks Patrick!
        Hide
        Noble Paul added a comment -

        Is this not fixed in trunk?

        Show
        Noble Paul added a comment - Is this not fixed in trunk?
        Hide
        Shalin Shekhar Mangar added a comment -

        Is this not fixed in trunk?

        It is. See the comment by the commit tag bot.

        Show
        Shalin Shekhar Mangar added a comment - Is this not fixed in trunk? It is. See the comment by the commit tag bot.
        Hide
        Steve Rowe added a comment -

        Bulk close resolved 4.4 issues

        Show
        Steve Rowe added a comment - Bulk close resolved 4.4 issues

          People

          • Assignee:
            Mark Miller
            Reporter:
            Patrick Hunt
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development