hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manoj Govindassamy (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-12653) Implement toArray() and subArray() for ReadOnlyList
Date Fri, 13 Oct 2017 00:13:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-12653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Manoj Govindassamy updated HDFS-12653:
--------------------------------------
    Summary: Implement toArray() and subArray() for ReadOnlyList  (was: Implement toArray()
and toSubArray() for ReadOnlyList)

> Implement toArray() and subArray() for ReadOnlyList
> ---------------------------------------------------
>
>                 Key: HDFS-12653
>                 URL: https://issues.apache.org/jira/browse/HDFS-12653
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Manoj Govindassamy
>            Assignee: Manoj Govindassamy
>
> {{ReadOnlyList}} today gives an unmodifiable view of the backing List. This list supports
following Util methods for easy construction of read only views of any given list. 
> {noformat}
> public static <E> ReadOnlyList<E> asReadOnlyList(final List<E> list)

> public static <E> List<E> asList(final ReadOnlyList<E> list)
> {noformat}
> {{asList}} above additionally overrides {{Object[] toArray()}} of the {{java.util.List}}
interface. Unlike the {{java.util.List}}, the above one returns an array of Objects referring
to the backing list and avoid any copying of objects. Given that we have many usages of read
only lists,
> 1. Lets have a light-weight / shared-view {{toArray()}} implementation for {{ReadOnlyList}}
as well. 
> 2. Additionally, similar to {{java.util.List#subList(fromIndex, toIndex)}}, lets have
{{ReadOnlyList#subArray(fromIndex, toIndex)}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message