[ https://issues.apache.org/jira/browse/HIVE-26412?focusedWorklogId=793052&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-793052 ]
ASF GitHub Bot logged work on HIVE-26412: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Jul/22 06:56 Start Date: 20/Jul/22 06:56 Worklog Time Spent: 10m Work Description: abstractdog commented on code in PR #3456: URL: https://github.com/apache/hive/pull/3456#discussion_r925239340 ########## ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezAvailableSlotsCalculator.java: ########## @@ -0,0 +1,43 @@ +/* + * 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. + */ + +package org.apache.hadoop.hive.ql.exec.tez; + +import org.apache.hadoop.conf.Configuration; +import org.apache.tez.runtime.api.InputInitializerContext; + +/** + * Default implementation of AvailableSlotsCalculator which relies on available capacity of the cluster + */ +public class TezAvailableSlotsCalculator implements AvailableSlotsCalculator { + @Override + public void initialize(Configuration conf) { + // Noop + } + + @Override + public int getAvailaleSlots(InputInitializerContext inputInitializerContext) { Review Comment: typo: availaleSlots ########## ql/src/java/org/apache/hadoop/hive/ql/exec/tez/AvailableSlotsCalculator.java: ########## @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package org.apache.hadoop.hive.ql.exec.tez; + +import org.apache.hadoop.conf.Configuration; +import org.apache.tez.runtime.api.InputInitializerContext; + +/** + * Interface for fetching available slots during split calculation + */ +public interface AvailableSlotsCalculator { + + void initialize(Configuration conf); + + int getAvailaleSlots(InputInitializerContext inputInitializerContext); Review Comment: @adesh-rao : could you please describe this scenario and a possible implementation class further? jira description implies that you want to get rid of tightly coupled tez input context, but the interface has tez InputInitializerContext in the signature, so I don't think we addressed the original description Issue Time Tracking ------------------- Worklog Id: (was: 793052) Time Spent: 20m (was: 10m) > Create interface to fetch available slots during split calculation > ------------------------------------------------------------------ > > Key: HIVE-26412 > URL: https://issues.apache.org/jira/browse/HIVE-26412 > Project: Hive > Issue Type: Task > Reporter: Adesh Kumar Rao > Assignee: Adesh Kumar Rao > Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > HiveSplitGenerator is tightly coupled with Tez's InputContext to fetch the > available slots during split calculation. Creating a interface to fetch the > available slots will allow having other implementation too which are more > suitable for different cloud vendors. > The idea is to have a default implementation using Tez's InputContext and a > new HiveConfiguration pointing to the class implementing the interface. > Different cloud vendors can plugin there strategy by implementing the > interface. -- This message was sent by Atlassian Jira (v8.20.10#820010)