milleruntime commented on a change in pull request #2117:
URL: https://github.com/apache/accumulo/pull/2117#discussion_r648512335
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
##########
@@ -61,56 +66,58 @@
private static final Logger log =
LoggerFactory.getLogger(SortedLogRecovery.class);
- private VolumeManager fs;
+ private final ServerContext context;
- public SortedLogRecovery(VolumeManager fs) {
- this.fs = fs;
+ public SortedLogRecovery(ServerContext context) {
+ this.context = context;
}
- static LogFileKey maxKey(LogEvents event) {
+ static LogFileKey maxKey(LogEvents event, KeyExtent extent) {
LogFileKey key = new LogFileKey();
key.event = event;
key.tabletId = Integer.MAX_VALUE;
key.seq = Long.MAX_VALUE;
+ key.tablet = extent;
Review comment:
I did some refactoring in 6a94527457491cd0ff165122b93bfead6b9de85b so I
could call formatRow for the range as well. Then I was able to drop the dummy
value.
##########
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:
I did some refactoring in 6a94527457491cd0ff165122b93bfead6b9de85b so I
could call formatRow for the range as well. Then I was able to drop the dummy
value.
--
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]