Spark Learning Note-spark Streaming

Source: Internet
Author: User

Http://spark.apache.org/docs/1.2.1/streaming-programming-guide.html

How to shard data in sparkstreaming

Level of Parallelism in Data processing

Cluster resources can be under-utilized if the number of parallel tasks used on any stage of the computation are not high E Nough. For example, for distributed reduce operations like reduceByKey reduceByKeyAndWindow and, the default number of parallel tasks are controlled by The spark.default.parallelism configuration property. You can pass the level of parallelism as a argument (see PairDStreamFunctions documentation), or set the spark.default.parallelism Change the default.

Parallel Data processing level

if the number of parallel tasks used at any stage of the calculation is not high enough , the cluster resources may be underutilized . For example, for distributed reduce operations Reducebykey and Reducebykeyandwindow, the default number of parallel tasks is determined by the spark.default.parallelism Configuration Property Control. You can control parallelism by parameters ( see pairdstreamfunctions documentation, or set Spark.default.parallelism configuration properties to make changes.)

For example: sparkconf sparkconf = new sparkconf (). Setappname ("NAME"). Set ("Spark.default.parallelism", "5");

Spark Learning Note-spark Streaming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.