Search in sources :

Example 56 with GlusterBrickEntity

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

the class GlusterSyncJobTest method createBrick.

private GlusterBrickEntity createBrick(Guid existingVolDistId, VDS server, String brickDir) {
    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setVolumeId(existingVolDistId);
    brick.setServerId(server.getId());
    brick.setServerName(server.getHostName());
    brick.setBrickDirectory(brickDir);
    brick.setStatus(GlusterStatus.UP);
    return brick;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)

Example 57 with GlusterBrickEntity

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

the class RefreshGlusterVolumeDetailsCommandTest method getBricks.

private List<GlusterBrickEntity> getBricks(Guid volumeId, int n) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    GlusterBrickEntity brick;
    for (Integer i = 0; i < n; i++) {
        brick = new GlusterBrickEntity();
        brick.setVolumeId(volumeId);
        brick.setBrickDirectory("/tmp/test-vol" + i.toString());
        brick.setStatus(GlusterStatus.UP);
        bricks.add(brick);
    }
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Example 58 with GlusterBrickEntity

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

the class ResetGlusterVolumeBrickCommandTest method getBricks.

private List<GlusterBrickEntity> getBricks(Guid volumeId, String dirPrefix, int n) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    GlusterBrickEntity brick;
    for (Integer i = 0; i < n; i++) {
        brick = new GlusterBrickEntity();
        brick.setVolumeId(volumeId);
        brick.setServerId(serverId);
        brick.setServerName(serverName);
        brick.setBrickDirectory("/tmp/" + dirPrefix + i.toString());
        brick.setStatus(GlusterStatus.UP);
        bricks.add(brick);
    }
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Example 59 with GlusterBrickEntity

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

the class AbstractRemoveGlusterVolumeBricksCommandTest method getInvalidNoOfBricks.

protected List<GlusterBrickEntity> getInvalidNoOfBricks(Guid volumeId) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setVolumeId(volumeId);
    brick.setBrickDirectory("/tmp/test-vol1");
    brick.setServerId(SERVER_ID);
    brick.setStatus(GlusterStatus.UP);
    bricks.add(brick);
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Example 60 with GlusterBrickEntity

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

the class AddBricksToGlusterVolumeCommandTest method getBrick.

private GlusterBrickEntity getBrick(Guid volumeId, Guid serverid, String brickDir) {
    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setVolumeId(volumeId);
    brick.setServerId(serverid);
    brick.setServerName(serverName);
    brick.setBrickDirectory(brickDir);
    brick.setStatus(GlusterStatus.UP);
    return brick;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)

Aggregations

GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)132 ArrayList (java.util.ArrayList)63 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)43 Test (org.junit.Test)28 Guid (org.ovirt.engine.core.compat.Guid)19 GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)14 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)13 VDS (org.ovirt.engine.core.common.businessentities.VDS)11 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)11 List (java.util.List)10 HashMap (java.util.HashMap)9 Map (java.util.Map)9 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)9 BrickProperties (org.ovirt.engine.core.common.businessentities.gluster.BrickProperties)9 GlusterVolumeRemoveBricksParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters)7 BrickDetails (org.ovirt.engine.core.common.businessentities.gluster.BrickDetails)7 GlusterVolumeAdvancedDetails (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails)7 GlusterVolumeType (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType)7 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)7 Iterator (java.util.Iterator)5