Search in sources :

Example 1 with VolumeIOStats

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);
    }
}
Also used : HddsVolume(org.apache.hadoop.ozone.container.common.volume.HddsVolume) VolumeIOStats(org.apache.hadoop.ozone.container.common.volume.VolumeIOStats) DispatcherContext(org.apache.hadoop.ozone.container.common.transport.server.ratis.DispatcherContext) ContainerData(org.apache.hadoop.ozone.container.common.impl.ContainerData)

Example 2 with VolumeIOStats

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());
}
Also used : VolumeIOStats(org.apache.hadoop.ozone.container.common.volume.VolumeIOStats)

Example 3 with VolumeIOStats

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());
}
Also used : VolumeIOStats(org.apache.hadoop.ozone.container.common.volume.VolumeIOStats)

Aggregations

VolumeIOStats (org.apache.hadoop.ozone.container.common.volume.VolumeIOStats)3 ContainerData (org.apache.hadoop.ozone.container.common.impl.ContainerData)1 DispatcherContext (org.apache.hadoop.ozone.container.common.transport.server.ratis.DispatcherContext)1 HddsVolume (org.apache.hadoop.ozone.container.common.volume.HddsVolume)1