Search in sources :

Example 1 with MallInfo

use of org.ovirt.engine.core.common.businessentities.gluster.MallInfo in project ovirt-engine by oVirt.

the class GlusterVolumeStatusReturn method prepareMallInfo.

private MallInfo prepareMallInfo(Map<String, Object> mallInfo) {
    MallInfo glusterMallInfo = new MallInfo();
    glusterMallInfo.setArena(Integer.parseInt((String) mallInfo.get(MEMORY_ARENA)));
    glusterMallInfo.setOrdblks(Integer.parseInt((String) mallInfo.get(MEMORY_ORDBLKS)));
    glusterMallInfo.setSmblks(Integer.parseInt((String) mallInfo.get(MEMORY_SMBLKS)));
    glusterMallInfo.setHblks(Integer.parseInt((String) mallInfo.get(MEMORY_HBLKS)));
    glusterMallInfo.setHblkhd(Integer.parseInt((String) mallInfo.get(MEMORY_HBLKHD)));
    glusterMallInfo.setUsmblks(Integer.parseInt((String) mallInfo.get(MEMORY_USMBLKS)));
    glusterMallInfo.setFsmblks(Integer.parseInt((String) mallInfo.get(MEMORY_FSMBLKS)));
    glusterMallInfo.setUordblks(Integer.parseInt((String) mallInfo.get(MEMORY_UORDBLKS)));
    glusterMallInfo.setFordblks(Integer.parseInt((String) mallInfo.get(MEMORY_FORDBLKS)));
    glusterMallInfo.setKeepcost(Integer.parseInt((String) mallInfo.get(MEMORY_KEEPCOST)));
    return glusterMallInfo;
}
Also used : MallInfo(org.ovirt.engine.core.common.businessentities.gluster.MallInfo)

Example 2 with MallInfo

use of org.ovirt.engine.core.common.businessentities.gluster.MallInfo in project ovirt-engine by oVirt.

the class BrickStatisticalQuery method getStatistics.

@Override
public List<Statistic> getStatistics(GlusterBrickEntity entity) {
    BrickDetails brickDetails = entity.getBrickDetails();
    MallInfo mallInfo = brickDetails.getMemoryStatus().getMallInfo();
    return asList(setDatum(clone(MEM_TOTAL_SIZE), brickDetails.getBrickProperties().getTotalSize() * Mb), setDatum(clone(MEM_FREE_SIZE), brickDetails.getBrickProperties().getFreeSize() * Mb), setDatum(clone(MEM_BLOCK_SIZE), brickDetails.getBrickProperties().getBlockSize() * Mb), setDatum(clone(MEM_MALL_ARENA), mallInfo.getArena()), setDatum(clone(MEM_MALL_ORDBLKS), mallInfo.getOrdblks()), setDatum(clone(MEM_MALL_SMBLKS), mallInfo.getSmblks()), setDatum(clone(MEM_MALL_HBLKS), mallInfo.getHblks()), setDatum(clone(MEM_MALL_HBLKSHD), mallInfo.getHblkhd()), setDatum(clone(MEM_MALL_USMBLKS), mallInfo.getUsmblks()), setDatum(clone(MEM_MALL_FSMBLKS), mallInfo.getFsmblks()), setDatum(clone(MEM_MALL_UORDBLKS), mallInfo.getUordblks()), setDatum(clone(MEM_MALL_FORDBLKS), mallInfo.getFordblks()), setDatum(clone(MEM_MALL_KEEPCOST), mallInfo.getKeepcost()));
}
Also used : MallInfo(org.ovirt.engine.core.common.businessentities.gluster.MallInfo) BrickDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickDetails)

Example 3 with MallInfo

use of org.ovirt.engine.core.common.businessentities.gluster.MallInfo in project ovirt-engine by oVirt.

the class GlusterBrickDetailMapperTest method getMemoryStatus.

