code: private void initSegs() throws IOException {
          int loaded = 0;
          File[] segFiles = listSegmentFiles();
          if (segFiles.length == 0) {
              return;
          }
  
          try {
              for (int i = 0; i < segFiles.length; i++) {
                  File segFile = segFiles[i];
                  int segId = Integer.parseInt(segFile.getName().substring(0, segFile.getName().indexOf('.')));
                  if (segId != i) {
                      throw new IOException("Segment file " + i + ".seg missing");
                  }
  
                  if (getMeta().hasSegmentInService(segId)) {
                      // Always load a live segment as READ_ONLY
                      Segment s = getSegmentFactory().createSegment(segId, segFile, _segFileSizeMB, Segment.Mode.READ_ONLY);
                      s.incrLoadSize(getMeta().getSegmentLoadSize(segId));
                      _segList.add(s);
                      loaded++;
                  } else {
                      // Segment is not live and is free for reuse
                      _segList.add(null);
                  }
              }
          } catch (IOException e) {
              _log.error(e.getMessage());
              
              clearInternal(false /* DO NOT CLEAR META */);
              throw e;
          }
  
          _log.info("loaded: " + loaded + "/" + segFiles.length);
      }
docs: Initializes the segments managed by this SegmentManager
  
  @throws IOException