himanish-star commented on code in PR #16144: URL: https://github.com/apache/pinot/pull/16144#discussion_r2155902105
########## pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerOptions.ts: ########## @@ -174,5 +174,15 @@ export const rebalanceServerOptions: RebalanceServerOption[] = [ "isAdvancedConfig": true, "isStatsGatheringConfig": false, "markWithWarningIcon": false + }, + { + "name": "diskUtilizationThreshold", + "defaultValue": -1.0, + "type": "DOUBLE", + "label": "Disk Utilization Threshold", + "description": "Override disk utilization threshold used in pre-check (0.0 to 1.0, e.g., 0.85 for 85%). If not provided (or -1.0), uses the controller's default threshold", + "isAdvancedConfig": true, Review Comment: We should add the `step`, `maxValue` / `minValue` config here and use from here ########## pinot-controller/src/main/resources/app/components/Homepage/Operations/RebalanceServer/RebalanceServerConfigurationOptions/RebalanceServerConfigurationOptionDouble.tsx: ########## @@ -0,0 +1,66 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +import {Box, FormControl, TextField, Typography} from "@material-ui/core"; +import React, {useState} from "react"; +import {RebalanceServerOption} from "../RebalanceServerOptions"; +import { + RebalanceServerConfigurationOptionLabel +} from "./RebalanceServerConfigurationOptionLabel/RebalanceServerConfigurationOptionLabel"; +import Utils from "../../../../../utils/Utils"; + +type RebalanceServerConfigurationOptionDoubleProps = { + option: RebalanceServerOption; + handleConfigChange: (config: { [key: string]: string | number | boolean }) => void; + rebalanceConfig: { [optionName: string]: string | boolean | number }; +} +export const RebalanceServerConfigurationOptionDouble = ( + { option, handleConfigChange, rebalanceConfig }: RebalanceServerConfigurationOptionDoubleProps +) => { + const [value, setValue] = useState<number>( + Utils.getRebalanceConfigValue(rebalanceConfig, option) as number + ); + return ( + <Box display='flex' flexDirection='column'> + <FormControl fullWidth> + <RebalanceServerConfigurationOptionLabel option={option} /> + <TextField + variant='outlined' + fullWidth + style={{ width: '100%' }} + size='small' + id={`rebalance-server-double-input-${option.name}`} + type='number' + inputProps={{ + step: 0.01, + min: -1, + max: 1 + }} Review Comment: We shouldn't be making this a part of the component and instead passing this from the parent, because there might be future use cases where min and max change and also step -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org