All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.solidfire.element.api.VolumeStats Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2014-2016 NetApp, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
 */
package com.solidfire.element.api;

import com.solidfire.gson.Gson;
import com.solidfire.core.client.Attributes;
import com.solidfire.gson.annotations.SerializedName;
import com.solidfire.core.annotation.Since;
import com.solidfire.core.javautil.Optional;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;

/**
 * VolumeStats  
 * Contains statistical data for an individual volume.
 **/

public class VolumeStats implements Serializable {

    public static final long serialVersionUID = -3367989483107432160L;
    @SerializedName("accountID") private Long accountID;
    @SerializedName("actualIOPS") private Optional actualIOPS;
    @SerializedName("averageIOPSize") private Optional averageIOPSize;
    @SerializedName("burstIOPSCredit") private Optional burstIOPSCredit;
    @SerializedName("clientQueueDepth") private Optional clientQueueDepth;
    @SerializedName("latencyUSec") private Optional latencyUSec;
    @SerializedName("asyncDelay") private Optional asyncDelay;
    @SerializedName("metadataHosts") private Optional metadataHosts;
    @SerializedName("desiredMetadataHosts") private Optional desiredMetadataHosts;
    @SerializedName("nonZeroBlocks") private Long nonZeroBlocks;
    @SerializedName("readBytes") private Long readBytes;
    @SerializedName("readLatencyUSec") private Optional readLatencyUSec;
    @SerializedName("readOps") private Long readOps;
    @SerializedName("throttle") private Optional throttle;
    @SerializedName("timestamp") private String timestamp;
    @SerializedName("totalLatencyUSec") private Optional totalLatencyUSec;
    @SerializedName("unalignedReads") private Long unalignedReads;
    @SerializedName("unalignedWrites") private Long unalignedWrites;
    @SerializedName("volumeAccessGroups") private Long[] volumeAccessGroups;
    @SerializedName("volumeID") private Long volumeID;
    @SerializedName("volumeSize") private Long volumeSize;
    @SerializedName("volumeUtilization") private Optional volumeUtilization;
    @SerializedName("writeBytes") private Long writeBytes;
    @SerializedName("writeLatencyUSec") private Optional writeLatencyUSec;
    @SerializedName("writeOps") private Long writeOps;
    @SerializedName("zeroBlocks") private Long zeroBlocks;
    @SerializedName("writeBytesLastSample") private Optional writeBytesLastSample;
    @SerializedName("samplePeriodMSec") private Optional samplePeriodMSec;
    @SerializedName("readBytesLastSample") private Optional readBytesLastSample;
    @SerializedName("readOpsLastSample") private Optional readOpsLastSample;
    @SerializedName("writeOpsLastSample") private Optional writeOpsLastSample;
    // empty constructor
    @Since("7.0")
    public VolumeStats() {}

    
    // parameterized constructor
    @Since("7.0")
    public VolumeStats(
        Long accountID,
        Optional actualIOPS,
        Optional averageIOPSize,
        Optional burstIOPSCredit,
        Optional clientQueueDepth,
        Optional latencyUSec,
        Optional asyncDelay,
        Optional metadataHosts,
        Optional desiredMetadataHosts,
        Long nonZeroBlocks,
        Long readBytes,
        Optional readLatencyUSec,
        Long readOps,
        Optional throttle,
        String timestamp,
        Optional totalLatencyUSec,
        Long unalignedReads,
        Long unalignedWrites,
        Long[] volumeAccessGroups,
        Long volumeID,
        Long volumeSize,
        Optional volumeUtilization,
        Long writeBytes,
        Optional writeLatencyUSec,
        Long writeOps,
        Long zeroBlocks,
        Optional writeBytesLastSample,
        Optional samplePeriodMSec,
        Optional readBytesLastSample,
        Optional readOpsLastSample,
        Optional writeOpsLastSample
    )
    {
        this.accountID = accountID;
        this.actualIOPS = (actualIOPS == null) ? Optional.empty() : actualIOPS;
        this.averageIOPSize = (averageIOPSize == null) ? Optional.empty() : averageIOPSize;
        this.burstIOPSCredit = (burstIOPSCredit == null) ? Optional.empty() : burstIOPSCredit;
        this.clientQueueDepth = (clientQueueDepth == null) ? Optional.empty() : clientQueueDepth;
        this.latencyUSec = (latencyUSec == null) ? Optional.empty() : latencyUSec;
        this.asyncDelay = (asyncDelay == null) ? Optional.empty() : asyncDelay;
        this.metadataHosts = (metadataHosts == null) ? Optional.empty() : metadataHosts;
        this.desiredMetadataHosts = (desiredMetadataHosts == null) ? Optional.empty() : desiredMetadataHosts;
        this.nonZeroBlocks = nonZeroBlocks;
        this.readBytes = readBytes;
        this.readLatencyUSec = (readLatencyUSec == null) ? Optional.empty() : readLatencyUSec;
        this.readOps = readOps;
        this.throttle = (throttle == null) ? Optional.empty() : throttle;
        this.timestamp = timestamp;
        this.totalLatencyUSec = (totalLatencyUSec == null) ? Optional.empty() : totalLatencyUSec;
        this.unalignedReads = unalignedReads;
        this.unalignedWrites = unalignedWrites;
        this.volumeAccessGroups = volumeAccessGroups;
        this.volumeID = volumeID;
        this.volumeSize = volumeSize;
        this.volumeUtilization = (volumeUtilization == null) ? Optional.empty() : volumeUtilization;
        this.writeBytes = writeBytes;
        this.writeLatencyUSec = (writeLatencyUSec == null) ? Optional.empty() : writeLatencyUSec;
        this.writeOps = writeOps;
        this.zeroBlocks = zeroBlocks;
        this.writeBytesLastSample = (writeBytesLastSample == null) ? Optional.empty() : writeBytesLastSample;
        this.samplePeriodMSec = (samplePeriodMSec == null) ? Optional.empty() : samplePeriodMSec;
        this.readBytesLastSample = (readBytesLastSample == null) ? Optional.empty() : readBytesLastSample;
        this.readOpsLastSample = (readOpsLastSample == null) ? Optional.empty() : readOpsLastSample;
        this.writeOpsLastSample = (writeOpsLastSample == null) ? Optional.empty() : writeOpsLastSample;
    }