private MemoryStatus getMemoryStatus(int listSize) {
    MemoryStatus memStatus = new MemoryStatus();
    memStatus.setMallInfo(new MallInfo());
    memStatus.getMallInfo().setArena(RandomUtils.instance().nextInt());
    memStatus.getMallInfo().setUordblks(RandomUtils.instance().nextInt());
    ArrayList<Mempool> memPoolsList = new ArrayList<>();
    for (int i = 0; i < listSize; i++) {
        Mempool pool = new Mempool();
        pool.setAllocCount(RandomUtils.instance().nextInt());
        pool.setHotCount(0);
        pool.setName(RandomUtils.instance().nextString(5));
        memPoolsList.add(pool);
    }
    memStatus.setMemPools(memPoolsList);
    return memStatus;
}
Also used : MallInfo(org.ovirt.engine.core.common.businessentities.gluster.MallInfo) MemoryStatus(org.ovirt.engine.core.common.businessentities.gluster.MemoryStatus) ArrayList(java.util.ArrayList) Mempool(org.ovirt.engine.core.common.businessentities.gluster.Mempool)

Example 4 with MallInfo

use of org.ovirt.engine.core.common.businessentities.gluster.MallInfo in project ovirt-engine by oVirt.

the class GetGlusterVolumeAdvancedDetailsQueryTest method getMallInfo.

private MallInfo getMallInfo() {
    MallInfo mallInfo = new MallInfo();
    mallInfo.setArena(606208);
    mallInfo.setFordblks(110336);
    mallInfo.setFsmblks(0);
    mallInfo.setHblkhd(15179776);
    mallInfo.setOrdblks(1);
    mallInfo.setSmblks(0);
    mallInfo.setUordblks(495872);
    mallInfo.setUsmblks(0);
    return mallInfo;
}
Also used : MallInfo(org.ovirt.engine.core.common.businessentities.gluster.MallInfo)

Example 5 with MallInfo

use of org.ovirt.engine.core.common.businessentities.gluster.MallInfo in project ovirt-engine by oVirt.

the class GlusterTestHelper method getBrickEntity.

protected GlusterBrickEntity getBrickEntity(int index, boolean hasDetails) {
    GlusterBrickEntity entity = mock(GlusterBrickEntity.class);
    when(entity.getId()).thenReturn(GUIDS[index]);
    when(entity.getServerId()).thenReturn(serverId);
    when(entity.getBrickDirectory()).thenReturn(GlusterTestHelper.brickDir);
    when(entity.getQualifiedName()).thenReturn(GlusterTestHelper.brickName);
    when(entity.getVolumeId()).thenReturn(volumeId);
    if (hasDetails) {
        BrickDetails brickDetails = mock(BrickDetails.class);
        BrickProperties brickProps = mock(BrickProperties.class);
        MemoryStatus memStatus = mock(MemoryStatus.class);
        MallInfo mallInfo = mock(MallInfo.class);
        when(mallInfo.getArena()).thenReturn(888);
        when(brickProps.getMntOptions()).thenReturn(GlusterTestHelper.BRICK_MNT_OPT);
        when(brickProps.getPort()).thenReturn(GlusterTestHelper.BRICK_PORT);
        when(brickDetails.getMemoryStatus()).thenReturn(memStatus);
        when(memStatus.getMallInfo()).thenReturn(mallInfo);
        when(brickDetails.getBrickProperties()).thenReturn(brickProps);
        when(entity.getBrickDetails()).thenReturn(brickDetails);
    }
    return entity;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) MallInfo(org.ovirt.engine.core.common.businessentities.gluster.MallInfo) MemoryStatus(org.ovirt.engine.core.common.businessentities.gluster.MemoryStatus) BrickDetails(org.ovirt.engine.core.common.businessentities.gluster.BrickDetails) BrickProperties(org.ovirt.engine.core.common.businessentities.gluster.BrickProperties)

Aggregations

MallInfo (org.ovirt.engine.core.common.businessentities.gluster.MallInfo)5 BrickDetails (org.ovirt.engine.core.common.businessentities.gluster.BrickDetails)2 MemoryStatus (org.ovirt.engine.core.common.businessentities.gluster.MemoryStatus)2 ArrayList (java.util.ArrayList)1 BrickProperties (org.ovirt.engine.core.common.businessentities.gluster.BrickProperties)1 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)1 Mempool (org.ovirt.engine.core.common.businessentities.gluster.Mempool)1