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

Collectors.toMap uses a byte [] for key

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

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

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stack Michael Stack
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: