You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "paul cannon (JIRA)" <ji...@apache.org> on 2011/09/07 00:53:10 UTC
[jira] [Created] (CASSANDRA-3146) Minor changes to IntervalTree
Minor changes to IntervalTree
-----------------------------
Key: CASSANDRA-3146
URL: https://issues.apache.org/jira/browse/CASSANDRA-3146
Project: Cassandra
Issue Type: Improvement
Components: Core
Reporter: paul cannon
Assignee: paul cannon
Priority: Minor
Fix For: 1.0
I have a few minor changes to IntervalTree that I feel improve its performance and readability. None of this should have an effect on correctness.
Details:
* rename IntervalNode members v_left/v_right to intersects_left/intersects_right, to avoid confusion with the members similarly named "left" and "right"
* remove the unused IntervalNode.interval member
* don't calculate the list of intersecting intervals twice in IntervalNode constructor
* fix comment in IntervalNode constructor: s/i.min/i.max/
* remove unused java.util.Collections import from IntervalTree.java
* remove unused code path (checking twice for null == node) in IntervalTree.searchInternal()
* genericize Interval parameter type to IntervalTree.search()
There are still a lot of unchecked operations around the Interval generic stuff, and the OCD guy inside me wants it to be competely type-safe, but in real life this ought to be fine like it is. Plus the static Orderings in Interval.java would need to be made instance variables and that would just be annoying.
Ok, so, go ahead and ignore any of this if appropriate. It just helped me feel better with the code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-3146) Minor changes to IntervalTree
Posted by "paul cannon (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
paul cannon updated CASSANDRA-3146:
-----------------------------------
Attachment: 3146.patch.txt
Apply changes described. This patch applies on top of the one from CASSANDRA-3145.
The patch is attached here for posterity, but the changes can probably be more meaningfully explored on github:
https://github.com/thepaul/cassandra/compare/0c665b39a7dac49141e6b856c33d5d0e05a9343b...35b6d08b94fd24c837a73b564216b7a1bc65bed2
> Minor changes to IntervalTree
> -----------------------------
>
> Key: CASSANDRA-3146
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3146
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: paul cannon
> Assignee: paul cannon
> Priority: Minor
> Fix For: 1.0
>
> Attachments: 3146.patch.txt
>
>
> I have a few minor changes to IntervalTree that I feel improve its performance and readability. None of this should have an effect on correctness.
> Details:
> * rename IntervalNode members v_left/v_right to intersects_left/intersects_right, to avoid confusion with the members similarly named "left" and "right"
> * remove the unused IntervalNode.interval member
> * don't calculate the list of intersecting intervals twice in IntervalNode constructor
> * fix comment in IntervalNode constructor: s/i.min/i.max/
> * remove unused java.util.Collections import from IntervalTree.java
> * remove unused code path (checking twice for null == node) in IntervalTree.searchInternal()
> * genericize Interval parameter type to IntervalTree.search()
> There are still a lot of unchecked operations around the Interval generic stuff, and the OCD guy inside me wants it to be competely type-safe, but in real life this ought to be fine like it is. Plus the static Orderings in Interval.java would need to be made instance variables and that would just be annoying.
> Ok, so, go ahead and ignore any of this if appropriate. It just helped me feel better with the code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-3146) Minor changes to IntervalTree
Posted by "Benjamin Coverston (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099171#comment-13099171 ]
Benjamin Coverston commented on CASSANDRA-3146:
-----------------------------------------------
+1
These changes look good.
> Minor changes to IntervalTree
> -----------------------------
>
> Key: CASSANDRA-3146
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3146
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: paul cannon
> Assignee: paul cannon
> Priority: Minor
> Fix For: 1.0
>
> Attachments: 3146.patch.txt
>
>
> I have a few minor changes to IntervalTree that I feel improve its performance and readability. None of this should have an effect on correctness.
> Details:
> * rename IntervalNode members v_left/v_right to intersects_left/intersects_right, to avoid confusion with the members similarly named "left" and "right"
> * remove the unused IntervalNode.interval member
> * don't calculate the list of intersecting intervals twice in IntervalNode constructor
> * fix comment in IntervalNode constructor: s/i.min/i.max/
> * remove unused java.util.Collections import from IntervalTree.java
> * remove unused code path (checking twice for null == node) in IntervalTree.searchInternal()
> * genericize Interval parameter type to IntervalTree.search()
> There are still a lot of unchecked operations around the Interval generic stuff, and the OCD guy inside me wants it to be competely type-safe, but in real life this ought to be fine like it is. Plus the static Orderings in Interval.java would need to be made instance variables and that would just be annoying.
> Ok, so, go ahead and ignore any of this if appropriate. It just helped me feel better with the code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-3146) Minor changes to IntervalTree
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099220#comment-13099220 ]
Hudson commented on CASSANDRA-3146:
-----------------------------------
Integrated in Cassandra #1084 (See [https://builds.apache.org/job/Cassandra/1084/])
intervaltree cleanup
patch by Paul Cannon; reviewed by Ben Coverston for CASSANDRA-3146
jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1166305
Files :
* /cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalNode.java
* /cassandra/trunk/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java
> Minor changes to IntervalTree
> -----------------------------
>
> Key: CASSANDRA-3146
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3146
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Reporter: paul cannon
> Assignee: paul cannon
> Priority: Minor
> Fix For: 1.0
>
> Attachments: 3146.patch.txt
>
>
> I have a few minor changes to IntervalTree that I feel improve its performance and readability. None of this should have an effect on correctness.
> Details:
> * rename IntervalNode members v_left/v_right to intersects_left/intersects_right, to avoid confusion with the members similarly named "left" and "right"
> * remove the unused IntervalNode.interval member
> * don't calculate the list of intersecting intervals twice in IntervalNode constructor
> * fix comment in IntervalNode constructor: s/i.min/i.max/
> * remove unused java.util.Collections import from IntervalTree.java
> * remove unused code path (checking twice for null == node) in IntervalTree.searchInternal()
> * genericize Interval parameter type to IntervalTree.search()
> There are still a lot of unchecked operations around the Interval generic stuff, and the OCD guy inside me wants it to be competely type-safe, but in real life this ought to be fine like it is. Plus the static Orderings in Interval.java would need to be made instance variables and that would just be annoying.
> Ok, so, go ahead and ignore any of this if appropriate. It just helped me feel better with the code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira