예제 #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;
  }
예제 #2
0
 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;
 }
 private List<GlusterBrickEntity> getBricks(Guid volumeId, int max) {
   List<GlusterBrickEntity> bricks = new ArrayList<>();
   for (Integer i = 0; i < max; i++) {
     GlusterBrickEntity brick1 = new GlusterBrickEntity();
     brick1.setVolumeId(volumeId);
     brick1.setServerName("server1");
     brick1.setStatus(GlusterStatus.UP);
     brick1.setBrickDirectory("/tmp/s" + i.toString());
     bricks.add(brick1);
   }
   return bricks;
 }
 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;
 }
예제 #5
0
 private void replaceBrick(GlusterBrickEntity brick, Guid newServerId, String newBrickDir) {
   brick.setId(Guid.newGuid());
   brick.setServerId(newServerId);
   brick.setBrickDirectory(newBrickDir);
   addedBrickIds.add(brick.getId());
 }