DomGarguilo commented on code in PR #2811:
URL: https://github.com/apache/accumulo/pull/2811#discussion_r983877362


##########
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:
   The test errors can be seen 
[here](https://github.com/apache/accumulo/actions/runs/3152941923/jobs/5128865689#step:6:2393)
   
   here are the failing tests:
   ```
   [ERROR] Errors: 
   [ERROR]   RFileClientTest.testCache:523->lambda$testCache$0:525 » NullPointer
   [ERROR]   BlockIndexTest.test1:91 » NullPointer
   [ERROR]   BlockIndexTest.testSame:163 » NullPointer
   [ERROR]   RFileTest.test11:1213 » NullPointer
   [ERROR]   RFileTest.test17:1409 » NullPointer
   [ERROR]   RFileTest.test18:1542->t18Verify:1494 » NullPointer
   [ERROR]   RFileTest.test3:472 » NullPointer
   [ERROR]   RFileTest.test8:758 » NullPointer
   [ERROR]   RFileTest.testEncRFile11:1842->test11:1213 » NullPointer
   [ERROR]   RFileTest.testEncRFile17:1876->test17:1409 » NullPointer
   [ERROR]   RFileTest.testEncRFile18:1882->test18:1542->t18Verify:1494 » 
NullPointer
   [ERROR]   RFileTest.testEncRFile3:1786->test3:472 » NullPointer
   [ERROR]   RFileTest.testEncRFile8:1821->test8:758 » NullPointer
   [ERROR]   RFileTest.testEncSample:2195->testSampleLG:2174->checkSample:2006 
» NullPointer
   [ERROR]   RFileTest.testEncryptedRFiles:1898->test3:472 » NullPointer
   [ERROR]   RFileTest.testOldVersions:1684->runVersionTest:1727 » NullPointer
   [ERROR]   RFileTest.testOldVersionsWithCrypto:1693->runVersionTest:1727 » 
NullPointer
   [ERROR]   RFileTest.testReseekUnconsumed:1634 » NullPointer
   [ERROR]   RFileTest.testSampleLG:2174->checkSample:2006 » NullPointe
   ```
   Locally i kept stepping back through commits to determine that commit was 
causing these failures. I also think its weird that this causes failures but it 
seems like it is.



-- 
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]

Reply via email to