Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4375

Add missing Key constructors taking array of bytes as argument

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: core
    • Labels:

      Description

      In my company we use Key built directly from byte[] instead of Text. Currently Key has many constructors working with Text and only few working with byte[]. You can still use the Text-based constructor to create a Key from a byte[] by wrapping it into a Text, but this requires to box a byte[] into Text without any good reason.
      I propose to add the missing byte[]-based Key constructors, which are:

      Key(byte[] row)
      Key(byte[] row, long ts)
      Key(byte[] row, byte[] cf)
      Key(byte[] row, byte[] cf, byte[] cq)
      Key(byte[] row, byte[] cf, byte[] cq, byte[] cv)
      Key(byte[] row, byte[] cf, byte[] cq, long ts)
      Key(byte[] row, byte[] cf, byte[] cq, ColumnVisibility cv, long ts)
      

      The new constructor should behave like the Text-based counterpart, for instance:

      byte[] row = new byte[] {0};
      assertEquals(new Key(row), new Key(new Text(row)));
      

        Attachments

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

              • Assignee:
                melrief Mario Pastorelli
                Reporter:
                melrief Mario Pastorelli
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 5h
                  5h