    /** 
     * AccountID of the volume owner.
     **/
    public Long getAccountID() { return this.accountID; }
   
    public void setAccountID(Long accountID) { 
        this.accountID = accountID;
    }
    /** 
     * Current actual IOPS to the volume in the last 500 milliseconds.
     **/
    public Optional getActualIOPS() { return this.actualIOPS; }
   
    public void setActualIOPS(Optional actualIOPS) { 
        this.actualIOPS = (actualIOPS == null) ? Optional.empty() : actualIOPS;
    }
    /** 
     * Average size in bytes of recent I/O to the volume in the last 500 milliseconds.
     **/
    public Optional getAverageIOPSize() { return this.averageIOPSize; }
   
    public void setAverageIOPSize(Optional averageIOPSize) { 
        this.averageIOPSize = (averageIOPSize == null) ? Optional.empty() : averageIOPSize;
    }
    /** 
     * The total number of IOP credits available to the user.
     * When users are not using up to the max IOPS, credits are accrued.
     **/
    public Optional getBurstIOPSCredit() { return this.burstIOPSCredit; }
   
    public void setBurstIOPSCredit(Optional burstIOPSCredit) { 
        this.burstIOPSCredit = (burstIOPSCredit == null) ? Optional.empty() : burstIOPSCredit;
    }
    /** 
     * The number of outstanding read and write operations to the cluster.
     **/
    public Optional getClientQueueDepth() { return this.clientQueueDepth; }
   
    public void setClientQueueDepth(Optional clientQueueDepth) { 
        this.clientQueueDepth = (clientQueueDepth == null) ? Optional.empty() : clientQueueDepth;
    }
    /** 
     * The observed latency time, in microseconds, to complete operations to a volume.
     * A "0" (zero) value means there is no I/O to the volume.
     **/
    public Optional getLatencyUSec() { return this.latencyUSec; }
   
    public void setLatencyUSec(Optional latencyUSec) { 
        this.latencyUSec = (latencyUSec == null) ? Optional.empty() : latencyUSec;
    }
    /** 
     **/
    public Optional getAsyncDelay() { return this.asyncDelay; }
   
    public void setAsyncDelay(Optional asyncDelay) { 
        this.asyncDelay = (asyncDelay == null) ? Optional.empty() : asyncDelay;
    }
    /** 
     * The volume services on which the volume metadata resides.
     **/
    public Optional getMetadataHosts() { return this.metadataHosts; }
   
    public void setMetadataHosts(Optional metadataHosts) { 
        this.metadataHosts = (metadataHosts == null) ? Optional.empty() : metadataHosts;
    }
    /** 
     **/
    public Optional getDesiredMetadataHosts() { return this.desiredMetadataHosts; }
   
    public void setDesiredMetadataHosts(Optional desiredMetadataHosts) { 
        this.desiredMetadataHosts = (desiredMetadataHosts == null) ? Optional.empty() : desiredMetadataHosts;
    }
    /** 
     * The number of 4KiB blocks with data after the last garbage collection operation has completed.
     **/
    public Long getNonZeroBlocks() { return this.nonZeroBlocks; }
   
