Ejemplo n.º 1
0
 private void format(StorageDirectory bpSdir, NamespaceInfo nsInfo) throws IOException {
   LOG.info("Formatting block pool " + blockpoolID + " directory " + bpSdir.getCurrentDir());
   bpSdir.clearDirectory(); // create directory
   this.layoutVersion = HdfsConstants.DATANODE_LAYOUT_VERSION;
   this.cTime = nsInfo.getCTime();
   this.namespaceID = nsInfo.getNamespaceID();
   this.blockpoolID = nsInfo.getBlockPoolID();
   writeProperties(bpSdir);
 }
Ejemplo n.º 2
0
 void format(StorageDirectory sd, NamespaceInfo nsInfo) throws IOException {
   sd.clearDirectory(); // create directory
   this.layoutVersion = HdfsConstants.LAYOUT_VERSION;
   this.clusterID = nsInfo.getClusterID();
   this.namespaceID = nsInfo.getNamespaceID();
   this.cTime = 0;
   // store storageID as it currently is
   writeProperties(sd);
 }
Ejemplo n.º 3
0
  void format(StorageDirectory sd, NamespaceInfo nsInfo, String datanodeUuid) throws IOException {
    sd.clearDirectory();
    this.layoutVersion = HdfsConstants.DATANODE_LAYOUT_VERSION;
    this.clusterID = nsInfo.getClusterID();
    this.namespaceID = nsInfo.getNamespaceID();
    this.cTime = 0;
    setDatanodeUuid(datanodeUuid);
    if (sd.getStorageUuid() == null) {
      // 分配新的 Storage UUID.
      sd.setStorageUuid(DatanodeStorage.generateUuid());
    }

    writeProperties(sd);
  }