Search in sources :

Example 1 with DatanodeVersionFile

use of org.apache.hadoop.ozone.container.common.helpers.DatanodeVersionFile in project ozone by apache.

the class HddsVolume method writeVersionFile.

private void writeVersionFile() throws IOException {
    Preconditions.checkNotNull(this.storageID, "StorageID cannot be null in Version File");
    Preconditions.checkNotNull(this.clusterID, "ClusterID cannot be null in Version File");
    Preconditions.checkNotNull(this.datanodeUuid, "DatanodeUUID cannot be null in Version File");
    Preconditions.checkArgument(this.cTime > 0, "Creation Time should be positive");
    Preconditions.checkArgument(this.layoutVersion == getLatestVersion().getVersion(), "Version File should have the latest LayOutVersion");
    File versionFile = getVersionFile();
    LOG.debug("Writing Version file to disk, {}", versionFile);
    DatanodeVersionFile dnVersionFile = new DatanodeVersionFile(this.storageID, this.clusterID, this.datanodeUuid, this.cTime, this.layoutVersion);
    dnVersionFile.createVersionFile(versionFile);
}
Also used : DatanodeVersionFile(org.apache.hadoop.ozone.container.common.helpers.DatanodeVersionFile) DatanodeVersionFile(org.apache.hadoop.ozone.container.common.helpers.DatanodeVersionFile) File(java.io.File)

Aggregations

File (java.io.File)1 DatanodeVersionFile (org.apache.hadoop.ozone.container.common.helpers.DatanodeVersionFile)1