GitHub user jackylk opened a pull request:
https://github.com/apache/carbondata/pull/2205 [WIP][CarbonSearch] Support MaxWorkload configuration in search mode scheduler In search mode:1. Add a - [ ] Any interfaces changed? - [ ] Any backward compatibility impacted? - [ ] Document update required? - [ ] Testing done Please provide details on - Whether new unit test cases have been added or why no new tests are required? - How it is tested? Please attach test report. - Is it a performance related change? Please attach the performance test report. - Any additional information to help reviewers in testing this change. - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jackylk/incubator-carbondata search-scheduler Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/2205.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2205 ---- commit 274116c6972bb316ba7f7c017429c567a6a4f87d Author: Jacky Li <jacky.likun@...> Date: 2018-04-22T04:35:10Z support scheduler commit ac34cba6664fc12b02a60fc0171a0fa3e57e92d1 Author: Jacky Li <jacky.likun@...> Date: 2018-04-22T04:37:24Z fix ---- --- |
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4114/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5294/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4120/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5300/ --- |
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183260236 --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java --- @@ -1501,4 +1501,16 @@ public static int getSearchWorkerPort() { return Integer.parseInt(CarbonCommonConstants.CARBON_SEARCH_MODE_WORKER_PORT_DEFAULT); } } + + public static int getMaxWorkloadForWorker(int workerCores) { + int defaultValue = workerCores * 10; + try { + return Integer.parseInt( --- End diff -- validate number >= 0 --- |
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183260157 --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java --- @@ -1671,6 +1673,17 @@ public static final String CARBON_SEARCH_MODE_WORKER_PORT_DEFAULT = "10021"; + /** + * If number of search request sent to Worker exceed this limit, Master will reschedule + * the request to another worker. In such case, locality will be lost in HDFS scenario, but + * it is find for S3 scenario. --- End diff -- 'find' -> fine --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183262230 --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java --- @@ -1501,4 +1501,16 @@ public static int getSearchWorkerPort() { return Integer.parseInt(CarbonCommonConstants.CARBON_SEARCH_MODE_WORKER_PORT_DEFAULT); } } + + public static int getMaxWorkloadForWorker(int workerCores) { + int defaultValue = workerCores * 10; + try { + return Integer.parseInt( --- End diff -- fixed --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183262237 --- Diff: core/src/main/java/org/apache/carbondata/core/constants/CarbonCommonConstants.java --- @@ -1671,6 +1673,17 @@ public static final String CARBON_SEARCH_MODE_WORKER_PORT_DEFAULT = "10021"; + /** + * If number of search request sent to Worker exceed this limit, Master will reschedule + * the request to another worker. In such case, locality will be lost in HDFS scenario, but + * it is find for S3 scenario. --- End diff -- fixed --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4131/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5311/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/2205 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4134/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5314/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/2205 retest this please --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183320582 --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Scheduler.scala --- @@ -0,0 +1,116 @@ +/* + * 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.spark.rpc + +import java.io.IOException +import java.util.concurrent.atomic.AtomicInteger + +import scala.collection.mutable +import scala.concurrent.Future +import scala.reflect.ClassTag +import scala.util.Random + +import org.apache.carbondata.core.util.CarbonProperties + +/** + * [[org.apache.spark.rpc.Master]] uses Scheduler to pick a Worker to send request + */ +private[rpc] class Scheduler { + private val workers = mutable.Map[String, Schedulable]() + private val random = new Random() + + /** + * Pick a Worker according to the address and workload of the Worker + * Invoke the RPC and return Future result + */ + def sendRequestAsync[T: ClassTag]( + splitAddress: String, + request: Any): (Schedulable, Future[T]) = { + require(splitAddress != null) + if (workers.isEmpty) { + throw new IOException("No worker is available") + } + var worker = pickWorker(splitAddress) + + // check whether worker exceed max workload, if exceeded, pick another worker + val maxWorkload = CarbonProperties.getMaxWorkloadForWorker(worker.cores) + var numTry = 10 --- End diff -- This logic seems like it can check only for 10 workers for an available worker. What if the cluster of size 100, we should check in all workers for the available workers not just 10. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/2205 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4151/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2205#discussion_r183362086 --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Scheduler.scala --- @@ -0,0 +1,116 @@ +/* + * 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.spark.rpc + +import java.io.IOException +import java.util.concurrent.atomic.AtomicInteger + +import scala.collection.mutable +import scala.concurrent.Future +import scala.reflect.ClassTag +import scala.util.Random + +import org.apache.carbondata.core.util.CarbonProperties + +/** + * [[org.apache.spark.rpc.Master]] uses Scheduler to pick a Worker to send request + */ +private[rpc] class Scheduler { + private val workers = mutable.Map[String, Schedulable]() + private val random = new Random() + + /** + * Pick a Worker according to the address and workload of the Worker + * Invoke the RPC and return Future result + */ + def sendRequestAsync[T: ClassTag]( + splitAddress: String, + request: Any): (Schedulable, Future[T]) = { + require(splitAddress != null) + if (workers.isEmpty) { + throw new IOException("No worker is available") + } + var worker = pickWorker(splitAddress) + + // check whether worker exceed max workload, if exceeded, pick another worker + val maxWorkload = CarbonProperties.getMaxWorkloadForWorker(worker.cores) + var numTry = 10 --- End diff -- ok, I will change it to the number of workers (workers.size()) --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2205 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4475/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/2205 retest sdv please --- |
Free forum by Nabble | Edit this page |