Exemplo n.º 1
0
  private GlusterVolumeEntity getNewVolume() {
    GlusterVolumeEntity volume = new GlusterVolumeEntity();
    volume.setName(NEW_VOL_NAME);
    volume.setClusterId(CLUSTER_ID);
    volume.setId(NEW_VOL_ID);
    volume.setVolumeType(GlusterVolumeType.DISTRIBUTE);
    volume.addTransportType(TransportType.TCP);
    volume.setReplicaCount(0);
    volume.setStripeCount(0);
    volume.setStatus(GlusterStatus.UP);
    volume.setOption("auth.allow", "*");
    volume.addAccessProtocol(AccessProtocol.GLUSTER);
    volume.addAccessProtocol(AccessProtocol.NFS);

    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setVolumeId(NEW_VOL_ID);
    brick.setServerId(existingServer1.getId());
    brick.setServerName(existingServer1.getHostName());
    brick.setBrickDirectory("/export/testvol1");
    brick.setStatus(GlusterStatus.UP);
    brick.setBrickOrder(0);
    volume.addBrick(brick);

    return volume;
  }
 private GlusterVolumeEntity getReplicatedVolume(Guid volumeId, int brickCount) {
   GlusterVolumeEntity volume = getVolume(volumeId);
   volume.setStatus(GlusterStatus.UP);
   volume.setBricks(getBricks(volumeId, "repl", brickCount));
   volume.setVolumeType(GlusterVolumeType.REPLICATE);
   volume.setReplicaCount(brickCount);
   volume.setClusterId(clusterId);
   return volume;
 }