Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1425,11 +1425,10 @@ public void walogClosed(DfsLogger currentLog) throws WalMarkerException {
closedLogs.add(currentLog);
clSize = closedLogs.size();
}
log.info("Marking " + currentLog.getPath() + " as closed. Total closed logs " + clSize);
log.info("Marking {} as closed. Total closed logs: {} ", currentLog.getPath(), clSize);
walMarker.closeWal(getTabletSession(), currentLog.getPath());
} else {
log.info(
"Marking " + currentLog.getPath() + " as unreferenced (skipping closed writes == 0)");
log.info("Marking {} as unreferenced (skipping closed writes == 0)", currentLog.getPath());
walMarker.walUnreferenced(getTabletSession(), currentLog.getPath());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -567,6 +568,11 @@ public synchronized long getWrites() {
return writes;
}

public synchronized long getBytesWritten() {
Objects.requireNonNull(logFile, "logFile is null");
return logFile.getPos();
}

public LoggerOperation defineTablet(CommitSession cs) throws IOException {
// write this log to the METADATA table
final LogFileKey key = new LogFileKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void run() {
// it's possible the log was advertised in ZK even though we got an
// exception. If there's a chance the WAL marker may have been created,
// this will ensure it's closed. Either the close will be written and
// the GC will clean it up, or the tserver is about to die due to sesson
// the GC will clean it up, or the tserver is about to die due to session
// expiration and the GC will also clean it up.
try {
tserver.walogClosed(alog);
Expand Down Expand Up @@ -371,6 +371,8 @@ private synchronized void close() throws IOException {
if (currentLog != null) {
try {
currentLog.close();
log.info("Closing write-ahead log: {}, entries written: {}, bytes written: {}",
currentLog.getFileName(), currentLog.getWrites(), currentLog.getBytesWritten());
} catch (DfsLogger.LogClosedException ex) {
// ignore
} catch (Exception ex) {
Expand Down
Loading