    public void setNonZeroBlocks(Long nonZeroBlocks) { 
        this.nonZeroBlocks = nonZeroBlocks;
    }
    /** 
     * Total bytes read by clients.
     **/
    public Long getReadBytes() { return this.readBytes; }
   
    public void setReadBytes(Long readBytes) { 
        this.readBytes = readBytes;
    }
    /** 
     * The average time, in microseconds, to complete read operations.
     **/
    public Optional getReadLatencyUSec() { return this.readLatencyUSec; }
   
    public void setReadLatencyUSec(Optional readLatencyUSec) { 
        this.readLatencyUSec = (readLatencyUSec == null) ? Optional.empty() : readLatencyUSec;
    }
    /** 
     * Total read operations.
     **/
    public Long getReadOps() { return this.readOps; }
   
    public void setReadOps(Long readOps) { 
        this.readOps = readOps;
    }
    /** 
     * A floating value between 0 and 1 that represents how much the system is throttling clients
     * below their max IOPS because of re-replication of data, transient errors and snapshots taken.
     **/
    public Optional getThrottle() { return this.throttle; }
   
    public void setThrottle(Optional throttle) { 
        this.throttle = (throttle == null) ? Optional.empty() : throttle;
    }
    /** 
     * The current time in UTC.
     **/
    public String getTimestamp() { return this.timestamp; }
   
    public void setTimestamp(String timestamp) { 
        this.timestamp = timestamp;
    }
    /** 
     * The average time, in microseconds, to complete read and write operations to a volume.
     **/
    public Optional getTotalLatencyUSec() { return this.totalLatencyUSec; }
   
    public void setTotalLatencyUSec(Optional totalLatencyUSec) { 
        this.totalLatencyUSec = (totalLatencyUSec == null) ? Optional.empty() : totalLatencyUSec;
    }
    /** 
     * For 512e volumes, the number of read operations that were not on a 4k sector boundary.
     * High numbers of unaligned reads may indicate improper partition alignment.
     **/
    public Long getUnalignedReads() { return this.unalignedReads; }
   
    public void setUnalignedReads(Long unalignedReads) { 
        this.unalignedReads = unalignedReads;
    }
    /** 
     * For 512e volumes, the number of write operations that were not on a 4k sector boundary.
     * High numbers of unaligned writes may indicate improper partition alignment.
     **/
    public Long getUnalignedWrites() { return this.unalignedWrites; }
   
    public void setUnalignedWrites(Long unalignedWrites) { 
        this.unalignedWrites = unalignedWrites;
    }
    /** 
     * List of volume access group(s) to which a volume beintegers.
     **/
    public Long[] getVolumeAccessGroups() { return this.volumeAccessGroups; }
   
    public void setVolumeAccessGroups(Long[] volumeAccessGroups) { 
        this.volumeAccessGroups = volumeAccessGroups;
    }
    /** 
     * Volume ID of the volume.
     **/
    public Long getVolumeID() { return this.volumeID; }
   
    public void setVolumeID(Long volumeID) { 
        this.volumeID = volumeID;
    }
    /** 
     * Total provisioned capacity in bytes.
     **/
    public Long getVolumeSize() { return this.volumeSize; }
   
    public void setVolumeSize(Long volumeSize) { 
        this.volumeSize = volumeSize;
    }
    /** 
     * A floating value that describes how much the client is using the volume.
     * 
     * Values:
     *  0 = Client is not using the volume
     * 1 = Client is using their max
     * >1 = Client is using their burst
     **/
    public Optional getVolumeUtilization() { return this.volumeUtilization; }
   
    public void setVolumeUtilization(Optional volumeUtilization) { 
        this.volumeUtilization = (volumeUtilization == null) ? Optional.empty() : volumeUtilization;
    }
    /** 
     * Total bytes written by clients.
     **/
    public Long getWriteBytes() { return this.writeBytes; }
   
    public void setWriteBytes(Long writeBytes) { 
        this.writeBytes = writeBytes;
    }
    /** 
     * The average time, in microseconds, to complete write operations.
     **/
    public Optional getWriteLatencyUSec() { return this.writeLatencyUSec; }
   
    public void setWriteLatencyUSec(Optional writeLatencyUSec) { 
        this.writeLatencyUSec = (writeLatencyUSec == null) ? Optional.empty() : writeLatencyUSec;
    }
    /** 
     * Total write operations occurring on the volume.
     **/
    public Long getWriteOps() { return this.writeOps; }
   
