docs: private static void writeMyIdToDataDir(Properties zkProps, int id) throws IOException {
  
  		// Check dataDir and create if necessary
  		if (zkProps.getProperty("dataDir") == null) {
  			throw new IllegalConfigurationException("No dataDir configured.");
  		}
  
  		File dataDir = new File(zkProps.getProperty("dataDir"));
  
  		if (!dataDir.isDirectory() && !dataDir.mkdirs()) {
  			throw new IOException("Cannot create dataDir '" + dataDir + "'.");
  		}
  
  		dataDir.deleteOnExit();
  
  		LOG.info("Writing {} to myid file in 'dataDir'.", id);
  		
  		// Write myid to file. We use a File Writer, because that properly propagates errors,
  		// while the PrintWriter swallows errors
  		try (FileWriter writer = new FileWriter(new File(dataDir, "myid"))) {
  			writer.write(String.valueOf(id));
  		}
  	}