use of io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper in project pravega by pravega.
the class BookKeeperCleanupCommand method checkForExtraLogs.
private void checkForExtraLogs(Context context) throws Exception {
val maxLogId = context.serviceConfig.getContainerCount() * 10;
for (int logId = context.serviceConfig.getContainerCount(); logId < maxLogId; logId++) {
@Cleanup DebugLogWrapper log = context.logFactory.createDebugLogWrapper(logId);
val m = log.fetchMetadata();
if (m != null) {
throw new Exception(String.format("Discovered BookKeeperLog %d which is beyond the maximum log id (%d) as specified in the configuration.", logId, context.serviceConfig.getContainerCount() - 1));
}
}
}
use of io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper in project pravega by pravega.
the class BookKeeperCleanupCommand method collectAllReferencedLedgerIds.
private void collectAllReferencedLedgerIds(Collection<Long> referencedLedgerIds, Context context) throws Exception {
referencedLedgerIds.clear();
for (int logId = 0; logId < context.serviceConfig.getContainerCount(); logId++) {
@Cleanup DebugLogWrapper log = context.logFactory.createDebugLogWrapper(logId);
val m = log.fetchMetadata();
if (m == null) {
continue;
}
for (val lm : m.getLedgers()) {
referencedLedgerIds.add(lm.getLedgerId());
}
}
}
use of io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper in project pravega by pravega.
the class BookKeeperListCommand method execute.
@Override
public void execute() throws Exception {
ensureArgCount(0);
// Loop through all known log ids and fetch their metadata.
@Cleanup val context = createContext();
for (int logId = 0; logId < context.serviceConfig.getContainerCount(); logId++) {
@Cleanup DebugLogWrapper log = context.logFactory.createDebugLogWrapper(logId);
val m = log.fetchMetadata();
outputLogSummary(logId, m);
}
}
Aggregations