Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-1899] Add CarbonData concurrency test case #1670

Closed
wants to merge 1 commit into from

Conversation

xubo245
Copy link
Contributor

@xubo245 xubo245 commented Dec 15, 2017

Add CarbonData concurrency test case

Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:

  • Any interfaces changed?
    No

  • Any backward compatibility impacted?
    No

  • Document update required?
    No

  • 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.
    No

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2014/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/794/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2337/

* limitations under the License.
*/

package org.apache.carbondata.spark.testsuite.dataretention
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to add in testcase, I think you can add it in a separated benchmark module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean add it into example module?

@xubo245 xubo245 force-pushed the concurrentTest branch 2 times, most recently from 7de9899 to 8618c3e Compare December 17, 2017 13:48
@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2074/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2375/

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/849/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/851/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2076/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2377/

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2378/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/862/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2087/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2385/

@xubo245
Copy link
Contributor Author

xubo245 commented Dec 18, 2017

retest this please

val executorService = Executors.newFixedThreadPool(ThreadNum)
val results = new util.ArrayList[Future[Results]]()
for (num <- (1 to TaskNum).par) {
results.add(executorService.submit(new QueryTask(spark, sqlText)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better concurrency, I think invokeAll is better option instead of submitting task every time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I am testing the invokeALl in local

@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/872/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2097/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2135/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/911/

@ravipesala
Copy link
Contributor

SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2424/

@manishgupta88
Copy link
Contributor

retest sdv please

val sql = s"query ${index + 1}: $sqlText "
printResult(results, sql)
executorService.shutdown()
executorService.awaitTermination(600, TimeUnit.SECONDS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why printResult is getting called before shutting down executorService?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because printResult invoke get() method(java.util.concurrent.Future#get()), it waits if necessary for the computation to complete, and then retrieves its result. So the tasks have finished when shutting down executorService

val r = new Random()
val tmpId = r.nextInt(cardinalityId) % totalNum
val tmpCity = "city" + (r.nextInt(cardinalityCity) % totalNum)
val queries: Array[Query] = Array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to give an option to read queries, table name and database name from external file...so that any number of queries can be added without modifying the code.....This will also help to standalone run this class and specifying the query file path as an argument to it.
If not now, you can enhance the framework in another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will enhance the framework.

.getOrCreateCarbonSession(storeLocation)
spark.sparkContext.setLogLevel("warn")

doParameter(args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the method name to initParameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

val sortTimeArray = timeArray.sorted

val time90 = ((sortTimeArray.length) * 0.9).toInt - 1
val time99 = ((sortTimeArray.length) * 0.99).toInt - 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a detailed comment for your printing logic and explain what is time90 and time99

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ravipesala
Copy link
Contributor

SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2445/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/938/

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2167/

@manishgupta88
Copy link
Contributor

LGTM...once build runs I will merge

@xubo245
Copy link
Contributor Author

xubo245 commented Dec 21, 2017

retest this please

@CarbonDataQA
Copy link

Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/973/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2196/

Add CarbonData concurrency test case

move test to excample module

add doParameter

fix scala style

change the code by review comment
@CarbonDataQA
Copy link

Build Success with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/977/

@CarbonDataQA
Copy link

Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2201/

@manishgupta88
Copy link
Contributor

LGTM

@asfgit asfgit closed this in 71959da Dec 21, 2017
SangeetaGulia pushed a commit to SangeetaGulia/incubator-carbondata that referenced this pull request Jan 3, 2018
Add CarbonData concurrency test case

This closes apache#1670
jatin9896 pushed a commit to jatin9896/incubator-carbondata that referenced this pull request Jan 5, 2018
Add CarbonData concurrency test case

This closes apache#1670
anubhav100 pushed a commit to anubhav100/incubator-carbondata that referenced this pull request Jun 22, 2018
Add CarbonData concurrency test case

This closes apache#1670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants