当前位置: 首页 > news >正文

Spark 之 partitons

Listing leaf files and directories

在这里插入图片描述

分析其并行化

org.apache.spark.util.HadoopFSUtils

      sc.parallelize(paths, numParallelism).mapPartitions { pathsEachPartition =>val hadoopConf = serializableConfiguration.valuepathsEachPartition.map { path =>val leafFiles = listLeafFiles(path = path,hadoopConf = hadoopConf,filter = filter,contextOpt = None, // Can't execute parallel scans on workersignoreMissingFiles = ignoreMissingFiles,ignoreLocality = ignoreLocality,isRootPath = isRootLevel,parallelismThreshold = Int.MaxValue,parallelismMax = 0)(path, leafFiles)}}.collect()
    // Set the number of parallelism to prevent following file listing from generating many tasks// in case of large #defaultParallelism.val numParallelism = Math.min(paths.size, parallelismMax)

parallelismMax 最终由以下配置决定。

  val PARALLEL_PARTITION_DISCOVERY_PARALLELISM =buildConf("spark.sql.sources.parallelPartitionDiscovery.parallelism").doc("The number of parallelism to list a collection of path recursively, Set the " +"number to prevent file listing from generating too many tasks.").version("2.1.1").internal().intConf.createWithDefault(10000)
http://www.lryc.cn/news/500806.html

相关文章:

  • 使用Zerotier配置虚拟局域网,踏坑
  • 【优选算法 二分查找】二分查找算法模板详解:二分查找 & 在排序数组中查找元素的第一个和最后一个位置
  • gitlab 生成并设置 ssh key
  • 计算机视觉在科学研究(数字化)中的实际应用
  • 移动应用开发课程第六次实验:为实验2添加登陆页面,用SQList存储好友基本信息
  • nextjs增加系统路径前缀(basePath)适配方案
  • 嵌入式蓝桥杯学习拓展 LCD翻转显示
  • 学习threejs,实现配合使用WebWorker
  • TDengine 新功能 复合主键
  • JVM 面试题
  • 组件上传图片不回显问题
  • 【JavaWeb后端学习笔记】Spring AOP面向切面编程
  • 6.584-Lab5B
  • OceanBase 的探索与实践
  • 安卓调试环境搭建
  • 动画Lottie
  • C++感受14-Hello Object 封装版 - 上
  • 网络安全中大数据和人工智能应用实践
  • RISC-V架构下OP-TEE 安全系统实践
  • 40分钟学 Go 语言高并发:【实战】分布式缓存系统
  • [创业之路-186]:《华为战略管理法-DSTE实战体系》-1-为什么UTStarcom死了,华为却活了,而且越活越好?
  • python如何多行注释
  • 前端工程化面试题目常见
  • 定点数的乘除运算
  • 页面置换算法模拟 最近最久未使用(LRU)算法
  • Ubuntu与Centos系统有何区别?
  • RK3568平台开发系列讲解(pinctrl 子系统篇)pinctrl_debug
  • 避大坑!Vue3中reactive丢失响应式的问题
  • springSecurity权限控制
  • Pytorch训练固定随机种子(单卡场景和分布式训练场景)