keith-turner commented on code in PR #5700: URL: https://github.com/apache/accumulo/pull/5700#discussion_r2301499125
########## core/src/main/java/org/apache/accumulo/core/clientImpl/TabletInformationImpl.java: ########## @@ -32,23 +32,36 @@ import org.apache.accumulo.core.metadata.schema.TabletMetadata; import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location; +import com.google.common.base.Suppliers; + public class TabletInformationImpl implements TabletInformation { private final TabletMetadata tabletMetadata; - private long estimatedSize; - private long estimatedEntries; - private final String tabletState; + + private final Supplier<String> tabletState; private final Supplier<Duration> currentTime; + private final Supplier<FileInfo> fileInfo; + + private class FileInfo { + private final long estimatedSize; + private final long estimatedEntries; + + FileInfo() { + long estimatedEntries = 0L; + long estimatedSize = 0L; + for (DataFileValue dfv : tabletMetadata.getFilesMap().values()) { Review Comment: This is ok because the construction of FileInfo is memoized in the TabletInformationImpl constructor. So it will only throw an exception when the getter is called and not when scainning. The new ITs tests this. -- 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. To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org