You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Eric Evans (JIRA)" <ji...@apache.org> on 2010/05/13 23:02:42 UTC

[jira] Created: (AVRO-540) make GenericArray reversible

make GenericArray reversible
----------------------------

                 Key: AVRO-540
                 URL: https://issues.apache.org/jira/browse/AVRO-540
             Project: Avro
          Issue Type: New Feature
          Components: java
    Affects Versions: 1.3.2
            Reporter: Eric Evans
            Priority: Minor


There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.

The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AVRO-540) make GenericArray reversible

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting reassigned AVRO-540:
---------------------------------

    Assignee: Eric Evans

Looks good.  A line of javadoc would be great, since this is a non-overridden public method.  (The rest of the methods in that class need @Override.  Mea culpa.)

For my edification: are Cassandra's comparators not written in terms that can be translated to an Avro schema?  If they were, then you should be able to read the data using an altered schema that gives you the ordering you want.  The intent of Avro's comparators is not that you're stuck with the ordering specified when the data is written, but rather that you can specify alternate ordering's at read time.  But perhaps that's not possible here.


> make GenericArray reversible
> ----------------------------
>
>                 Key: AVRO-540
>                 URL: https://issues.apache.org/jira/browse/AVRO-540
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Eric Evans
>            Assignee: Eric Evans
>            Priority: Minor
>         Attachments: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch
>
>
> There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.
> The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-540) make GenericArray reversible

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Evans updated AVRO-540:
----------------------------

    Attachment: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch

> make GenericArray reversible
> ----------------------------
>
>                 Key: AVRO-540
>                 URL: https://issues.apache.org/jira/browse/AVRO-540
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Eric Evans
>            Priority: Minor
>         Attachments: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch
>
>
> There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.
> The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-540) make GenericArray reversible

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting resolved AVRO-540.
-------------------------------

    Hadoop Flags: [Reviewed]
      Resolution: Fixed

I just committed this.  Thanks, Eric!

> make GenericArray reversible
> ----------------------------
>
>                 Key: AVRO-540
>                 URL: https://issues.apache.org/jira/browse/AVRO-540
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Eric Evans
>            Assignee: Eric Evans
>            Priority: Minor
>         Attachments: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch
>
>
> There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.
> The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-540) make GenericArray reversible

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12867265#action_12867265 ] 

Doug Cutting commented on AVRO-540:
-----------------------------------

Nevermind.  It is overriding a method that has javadoc!  +1 as-is.

> make GenericArray reversible
> ----------------------------
>
>                 Key: AVRO-540
>                 URL: https://issues.apache.org/jira/browse/AVRO-540
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Eric Evans
>            Assignee: Eric Evans
>            Priority: Minor
>         Attachments: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch
>
>
> There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.
> The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-540) make GenericArray reversible

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-540:
------------------------------

    Fix Version/s: 1.4.0

> make GenericArray reversible
> ----------------------------
>
>                 Key: AVRO-540
>                 URL: https://issues.apache.org/jira/browse/AVRO-540
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.3.2
>            Reporter: Eric Evans
>            Assignee: Eric Evans
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: 0001-AVRO-540.-reverse-method-for-generic-arrays.patch
>
>
> There are a number of RPC methods in Cassandra that return ordered results (ordered by pluggable comparators, avro's ordering won't work), and each has a means of specifying that the order be reversed. The way this is currently done is to use a List to process the results, Collections.reverse() to reorder if needed, and then copy them to a GenericArray to be returned. It would be nice to avoid this intermediary step.
> The patch that follows adds a reverse() method to GenericData.Array that simply reverses the order of the elements in the underlying Object[].

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.