@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 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 flush(StorageQos storageQos) { storageQos.setMaxThroughput(null); storageQos.setMaxReadThroughput(null); storageQos.setMaxWriteThroughput(null); if (getThroughput().getChoiceGroupTotal().getEntity() && storageQos.setMaxReadThroughput(Integer.parseInt(getThroughput().getRead().getEntity()));
@Override protected StorageQos generateNewEntity() { StorageQos storageQos = new StorageQos(); storageQos.setId(Guid.newGuid()); storageQos.setName("qos_d"); storageQos.setDescription("bla bla"); storageQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES); storageQos.setMaxThroughput(200); storageQos.setMaxReadThroughput(200); storageQos.setMaxWriteThroughput(200); storageQos.setMaxIops(200); storageQos.setMaxReadIops(200); storageQos.setMaxWriteIops(200); return storageQos; }
private static void mapStorageQosToEntity(Qos model, StorageQos entity) { if (model.isSetMaxThroughput()) { entity.setMaxThroughput(IntegerMapper.mapMinusOneToNull(model.getMaxThroughput())); } if (model.isSetMaxReadThroughput()) { entity.setMaxReadThroughput(IntegerMapper.mapMinusOneToNull(model.getMaxReadThroughput())); } if (model.isSetMaxWriteThroughput()) { entity.setMaxWriteThroughput(IntegerMapper.mapMinusOneToNull(model.getMaxWriteThroughput())); } if (model.isSetMaxIops()) { entity.setMaxIops(IntegerMapper.mapMinusOneToNull(model.getMaxIops())); } if (model.isSetMaxReadIops()) { entity.setMaxReadIops(IntegerMapper.mapMinusOneToNull(model.getMaxReadIops())); } if (model.isSetMaxWriteIops()) { entity.setMaxWriteIops(IntegerMapper.mapMinusOneToNull(model.getMaxWriteIops())); } }