keith-turner commented on a change in pull request #2117:
URL: https://github.com/apache/accumulo/pull/2117#discussion_r646835544
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogFileKey.java
##########
@@ -189,4 +195,90 @@ public String toString() {
}
throw new RuntimeException("Unknown type of entry: " + event);
}
+
+ /**
+ * Converts LogFileKey to Key. Creates a Key containing all of the
LogFileKey fields. The fields
+ * are stored so the Key sorts maintaining the legacy sort order. The row of
the Key is composed
+ * of 3 fields: EventNum + tabletID + seq (separated by underscore). The
EventNum is the integer
+ * returned by eventType(). The column family is always the event. The
column qualifier is
+ * dependent of the type of event and could be empty.
+ *
+ * <pre>
+ * Key Schema:
+ * Row = EventNum_tabletID_seq
+ * Family = event
+ * Qualifier = tserverSession OR filename OR KeyExtent
+ * </pre>
+ */
+ public Key toKey() throws IOException {
+ String row = "";
+ int eventNum = eventType(event);
+ String family = event.name();
+ String qual = "";
+ switch (event) {
+ case OPEN:
+ row = formatRow(eventNum, 0, 0);
+ qual = tserverSession;
+ break;
+ case COMPACTION_START:
+ row = formatRow(eventNum, tabletId, seq);
+ if (filename != null)
Review comment:
There was a comment I made last week about using only the row of the key
to construct ranges to scan RFiles. That may help avoid the problem you
mentioned, not completely sure though.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]