Interface ContainerInspector
- All Known Implementing Classes:
KeyValueContainerMetadataInspector
public interface ContainerInspector
A ContainerInspector is tool used to log information about all
containers as they are being processed during datanode startup. It could
also be used to repair containers if necessary.
These are primarily debug/developer utilities that will slow down datanode
startup and are only meant to be run as needed.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the inspector will be modifying containers as part of the process method.booleanload()Loads necessary configurations to determine how/if to run the inspector when the process method is called.voidprocess(ContainerData data, DatanodeStore store) Operates on the container as the inspector is configured.voidunload()Removes configurations to run the inspector, so that the process method becomes a no-op.
-
Method Details
-
load
boolean load()Loads necessary configurations to determine how/if to run the inspector when the process method is called.- Returns:
- true if the inspector will operate when process is called. False otherwise.
-
unload
void unload()Removes configurations to run the inspector, so that the process method becomes a no-op. -
isReadOnly
boolean isReadOnly()Determines whether the inspector will be modifying containers as part of the process method.- Returns:
- true if the inspector will only read the container, false if it will be making modifications/repairs.
-
process
Operates on the container as the inspector is configured. This may involve logging information or fixing errors. Multiple containers may be processed in parallel by calling this method on the same inspector instance, but only one process call will be invoked per container at a time. Implementations must ensure that: 1. Information they log is batched so that log output from other inspectors working on other containers is not interleaved. 2. Multiple process calls to the same inspector instance with different containers are thread safe.- Parameters:
data- Container data for the container to process.store- The metadata store for this container.
-