@Override protected StorageQos createQosEntity(ResultSet rs) throws SQLException { StorageQos entity = new StorageQos(); entity.setMaxThroughput(getInteger(rs, "max_throughput")); entity.setMaxReadThroughput(getInteger(rs, "max_read_throughput")); entity.setMaxWriteThroughput(getInteger(rs, "max_write_throughput")); entity.setMaxIops(getInteger(rs, "max_iops")); entity.setMaxReadIops(getInteger(rs, "max_read_iops")); entity.setMaxWriteIops(getInteger(rs, "max_write_iops")); return entity; } }
@Override protected CpuQos createQosEntity(ResultSet rs) throws SQLException { CpuQos entity = new CpuQos(); entity.setCpuLimit(getInteger(rs, "cpu_limit")); return entity; } }
@Override public Object getQueryableId() { return getId(); }
@Override protected void updateExistingEntity() { existingEntity.setName("newB"); existingEntity.setDescription("If I owned a company, my employees would love me. They’d have huge pictures of me up the walls and in their home, like Lenin."); existingEntity.setMaxThroughput(30); existingEntity.setMaxReadThroughput(30); existingEntity.setMaxWriteThroughput(30); existingEntity.setMaxIops(30); existingEntity.setMaxReadIops(30); existingEntity.setMaxWriteIops(30); }
@Override public void init(StorageQos qos) { initStorageParameterModel(qos.getMaxThroughput(), qos.getMaxReadThroughput(), qos.getMaxWriteThroughput(), getThroughput()); initStorageParameterModel(qos.getMaxIops(), qos.getMaxReadIops(), qos.getMaxWriteIops(), getIops()); }
@Override protected CpuQos generateNewEntity() { CpuQos cpuQos = new CpuQos(); cpuQos.setId(Guid.newGuid()); cpuQos.setName("qos_d"); cpuQos.setDescription("desc3"); cpuQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES); cpuQos.setCpuLimit(40); return cpuQos; }
private QosBase createNewQosEntityForQosType(QosType qosType) { switch (qosType) { case STORAGE: return new StorageQos(); case CPU: return new CpuQos(); case NETWORK: return new NetworkQoS(); case HOSTNETWORK: return new HostNetworkQos(); default: throw new IllegalArgumentException("Unsupported QoS type \"" + qosType + "\""); } }
@Override protected void updateExistingEntity() { existingEntity.setName("newB"); existingEntity.setDescription("desc2"); existingEntity.setCpuLimit(30); }
public NewCpuQosModel(Model sourceModel, StoragePool dataCenter) { super(new CpuQos(), new CpuQosParametersModel(), sourceModel, dataCenter); }
public NewStorageQosModel(Model sourceModel, StoragePool dataCenter) { super(new StorageQos(), new StorageQosParametersModel(), sourceModel, dataCenter); }
@Override protected MapSqlParameterSource createFullParametersMapper(CpuQos obj) { MapSqlParameterSource map = super.createFullParametersMapper(obj); map.addValue("cpu_limit", obj.getCpuLimit()); return map; }
@Override protected QosParametersBase<StorageQos> getParameters() { QosParametersBase<StorageQos> qosParametersBase = new QosParametersBase<>(); qosParametersBase.setQos(getQos()); qosParametersBase.setQosId(getQos().getId()); return qosParametersBase; }
@Override public int hashCode() { return Objects.hash( super.hashCode(), cpuLimit ); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CpuQos)) { return false; } CpuQos other = (CpuQos) obj; return super.equals(obj) && Objects.equals(cpuLimit, other.cpuLimit); }
private static QosBase createNewQosEntityForQosType(QosType qosType) { switch (qosType) { case STORAGE: return new StorageQos(); case CPU: return new CpuQos(); case NETWORK: return new NetworkQoS(); case HOSTNETWORK: return new HostNetworkQos(); default: throw new IllegalArgumentException("Unsupported QoS type"); } }
private static void mapCpuQosToModel(QosBase entity, Qos model) { CpuQos cpuQos = verifyAndCast(entity, CpuQos.class); if (cpuQos != null) { model.setCpuLimit(cpuQos.getCpuLimit()); } }
@Override public int hashCode() { return Objects.hash( super.hashCode(), inboundAverage, inboundPeak, inboundBurst, outboundAverage, outboundPeak, outboundBurst ); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof HostNetworkQos)) { return false; } if (!super.equals(o)) { return false; } HostNetworkQos that = (HostNetworkQos) o; return Objects.equals(hostNetworkQosProperties, that.hostNetworkQosProperties); }
@Override public int hashCode() { return Objects.hash( super.hashCode(), maxIops, maxReadIops, maxReadThroughput, maxThroughput, maxWriteIops, maxWriteThroughput ); }
@Override public int hashCode() { return Objects.hash(super.hashCode(), hostNetworkQosProperties); } }