code: private synchronized void initFsDataSet(Configuration conf,
        AbstractList<File> dataDirs, int numNamespaces) throws IOException {
      if (data != null) { // Already initialized
        return;
      }
  
      // get version and id info from the name-node
      boolean simulatedFSDataset = 
        conf.getBoolean("dfs.datanode.simulateddatastorage", false);
  
      if (simulatedFSDataset) {
        storage.createStorageID(selfAddr.getPort());
        // it would have been better to pass storage as a parameter to
        // constructor below - need to augment ReflectionUtils used below.
        conf.set("dfs.datanode.StorageId", storage.getStorageID());
        try {
          data = (FSDatasetInterface) ReflectionUtils.newInstance(
              Class.forName(
              "org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset"),
              conf);
        } catch (ClassNotFoundException e) {
          throw new IOException(StringUtils.stringifyException(e));
        }
      } else {
        data = new FSDataset(this, conf, numNamespaces);
      }
    }
docs: Initializes the {@link #data}. The initialization is done only once, when
  handshake with the the first namenode is completed.