Exemplo n.º 1
0
  private GlusterVolumeAdvancedDetails getVolumeAdvancedDetails(GlusterVolumeEntity volume) {
    GlusterVolumeAdvancedDetails volDetails = new GlusterVolumeAdvancedDetails();
    GlusterVolumeSizeInfo capacityInfo = new GlusterVolumeSizeInfo();
    capacityInfo.setVolumeId(volume.getId());
    capacityInfo.setTotalSize(600000L);
    capacityInfo.setFreeSize(200000L);
    capacityInfo.setUsedSize(400000L);
    volDetails.setCapacityInfo(capacityInfo);

    List<BrickDetails> brickDetailsList = new ArrayList<>();
    for (GlusterBrickEntity brick : volume.getBricks()) {
      BrickDetails brickDetails = new BrickDetails();
      BrickProperties properties = new BrickProperties();
      properties.setBrickId(brick.getId());
      brickDetails.setBrickProperties(properties);
      properties.setStatus(brick.getStatus());
      if (volume == existingReplVol) {
        if (brick.getServerId().equals(SERVER_ID_1)
            && (brick.getBrickDirectory().equals(REPL_BRICK_R1D1)
                || brick.getBrickDirectory().equals(REPL_BRICK_R2D1))) {
          properties.setStatus(GlusterStatus.DOWN);
          bricksWithChangedStatus.add(brick);
        }
      }
      brickDetailsList.add(brickDetails);
    }
    volDetails.setBrickDetails(brickDetailsList);

    return volDetails;
  }
 private List<BrickDetails> getBrickDetails(int size, int clientListSize, int memPoolSize) {
   ArrayList<BrickDetails> list = new ArrayList<>();
   for (int i = 0; i < size; i++) {
     BrickDetails details = new BrickDetails();
     BrickProperties props = new BrickProperties();
     props.setBlockSize(14556);
     props.setPid(88888);
     props.setMntOptions("rw");
     details.setBrickProperties(props);
     details.setClients(getClientList(clientListSize));
     details.setMemoryStatus(getMemoryStatus(memPoolSize));
     list.add(details);
   }
   return list;
 }