    public void setWriteOps(Long writeOps) { 
        this.writeOps = writeOps;
    }
    /** 
     * Total number of 4KiB blocks without data after the last round of garbage collection operation has completed.
     **/
    public Long getZeroBlocks() { return this.zeroBlocks; }
   
    public void setZeroBlocks(Long zeroBlocks) { 
        this.zeroBlocks = zeroBlocks;
    }
    /** 
     * The total number of bytes written to the volume during the last sample period.
     **/
    public Optional getWriteBytesLastSample() { return this.writeBytesLastSample; }
   
    public void setWriteBytesLastSample(Optional writeBytesLastSample) { 
        this.writeBytesLastSample = (writeBytesLastSample == null) ? Optional.empty() : writeBytesLastSample;
    }
    /** 
     * The length of the sample period in milliseconds.
     **/
    public Optional getSamplePeriodMSec() { return this.samplePeriodMSec; }
   
    public void setSamplePeriodMSec(Optional samplePeriodMSec) { 
        this.samplePeriodMSec = (samplePeriodMSec == null) ? Optional.empty() : samplePeriodMSec;
    }
    /** 
     * The total number of bytes read from the volume during the last sample period.
     **/
    public Optional getReadBytesLastSample() { return this.readBytesLastSample; }
   
    public void setReadBytesLastSample(Optional readBytesLastSample) { 
        this.readBytesLastSample = (readBytesLastSample == null) ? Optional.empty() : readBytesLastSample;
    }
    /** 
     * The total number of read operations durin gth elast sample period.
     **/
    public Optional getReadOpsLastSample() { return this.readOpsLastSample; }
   
    public void setReadOpsLastSample(Optional readOpsLastSample) { 
        this.readOpsLastSample = (readOpsLastSample == null) ? Optional.empty() : readOpsLastSample;
    }
    /** 
     * The total number of write operations during the last sample period.
     **/
    public Optional getWriteOpsLastSample() { return this.writeOpsLastSample; }
   
    public void setWriteOpsLastSample(Optional writeOpsLastSample) { 
        this.writeOpsLastSample = (writeOpsLastSample == null) ? Optional.empty() : writeOpsLastSample;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VolumeStats that = (VolumeStats) o;

        return 
            Objects.equals(accountID, that.accountID) && 
            Objects.equals(actualIOPS, that.actualIOPS) && 
            Objects.equals(averageIOPSize, that.averageIOPSize) && 
            Objects.equals(burstIOPSCredit, that.burstIOPSCredit) && 
            Objects.equals(clientQueueDepth, that.clientQueueDepth) && 
            Objects.equals(latencyUSec, that.latencyUSec) && 
            Objects.equals(asyncDelay, that.asyncDelay) && 
            Objects.equals(metadataHosts, that.metadataHosts) && 
            Objects.equals(desiredMetadataHosts, that.desiredMetadataHosts) && 
            Objects.equals(nonZeroBlocks, that.nonZeroBlocks) && 
            Objects.equals(readBytes, that.readBytes) && 
            Objects.equals(readLatencyUSec, that.readLatencyUSec) && 
            Objects.equals(readOps, that.readOps) && 
            Objects.equals(throttle, that.throttle) && 
            Objects.equals(timestamp, that.timestamp) && 
            Objects.equals(totalLatencyUSec, that.totalLatencyUSec) && 
            Objects.equals(unalignedReads, that.unalignedReads) && 
            Objects.equals(unalignedWrites, that.unalignedWrites) && 
            Arrays.equals(volumeAccessGroups, that.volumeAccessGroups) && 
            Objects.equals(volumeID, that.volumeID) && 
            Objects.equals(volumeSize, that.volumeSize) && 
            Objects.equals(volumeUtilization, that.volumeUtilization) && 
            Objects.equals(writeBytes, that.writeBytes) && 
            Objects.equals(writeLatencyUSec, that.writeLatencyUSec) && 
            Objects.equals(writeOps, that.writeOps) && 
            Objects.equals(zeroBlocks, that.zeroBlocks) && 
            Objects.equals(writeBytesLastSample, that.writeBytesLastSample) && 
            Objects.equals(samplePeriodMSec, that.samplePeriodMSec) && 
            Objects.equals(readBytesLastSample, that.readBytesLastSample) && 
            Objects.equals(readOpsLastSample, that.readOpsLastSample) && 
            Objects.equals(writeOpsLastSample, that.writeOpsLastSample);
    }

