Class ContainerReader

java.lang.Object
org.apache.hadoop.ozone.container.ozoneimpl.ContainerReader
All Implemented Interfaces:
Runnable

public class ContainerReader extends Object implements Runnable
Class used to read .container files from Volume and build container map. Layout of the container directory on disk is as follows:

../hdds/VERSION

../hdds/<<clusterUuid>>/current/<<containerDir>>/<<containerID >/metadata/<<containerID>>.container

../hdds/<<clusterUuid>>/current/<<containerDir>>/<<containerID >/<<dataPath>>

Some ContainerTypes will have extra metadata other than the .container file. For example, KeyValueContainer will have a .db file. This .db file will also be stored in the metadata folder along with the .container file.

../hdds/<<clusterUuid>>/current/<<containerDir>>/<<KVcontainerID >/metadata/<<KVcontainerID>>.db

Note that the <<dataPath>> is dependent on the ContainerType. For KeyValueContainers, the data is stored in a "chunks" folder. As such, the <<dataPath>> layout for KeyValueContainers is:

../hdds/<<clusterUuid>>/current/<<containerDir>>/<<KVcontainerID >/chunks/<<chunksFile>>

  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • readVolume

      public void readVolume(File hddsVolumeRootDir)
    • verifyAndFixupContainerData

      public void verifyAndFixupContainerData(ContainerData containerData) throws IOException
      Verify ContainerData loaded from disk and fix-up stale members. Specifically the in memory values of blockCommitSequenceId, delete related metadata, bytesUsed and block count.
      Parameters:
      containerData -
      Throws:
      IOException