Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.3
    • Component/s: None
    • Labels:
      None

      Description

      It would be very nice to have Javascript encoding/decoding support. There are at least a couple of interested in streaming Avro-encoded data to a browser-based client.

      Working with binary data in JS is a bit ugly ... here's a sample:

      http://github.com/christkv/node-mongodb-native/blob/master/lib/mongodb/bson/binary_parser.js

      1. AVRO-485.patch
        44 kB
        Doug Cutting
      2. AVRO-485-js-validator.patch
        38 kB
        Quinn Slack

        Activity

        Bruce Mitchener created issue -
        Hide
        Bruce Mitchener added a comment -

        I started this ... my work on it can be found here on my experimental I/O branch that I'm using for changes to Avro-C on Github:

        http://github.com/waywardmonkeys/avro/tree/experimental_io/lang/js/

        Feel free to help out with this.

        Show
        Bruce Mitchener added a comment - I started this ... my work on it can be found here on my experimental I/O branch that I'm using for changes to Avro-C on Github: http://github.com/waywardmonkeys/avro/tree/experimental_io/lang/js/ Feel free to help out with this.
        Hide
        A B added a comment -

        Some work has been done at http://code.google.com/p/javascript-avro/ but that appears to be abandoned as well. I have enhanced the latter quite a bit and wanted to see if the Avro project would be willing to accept the changes/enhancements. Any comments please?

        Show
        A B added a comment - Some work has been done at http://code.google.com/p/javascript-avro/ but that appears to be abandoned as well. I have enhanced the latter quite a bit and wanted to see if the Avro project would be willing to accept the changes/enhancements. Any comments please?
        Hide
        Jeff Hammerbacher added a comment -

        Hey A B,

        Please do contribute your enhancements to the Apache project. We'll be happy to include them.

        Regards,
        Jeff

        Show
        Jeff Hammerbacher added a comment - Hey A B, Please do contribute your enhancements to the Apache project. We'll be happy to include them. Regards, Jeff
        Hide
        Quinn Slack added a comment -

        Has anybody made any more progress on these Javascript Avro libs? The most promising and recent one I've seen is at https://github.com/xcommerce/node-avro.

        I am primarily interested in a Javascript Avro JSON validator, which I will publish to Github and post here when ready.

        Show
        Quinn Slack added a comment - Has anybody made any more progress on these Javascript Avro libs? The most promising and recent one I've seen is at https://github.com/xcommerce/node-avro . I am primarily interested in a Javascript Avro JSON validator, which I will publish to Github and post here when ready.
        Hide
        Quinn Slack added a comment -

        I have created a Javascript Avro validator at:

        https://github.com/sqs/avro-json

        See the included tests for usage examples.

        Show
        Quinn Slack added a comment - I have created a Javascript Avro validator at: https://github.com/sqs/avro-json See the included tests for usage examples.
        Hide
        Doug Cutting added a comment -

        Would you like to contribute this to the Apache project? If so, we might put together a patch that adds it in lang/js.

        Show
        Doug Cutting added a comment - Would you like to contribute this to the Apache project? If so, we might put together a patch that adds it in lang/js.
        Hide
        Quinn Slack added a comment -

        I would be happy to help put together a patch that adds the JS validator and/or a JS encoder. Which did you have in mind?

        Show
        Quinn Slack added a comment - I would be happy to help put together a patch that adds the JS validator and/or a JS encoder. Which did you have in mind?
        Hide
        Doug Cutting added a comment -

        Both seem useful to me. I only saw the validator at github. If you have an encoder too that would be even better, but the validator is a good start.

        Show
        Doug Cutting added a comment - Both seem useful to me. I only saw the validator at github. If you have an encoder too that would be even better, but the validator is a good start.
        Hide
        Quinn Slack added a comment -

        Here is a first shot at a patch that adds the JS validator in lang/js. Let me know how it looks and what else is needed.

        Show
        Quinn Slack added a comment - Here is a first shot at a patch that adds the JS validator in lang/js. Let me know how it looks and what else is needed.
        Quinn Slack made changes -
        Field Original Value New Value
        Attachment AVRO-485-js-validator.patch [ 12546952 ]
        Hide
        Doug Cutting added a comment -

        Here's a version of the patch with the following changes:

        • Apache license added to js files
        • added a build.sh and linked it to top-level build
        • updated package.json to name Apache as the home for the code

        Quinn, are you okay with these changes?

        Show
        Doug Cutting added a comment - Here's a version of the patch with the following changes: Apache license added to js files added a build.sh and linked it to top-level build updated package.json to name Apache as the home for the code Quinn, are you okay with these changes?
        Doug Cutting made changes -
        Attachment AVRO-485.patch [ 12548009 ]
        Hide
        Doug Cutting added a comment -

        I'll commit this soon unless there are objections.

        Show
        Doug Cutting added a comment - I'll commit this soon unless there are objections.
        Doug Cutting made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Assignee Quinn Slack [ sqs ]
        Fix Version/s 1.7.3 [ 12323298 ]
        Hide
        Quinn Slack added a comment -

        Looks good to me, thanks!

        Show
        Quinn Slack added a comment - Looks good to me, thanks!
        Hide
        Doug Cutting added a comment -

        I committed this. Thanks, Quinn!

        Show
        Doug Cutting added a comment - I committed this. Thanks, Quinn!
        Doug Cutting made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Quinn Slack added a comment -

        I have an update to this that adds Javascript codegen. It uses ES5 Object.defineProperty to ensure that the object is valid after each field update.

        https://github.com/sqs/avro/tree/js-codegen/lang/js

        Usage example at https://github.com/sqs/avro/blob/js-codegen/lang/js/test/usage_test.js. Sample codegen'd file at https://gist.github.com/4151179.

        Should I prepare a patch with the JS codegen?

        Show
        Quinn Slack added a comment - I have an update to this that adds Javascript codegen. It uses ES5 Object.defineProperty to ensure that the object is valid after each field update. https://github.com/sqs/avro/tree/js-codegen/lang/js Usage example at https://github.com/sqs/avro/blob/js-codegen/lang/js/test/usage_test.js . Sample codegen'd file at https://gist.github.com/4151179 . Should I prepare a patch with the JS codegen?
        Hide
        Doug Cutting added a comment -

        > Should I prepare a patch with the JS codegen?

        That sounds awesome. Please open a new Jira issue for that patch. Thanks!

        Show
        Doug Cutting added a comment - > Should I prepare a patch with the JS codegen? That sounds awesome. Please open a new Jira issue for that patch. Thanks!
        Doug Cutting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Quinn Slack
            Reporter:
            Bruce Mitchener
          • Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development