    @Override
    public int hashCode() {
        return Objects.hash( accountID,actualIOPS,averageIOPSize,burstIOPSCredit,clientQueueDepth,latencyUSec,asyncDelay,metadataHosts,desiredMetadataHosts,nonZeroBlocks,readBytes,readLatencyUSec,readOps,throttle,timestamp,totalLatencyUSec,unalignedReads,unalignedWrites,(Object[])volumeAccessGroups,volumeID,volumeSize,volumeUtilization,writeBytes,writeLatencyUSec,writeOps,zeroBlocks,writeBytesLastSample,samplePeriodMSec,readBytesLastSample,readOpsLastSample,writeOpsLastSample );
    }


    public java.util.Map toMap() {
        java.util.Map map = new HashMap<>();
        map.put("accountID", accountID);
        map.put("actualIOPS", actualIOPS);
        map.put("averageIOPSize", averageIOPSize);
        map.put("burstIOPSCredit", burstIOPSCredit);
        map.put("clientQueueDepth", clientQueueDepth);
        map.put("latencyUSec", latencyUSec);
        map.put("asyncDelay", asyncDelay);
        map.put("metadataHosts", metadataHosts);
        map.put("desiredMetadataHosts", desiredMetadataHosts);
        map.put("nonZeroBlocks", nonZeroBlocks);
        map.put("readBytes", readBytes);
        map.put("readLatencyUSec", readLatencyUSec);
        map.put("readOps", readOps);
        map.put("throttle", throttle);
        map.put("timestamp", timestamp);
        map.put("totalLatencyUSec", totalLatencyUSec);
        map.put("unalignedReads", unalignedReads);
        map.put("unalignedWrites", unalignedWrites);
        map.put("volumeAccessGroups", volumeAccessGroups);
        map.put("volumeID", volumeID);
        map.put("volumeSize", volumeSize);
        map.put("volumeUtilization", volumeUtilization);
        map.put("writeBytes", writeBytes);
        map.put("writeLatencyUSec", writeLatencyUSec);
        map.put("writeOps", writeOps);
        map.put("zeroBlocks", zeroBlocks);
        map.put("writeBytesLastSample", writeBytesLastSample);
        map.put("samplePeriodMSec", samplePeriodMSec);
        map.put("readBytesLastSample", readBytesLastSample);
        map.put("readOpsLastSample", readOpsLastSample);
        map.put("writeOpsLastSample", writeOpsLastSample);
        return map;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        Gson gson = new Gson();
        sb.append( "{ " );

        sb.append(" accountID : ").append(gson.toJson(accountID)).append(",");
        if(null != actualIOPS && actualIOPS.isPresent()){
            sb.append(" actualIOPS : ").append(gson.toJson(actualIOPS)).append(",");
        }
        else{
            sb.append(" actualIOPS : ").append("null").append(",");
        }
        if(null != averageIOPSize && averageIOPSize.isPresent()){
            sb.append(" averageIOPSize : ").append(gson.toJson(averageIOPSize)).append(",");
        }
        else{
            sb.append(" averageIOPSize : ").append("null").append(",");
        }
        if(null != burstIOPSCredit && burstIOPSCredit.isPresent()){
            sb.append(" burstIOPSCredit : ").append(gson.toJson(burstIOPSCredit)).append(",");
        }
        else{
            sb.append(" burstIOPSCredit : ").append("null").append(",");
        }
        if(null != clientQueueDepth && clientQueueDepth.isPresent()){
            sb.append(" clientQueueDepth : ").append(gson.toJson(clientQueueDepth)).append(",");
        }
        else{
            sb.append(" clientQueueDepth : ").append("null").append(",");
        }
        if(null != latencyUSec && latencyUSec.isPresent()){
            sb.append(" latencyUSec : ").append(gson.toJson(latencyUSec)).append(",");
        }
        else{
            sb.append(" latencyUSec : ").append("null").append(",");
        }
        if(null != asyncDelay && asyncDelay.isPresent()){
            sb.append(" asyncDelay : ").append(gson.toJson(asyncDelay)).append(",");
        }
        else{
            sb.append(" asyncDelay : ").append("null").append(",");
        }
        if(null != metadataHosts && metadataHosts.isPresent()){
            sb.append(" metadataHosts : ").append(gson.toJson(metadataHosts)).append(",");
        }
        else{
            sb.append(" metadataHosts : ").append("null").append(",");
        }
        if(null != desiredMetadataHosts && desiredMetadataHosts.isPresent()){
            sb.append(" desiredMetadataHosts : ").append(gson.toJson(desiredMetadataHosts)).append(",");
        }
        else{
            sb.append(" desiredMetadataHosts : ").append("null").append(",");
        }
        sb.append(" nonZeroBlocks : ").append(gson.toJson(nonZeroBlocks)).append(",");
        sb.append(" readBytes : ").append(gson.toJson(readBytes)).append(",");
        if(null != readLatencyUSec && readLatencyUSec.isPresent()){
            sb.append(" readLatencyUSec : ").append(gson.toJson(readLatencyUSec)).append(",");
        }
        else{
            sb.append(" readLatencyUSec : ").append("null").append(",");
        }
        sb.append(" readOps : ").append(gson.toJson(readOps)).append(",");
        if(null != throttle && throttle.isPresent()){
            sb.append(" throttle : ").append(gson.toJson(throttle)).append(",");
        }
        else{
            sb.append(" throttle : ").append("null").append(",");
        }
        sb.append(" timestamp : ").append(gson.toJson(timestamp)).append(",");
        if(null != totalLatencyUSec && totalLatencyUSec.isPresent()){
            sb.append(" totalLatencyUSec : ").append(gson.toJson(totalLatencyUSec)).append(",");
        }
        else{
            sb.append(" totalLatencyUSec : ").append("null").append(",");
        }
        sb.append(" unalignedReads : ").append(gson.toJson(unalignedReads)).append(",");
        sb.append(" unalignedWrites : ").append(gson.toJson(unalignedWrites)).append(",");
        sb.append(" volumeAccessGroups : ").append(gson.toJson(Arrays.toString(volumeAccessGroups))).append(",");
        sb.append(" volumeID : ").append(gson.toJson(volumeID)).append(",");
        sb.append(" volumeSize : ").append(gson.toJson(volumeSize)).append(",");
        if(null != volumeUtilization && volumeUtilization.isPresent()){
            sb.append(" volumeUtilization : ").append(gson.toJson(volumeUtilization)).append(",");
        }
        else{
            sb.append(" volumeUtilization : ").append("null").append(",");
        }
        sb.append(" writeBytes : ").append(gson.toJson(writeBytes)).append(",");
        if(null != writeLatencyUSec && writeLatencyUSec.isPresent()){
            sb.append(" writeLatencyUSec : ").append(gson.toJson(writeLatencyUSec)).append(",");
        }
        else{
            sb.append(" writeLatencyUSec : ").append("null").append(",");
        }
        sb.append(" writeOps : ").append(gson.toJson(writeOps)).append(",");
        sb.append(" zeroBlocks : ").append(gson.toJson(zeroBlocks)).append(",");
        if(null != writeBytesLastSample && writeBytesLastSample.isPresent()){
            sb.append(" writeBytesLastSample : ").append(gson.toJson(writeBytesLastSample)).append(",");
        }
        else{
            sb.append(" writeBytesLastSample : ").append("null").append(",");
        }
        if(null != samplePeriodMSec && samplePeriodMSec.isPresent()){
            sb.append(" samplePeriodMSec : ").append(gson.toJson(samplePeriodMSec)).append(",");
        }
        else{
            sb.append(" samplePeriodMSec : ").append("null").append(",");
        }
        if(null != readBytesLastSample && readBytesLastSample.isPresent()){
            sb.append(" readBytesLastSample : ").append(gson.toJson(readBytesLastSample)).append(",");
        }
        else{
            sb.append(" readBytesLastSample : ").append("null").append(",");
        }
        if(null != readOpsLastSample && readOpsLastSample.isPresent()){
            sb.append(" readOpsLastSample : ").append(gson.toJson(readOpsLastSample)).append(",");
        }
        else{
            sb.append(" readOpsLastSample : ").append("null").append(",");
        }
        if(null != writeOpsLastSample && writeOpsLastSample.isPresent()){
            sb.append(" writeOpsLastSample : ").append(gson.toJson(writeOpsLastSample)).append(",");
        }
        else{
            sb.append(" writeOpsLastSample : ").append("null").append(",");
        }
        sb.append( " }" );

        if(sb.lastIndexOf(", }") != -1)
            sb.deleteCharAt(sb.lastIndexOf(", }"));

        return sb.toString();
    }

