use of org.apache.hadoop.ozone.container.common.volume.VolumeIOStats in project ozone by apache.
the class ChunkManagerDummyImpl method writeChunk.
@Override
public void writeChunk(Container container, BlockID blockID, ChunkInfo info, ChunkBuffer data, DispatcherContext dispatcherContext) throws StorageContainerException {
Preconditions.checkNotNull(dispatcherContext);
DispatcherContext.WriteChunkStage stage = dispatcherContext.getStage();
ContainerData containerData = container.getContainerData();
if (stage == DispatcherContext.WriteChunkStage.WRITE_DATA || stage == DispatcherContext.WriteChunkStage.COMBINED) {
ChunkUtils.validateBufferSize(info.getLen(), data.remaining());
HddsVolume volume = containerData.getVolume();
VolumeIOStats volumeIOStats = volume.getVolumeIOStats();
volumeIOStats.incWriteOpCount();
volumeIOStats.incWriteBytes(info.getLen());
}
if (stage == DispatcherContext.WriteChunkStage.COMMIT_DATA || stage == DispatcherContext.WriteChunkStage.COMBINED) {
containerData.updateWriteStats(info.getLen(), false);
}
}
use of org.apache.hadoop.ozone.container.common.volume.VolumeIOStats in project ozone by apache.
the class AbstractTestChunkManager method checkWriteIOStats.
protected void checkWriteIOStats(long length, long opCount) {
VolumeIOStats volumeIOStats = hddsVolume.getVolumeIOStats();
assertEquals(length, volumeIOStats.getWriteBytes());
assertEquals(opCount, volumeIOStats.getWriteOpCount());
}
use of org.apache.hadoop.ozone.container.common.volume.VolumeIOStats in project ozone by apache.
the class AbstractTestChunkManager method checkReadIOStats.
protected void checkReadIOStats(long length, long opCount) {
VolumeIOStats volumeIOStats = hddsVolume.getVolumeIOStats();
assertEquals(length, volumeIOStats.getReadBytes());
assertEquals(opCount, volumeIOStats.getReadOpCount());
}
Aggregations