Class MoveStep
java.lang.Object
org.apache.hadoop.hdfs.server.diskbalancer.planner.MoveStep
- All Implemented Interfaces:
Step
Ignore fields with default values. In most cases Throughtput, diskErrors
tolerancePercent and bandwidth will be the system defaults.
So we will avoid serializing them into JSON.
-
Constructor Summary
ConstructorsConstructorDescriptionMoveStep()Empty Constructor for JSON serialization.MoveStep(DiskBalancerVolume sourceVolume, double idealStorage, DiskBalancerVolume destinationVolume, long bytesToMove, String volumeSetID) Constructs a MoveStep for the volume set. -
Method Summary
Modifier and TypeMethodDescriptionlongGets the disk Bandwidth.longReturns number of bytes to move.Gets the destination volume.doubleGets the IdealStorage.longGets Maximum numbers of errors to be tolerated before this move operation is aborted.getSizeString(long size) Returns human readable move sizes.Gets Source Volume.longTolerance Percentage indicates when a move operation is considered good enough.Gets a volume Set ID.voidsetBandwidth(long bandwidth) Sets the maximum disk bandwidth per sec to use for this step.voidsetBytesToMove(long bytesToMove) Sets bytes to move.voidsetDestinationVolume(DiskBalancerVolume destinationVolume) Sets destination volume.voidsetIdealStorage(double idealStorage) Sets Ideal Storage.voidsetMaxDiskErrors(long maxDiskErrors) Sets the maximum numbers of Errors to be tolerated before this step is aborted.voidsetSourceVolume(DiskBalancerVolume sourceVolume) Set source volume.voidsetTolerancePercent(long tolerancePercent) Sets the tolerance percentage.voidsetVolumeSetID(String volumeSetID) Sets volume id.toString()Returns a string representation of the object.
-
Constructor Details
-
MoveStep
public MoveStep(DiskBalancerVolume sourceVolume, double idealStorage, DiskBalancerVolume destinationVolume, long bytesToMove, String volumeSetID) Constructs a MoveStep for the volume set.- Parameters:
sourceVolume- - Source DiskidealStorage- - Ideal Storage Value for this disk setdestinationVolume- - Destination disbytesToMove- - number of bytes to movevolumeSetID- - a diskBalancer generated id.
-
MoveStep
public MoveStep()Empty Constructor for JSON serialization.
-
-
Method Details
-
getBytesToMove
public long getBytesToMove()Returns number of bytes to move.- Specified by:
getBytesToMovein interfaceStep- Returns:
- - long
-
getDestinationVolume
Gets the destination volume.- Specified by:
getDestinationVolumein interfaceStep- Returns:
- - volume
-
getIdealStorage
public double getIdealStorage()Gets the IdealStorage.- Specified by:
getIdealStoragein interfaceStep- Returns:
- float
-
getSourceVolume
Gets Source Volume.- Specified by:
getSourceVolumein interfaceStep- Returns:
- -- Source Volume
-
getVolumeSetID
Gets a volume Set ID.- Specified by:
getVolumeSetIDin interfaceStep- Returns:
- String
-
setSourceVolume
Set source volume.- Parameters:
sourceVolume- - volume
-
setDestinationVolume
Sets destination volume.- Parameters:
destinationVolume- - volume
-
setIdealStorage
public void setIdealStorage(double idealStorage) Sets Ideal Storage.- Parameters:
idealStorage- - ideal Storage
-
setBytesToMove
public void setBytesToMove(long bytesToMove) Sets bytes to move.- Parameters:
bytesToMove- - number of bytes
-
setVolumeSetID
Sets volume id.- Parameters:
volumeSetID- - volume ID
-
toString
Returns a string representation of the object. -
getSizeString
Returns human readable move sizes.- Specified by:
getSizeStringin interfaceStep- Parameters:
size- - bytes being moved.- Returns:
- String
-
getMaxDiskErrors
public long getMaxDiskErrors()Gets Maximum numbers of errors to be tolerated before this move operation is aborted.- Specified by:
getMaxDiskErrorsin interfaceStep- Returns:
- long.
-
setMaxDiskErrors
public void setMaxDiskErrors(long maxDiskErrors) Sets the maximum numbers of Errors to be tolerated before this step is aborted.- Specified by:
setMaxDiskErrorsin interfaceStep- Parameters:
maxDiskErrors- - long
-
getTolerancePercent
public long getTolerancePercent()Tolerance Percentage indicates when a move operation is considered good enough. This is a percentage of deviation from ideal that is considered fine. For example : if the ideal amount on each disk was 1 TB and the tolerance was 10%, then getting to 900 GB on the destination disk is considered good enough.- Specified by:
getTolerancePercentin interfaceStep- Returns:
- tolerance percentage.
-
setTolerancePercent
public void setTolerancePercent(long tolerancePercent) Sets the tolerance percentage.- Specified by:
setTolerancePercentin interfaceStep- Parameters:
tolerancePercent- - long
-
getBandwidth
public long getBandwidth()Gets the disk Bandwidth. That is the MB/Sec to copied. We will max out on this amount of throughput. This is useful to prevent too much I/O on datanode while data node is in use.- Specified by:
getBandwidthin interfaceStep- Returns:
- long.
-
setBandwidth
public void setBandwidth(long bandwidth) Sets the maximum disk bandwidth per sec to use for this step.- Specified by:
setBandwidthin interfaceStep- Parameters:
bandwidth- - Long, MB / Sec of data to be moved between source and destinatin volume.
-