    public static Builder builder() {
        return new Builder();
    }

    public final Builder asBuilder() {
        return new Builder().buildFrom(this);
    }

    public static class Builder {
        private Long accountID;
        private Optional actualIOPS;
        private Optional averageIOPSize;
        private Optional burstIOPSCredit;
        private Optional clientQueueDepth;
        private Optional latencyUSec;
        private Optional asyncDelay;
        private Optional metadataHosts;
        private Optional desiredMetadataHosts;
        private Long nonZeroBlocks;
        private Long readBytes;
        private Optional readLatencyUSec;
        private Long readOps;
        private Optional throttle;
        private String timestamp;
        private Optional totalLatencyUSec;
        private Long unalignedReads;
        private Long unalignedWrites;
        private Long[] volumeAccessGroups;
        private Long volumeID;
        private Long volumeSize;
        private Optional volumeUtilization;
        private Long writeBytes;
        private Optional writeLatencyUSec;
        private Long writeOps;
        private Long zeroBlocks;
        private Optional writeBytesLastSample;
        private Optional samplePeriodMSec;
        private Optional readBytesLastSample;
        private Optional readOpsLastSample;
        private Optional writeOpsLastSample;

        private Builder() { }

        public VolumeStats build() {
            return new VolumeStats (
                         this.accountID,
                         this.actualIOPS,
                         this.averageIOPSize,
                         this.burstIOPSCredit,
                         this.clientQueueDepth,
                         this.latencyUSec,
                         this.asyncDelay,
                         this.metadataHosts,
                         this.desiredMetadataHosts,
                         this.nonZeroBlocks,
                         this.readBytes,
                         this.readLatencyUSec,
                         this.readOps,
                         this.throttle,
                         this.timestamp,
                         this.totalLatencyUSec,
                         this.unalignedReads,
                         this.unalignedWrites,
                         this.volumeAccessGroups,
                         this.volumeID,
                         this.volumeSize,
                         this.volumeUtilization,
                         this.writeBytes,
                         this.writeLatencyUSec,
                         this.writeOps,
                         this.zeroBlocks,
                         this.writeBytesLastSample,
                         this.samplePeriodMSec,
                         this.readBytesLastSample,
                         this.readOpsLastSample,
                         this.writeOpsLastSample);
        }

