Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21080

Collectors.toMap uses a byte [] for key

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Good one found by a jxray spelunking Misha Dmitriev.

      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).

      .setStoreSequenceIds(regionLoadPB.getStoreCompleteSequenceIdList().stream()
        .collect(Collectors.toMap(
          (ClusterStatusProtos.StoreSequenceId s) -> s.getFamilyName().toByteArray(),
            ClusterStatusProtos.StoreSequenceId::getSequenceId)))
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stack stack
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: