cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10063) Standardize use of collections, streams, iterables, functions, predicates etc.
Date Thu, 13 Aug 2015 10:16:45 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-10063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695019#comment-14695019
] 

Benedict commented on CASSANDRA-10063:
--------------------------------------

re: "not how we would implement them", {{RegularImmutableMap.get}} does not exploit a pretty
standard efficiency of performing hash comparison prior to object equality, and if provided
a {{null}} key simply always returns {{null}} (of course, semantically that is correct, since
it throws a precondition failure if you try to add a null mapping to the map, but it certainly
breaks my expectation of matched failure on get, since it's a non-permitted value). Of course,
only tangentially related, but related and worth recording for future consideration.

> Standardize use of collections, streams, iterables, functions, predicates etc.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10063
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10063
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benedict
>             Fix For: 3.x
>
>
> With the advent of Java 8 we have a lot of different mechanisms for achieving the same
expression of ideas. We should standardize on (approximately) a single approach across the
codebase, as this will help clarity, reduce development time (with less indecision about which
set of tools to use, and how to interface between the two), and improve icache occupancy.
> The problem is exacerbated by the difficulty of interfacing between the two paradigms,
and this (IMO) introduces an unnecessary cognitive burden when they inevitably meet. We should
pick one and fill in whatever we're missing to make it fit all of our needs. We should perform
a bit of due diligence about the implementation details of any utility methods we use also,
as having dived into a handful they are occasionally.... surprising. And probably not how
we would implement them (take {{Ordering.leastOf}} as an example).
> Since it is the future, I think we should be standardising on the JDK8 Streams API where
possible. There are a couple of rough edges with interfacing with it in some places, but we
can smooth them and the result should be much more legible code.
> This really should not be a huge amount of work, and I expect will pay dividends quite
quickly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message