You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2018/08/21 05:23:00 UTC

[jira] [Resolved] (HBASE-21080) Collectors.toMap uses a byte [] for key

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

stack resolved HBASE-21080.
---------------------------
      Resolution: Duplicate
    Release Note: Dupe of HBASE-21080

Dupe of HBASE-21080

> Collectors.toMap uses a byte [] for key
> ---------------------------------------
>
>                 Key: HBASE-21080
>                 URL: https://issues.apache.org/jira/browse/HBASE-21080
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Priority: Major
>
> Good one found by a jxray spelunking [~misha@cloudera.com].
> The below added by HBASE-19496 is making hashmaps with byte []s for keys (byte []'s don't do hashCode/Equals; usually when we have byte []'s for keys, we do ConcurrentMap and pass a Comparator in constructor that knows how to do byte []s).
> {code}
> .setStoreSequenceIds(regionLoadPB.getStoreCompleteSequenceIdList().stream()
>   .collect(Collectors.toMap(
>     (ClusterStatusProtos.StoreSequenceId s) -> s.getFamilyName().toByteArray(),
>       ClusterStatusProtos.StoreSequenceId::getSequenceId)))
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)