ctubbsii commented on code in PR #2811:
URL: https://github.com/apache/accumulo/pull/2811#discussion_r983870850
##########
core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java:
##########
@@ -174,40 +168,13 @@ public void readFields(DataInput in) throws IOException {
fieldsPrefixed = 0;
}
- byte[] row, cf, cq, cv;
- long ts;
-
- if ((fieldsSame & ROW_SAME) == ROW_SAME) {
- row = prevKey.getRowData().toArray();
- } else if ((fieldsPrefixed & ROW_COMMON_PREFIX) == ROW_COMMON_PREFIX) {
- row = readPrefix(in, prevKey.getRowData());
- } else {
- row = read(in);
- }
+ final byte[] row, cf, cq, cv;
+ final long ts;
- if ((fieldsSame & CF_SAME) == CF_SAME) {
- cf = prevKey.getColumnFamilyData().toArray();
- } else if ((fieldsPrefixed & CF_COMMON_PREFIX) == CF_COMMON_PREFIX) {
- cf = readPrefix(in, prevKey.getColumnFamilyData());
- } else {
- cf = read(in);
- }
-
- if ((fieldsSame & CQ_SAME) == CQ_SAME) {
- cq = prevKey.getColumnQualifierData().toArray();
- } else if ((fieldsPrefixed & CQ_COMMON_PREFIX) == CQ_COMMON_PREFIX) {
- cq = readPrefix(in, prevKey.getColumnQualifierData());
- } else {
- cq = read(in);
- }
-
- if ((fieldsSame & CV_SAME) == CV_SAME) {
- cv = prevKey.getColumnVisibilityData().toArray();
- } else if ((fieldsPrefixed & CV_COMMON_PREFIX) == CV_COMMON_PREFIX) {
- cv = readPrefix(in, prevKey.getColumnVisibilityData());
- } else {
- cv = read(in);
- }
+ row = getData(in, ROW_SAME, ROW_COMMON_PREFIX, () -> prevKey.getRowData());
+ cf = getData(in, CF_SAME, CF_COMMON_PREFIX, () ->
prevKey.getColumnFamilyData());
+ cq = getData(in, CQ_SAME, CQ_COMMON_PREFIX, () ->
prevKey.getColumnQualifierData());
+ cv = getData(in, CV_SAME, CV_COMMON_PREFIX, () ->
prevKey.getColumnVisibilityData());
Review Comment:
Can you provide more details on the test failures this causes? It seems odd
that it would cause test failures, since this should just be syntactic sugar
and not a functional change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]