        private VolumeStats.Builder buildFrom(final VolumeStats req) {
            this.accountID = req.accountID;
            this.actualIOPS = req.actualIOPS;
            this.averageIOPSize = req.averageIOPSize;
            this.burstIOPSCredit = req.burstIOPSCredit;
            this.clientQueueDepth = req.clientQueueDepth;
            this.latencyUSec = req.latencyUSec;
            this.asyncDelay = req.asyncDelay;
            this.metadataHosts = req.metadataHosts;
            this.desiredMetadataHosts = req.desiredMetadataHosts;
            this.nonZeroBlocks = req.nonZeroBlocks;
            this.readBytes = req.readBytes;
            this.readLatencyUSec = req.readLatencyUSec;
            this.readOps = req.readOps;
            this.throttle = req.throttle;
            this.timestamp = req.timestamp;
            this.totalLatencyUSec = req.totalLatencyUSec;
            this.unalignedReads = req.unalignedReads;
            this.unalignedWrites = req.unalignedWrites;
            this.volumeAccessGroups = req.volumeAccessGroups;
            this.volumeID = req.volumeID;
            this.volumeSize = req.volumeSize;
            this.volumeUtilization = req.volumeUtilization;
            this.writeBytes = req.writeBytes;
            this.writeLatencyUSec = req.writeLatencyUSec;
            this.writeOps = req.writeOps;
            this.zeroBlocks = req.zeroBlocks;
            this.writeBytesLastSample = req.writeBytesLastSample;
            this.samplePeriodMSec = req.samplePeriodMSec;
            this.readBytesLastSample = req.readBytesLastSample;
            this.readOpsLastSample = req.readOpsLastSample;
            this.writeOpsLastSample = req.writeOpsLastSample;

            return this;
        }

        public VolumeStats.Builder accountID(final Long accountID) {
            this.accountID = accountID;
            return this;
        }

        public VolumeStats.Builder optionalActualIOPS(final Long actualIOPS) {
            this.actualIOPS = (actualIOPS == null) ? Optional.empty() : Optional.of(actualIOPS);
            return this;
        }

        public VolumeStats.Builder optionalAverageIOPSize(final Long averageIOPSize) {
            this.averageIOPSize = (averageIOPSize == null) ? Optional.empty() : Optional.of(averageIOPSize);
            return this;
        }

        public VolumeStats.Builder optionalBurstIOPSCredit(final Long burstIOPSCredit) {
            this.burstIOPSCredit = (burstIOPSCredit == null) ? Optional.empty() : Optional.of(burstIOPSCredit);
            return this;
        }

        public VolumeStats.Builder optionalClientQueueDepth(final Long clientQueueDepth) {
            this.clientQueueDepth = (clientQueueDepth == null) ? Optional.empty() : Optional.of(clientQueueDepth);
            return this;
        }

        public VolumeStats.Builder optionalLatencyUSec(final Long latencyUSec) {
            this.latencyUSec = (latencyUSec == null) ? Optional.empty() : Optional.of(latencyUSec);
            return this;
        }

        public VolumeStats.Builder optionalAsyncDelay(final Long asyncDelay) {
            this.asyncDelay = (asyncDelay == null) ? Optional.empty() : Optional.of(asyncDelay);
            return this;
        }

