public void init() throws StoreException {
    File dir = new File(dataDir);
    File[] segmentFiles = dir.listFiles(LogSegmentName.LOG_FILE_FILTER);
    if (segmentFiles == null) {
      throw new StoreException("Could not read from directory: " + dataDir, StoreErrorCodes.FileNotFound);
    } else {
      initialize(getSegmentsToLoad(segmentFiles), config.storeSegmentSizeInBytes, false);
      this.isLogSegmented = isExistingLogSegmented();
    }
  }
Initializes the log by loading existing log segments from the specified directory.
If no segments are found, it creates the first segment. Otherwise, it sets up the log structure
and sets the active segment

@throws StoreException if there is any store exception loading the segment files.
ambry-store/src/main/java/com/github/ambry/store/Log.java