Search in sources :

Example 1 with DebugLogWrapper

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));
        }
    }
}
Also used : lombok.val(lombok.val) DebugLogWrapper(io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper) Cleanup(lombok.Cleanup)

Example 2 with DebugLogWrapper

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());
        }
    }
}
Also used : lombok.val(lombok.val) DebugLogWrapper(io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper) Cleanup(lombok.Cleanup)

Example 3 with DebugLogWrapper

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);
    }
}
Also used : lombok.val(lombok.val) DebugLogWrapper(io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper) Cleanup(lombok.Cleanup)

Aggregations

DebugLogWrapper (io.pravega.segmentstore.storage.impl.bookkeeper.DebugLogWrapper)3 Cleanup (lombok.Cleanup)3 lombok.val (lombok.val)3