        public VolumeStats.Builder optionalMetadataHosts(final MetadataHosts metadataHosts) {
            this.metadataHosts = (metadataHosts == null) ? Optional.empty() : Optional.of(metadataHosts);
            return this;
        }

        public VolumeStats.Builder optionalDesiredMetadataHosts(final MetadataHosts desiredMetadataHosts) {
            this.desiredMetadataHosts = (desiredMetadataHosts == null) ? Optional.empty() : Optional.of(desiredMetadataHosts);
            return this;
        }

        public VolumeStats.Builder nonZeroBlocks(final Long nonZeroBlocks) {
            this.nonZeroBlocks = nonZeroBlocks;
            return this;
        }

        public VolumeStats.Builder readBytes(final Long readBytes) {
            this.readBytes = readBytes;
            return this;
        }

        public VolumeStats.Builder optionalReadLatencyUSec(final Long readLatencyUSec) {
            this.readLatencyUSec = (readLatencyUSec == null) ? Optional.empty() : Optional.of(readLatencyUSec);
            return this;
        }

        public VolumeStats.Builder readOps(final Long readOps) {
            this.readOps = readOps;
            return this;
        }

        public VolumeStats.Builder optionalThrottle(final Double throttle) {
            this.throttle = (throttle == null) ? Optional.empty() : Optional.of(throttle);
            return this;
        }

        public VolumeStats.Builder timestamp(final String timestamp) {
            this.timestamp = timestamp;
            return this;
        }

        public VolumeStats.Builder optionalTotalLatencyUSec(final Long totalLatencyUSec) {
            this.totalLatencyUSec = (totalLatencyUSec == null) ? Optional.empty() : Optional.of(totalLatencyUSec);
            return this;
        }

        public VolumeStats.Builder unalignedReads(final Long unalignedReads) {
            this.unalignedReads = unalignedReads;
            return this;
        }

        public VolumeStats.Builder unalignedWrites(final Long unalignedWrites) {
            this.unalignedWrites = unalignedWrites;
            return this;
        }

        public VolumeStats.Builder volumeAccessGroups(final Long[] volumeAccessGroups) {
            this.volumeAccessGroups = volumeAccessGroups;
            return this;
        }

        public VolumeStats.Builder volumeID(final Long volumeID) {
            this.volumeID = volumeID;
            return this;
        }

        public VolumeStats.Builder volumeSize(final Long volumeSize) {
            this.volumeSize = volumeSize;
            return this;
        }

        public VolumeStats.Builder optionalVolumeUtilization(final Double volumeUtilization) {
            this.volumeUtilization = (volumeUtilization == null) ? Optional.empty() : Optional.of(volumeUtilization);
            return this;
        }

        public VolumeStats.Builder writeBytes(final Long writeBytes) {
            this.writeBytes = writeBytes;
            return this;
        }

        public VolumeStats.Builder optionalWriteLatencyUSec(final Long writeLatencyUSec) {
            this.writeLatencyUSec = (writeLatencyUSec == null) ? Optional.empty() : Optional.of(writeLatencyUSec);
            return this;
        }

        public VolumeStats.Builder writeOps(final Long writeOps) {
            this.writeOps = writeOps;
            return this;
        }

        public VolumeStats.Builder zeroBlocks(final Long zeroBlocks) {
            this.zeroBlocks = zeroBlocks;
            return this;
        }

        public VolumeStats.Builder optionalWriteBytesLastSample(final Long writeBytesLastSample) {
            this.writeBytesLastSample = (writeBytesLastSample == null) ? Optional.empty() : Optional.of(writeBytesLastSample);
            return this;
        }

        public VolumeStats.Builder optionalSamplePeriodMSec(final Long samplePeriodMSec) {
            this.samplePeriodMSec = (samplePeriodMSec == null) ? Optional.empty() : Optional.of(samplePeriodMSec);
            return this;
        }

        public VolumeStats.Builder optionalReadBytesLastSample(final Long readBytesLastSample) {
            this.readBytesLastSample = (readBytesLastSample == null) ? Optional.empty() : Optional.of(readBytesLastSample);
            return this;
        }

        public VolumeStats.Builder optionalReadOpsLastSample(final Long readOpsLastSample) {
            this.readOpsLastSample = (readOpsLastSample == null) ? Optional.empty() : Optional.of(readOpsLastSample);
            return this;
        }

        public VolumeStats.Builder optionalWriteOpsLastSample(final Long writeOpsLastSample) {
            this.writeOpsLastSample = (writeOpsLastSample == null) ? Optional.empty() : Optional.of(writeOpsLastSample);
            return this;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy