Spark-streaming-scheduler

Spark-streaming-scheduler

@(spark)[streaming|scheduler]

BatchInfo

/**                                                                                                                                                                     
 * :: DeveloperApi ::                                                                                                                                                   
 * Class having information on completed batches.                                                                                                                       
 * @param batchTime   Time of the batch                                                                                                                                 
 * @param submissionTime  Clock time of when jobs of this batch was submitted to                                                                                        
 *                        the streaming scheduler queue                                                                                                                 
 * @param processingStartTime Clock time of when the first job of this batch started processing                                                                         
 * @param processingEndTime Clock time of when the last job of this batch finished processing                                                                           
 */                                                                                                                                                                     
@DeveloperApi                                                                                                                                                           
case class BatchInfo(                                                                                                                                                   
    batchTime: Time,                                                                                                                                                    
    receivedBlockInfo: Map[Int, Array[ReceivedBlockInfo]],                                                                                                              
    submissionTime: Long,                                                                                                                                               
    processingStartTime: Option[Long],                                                                                                                                  
    processingEndTime: Option[Long]                                                                                                                                     
  ) {    

ReceivedBlockTracker

/**                                                                                                                                                                     
 * Class that keep track of all the received blocks, and allocate them to batches                                                                                       
 * when required. All actions taken by this class can be saved to a write ahead log                                                                                     
 * (if a checkpoint directory has been provided), so that the state of the tracker                                                                                      
 * (received blocks and block-to-batch allocations) can be recovered after driver failure.                                                                              
 *                                                                                                                                                                      
 * Note that when any instance of this class is created with a checkpoint directory,                                                                                    
 * it will try reading events from logs in the directory.                                                                                                               
 */                                                                                                                                                                     
private[streaming] class ReceivedBlockTracker(                                                                                                                          
    conf: SparkConf,                                                                                                                                                    
    hadoopConf: Configuration,                                                                                                                                          
    streamIds: Seq[Int],                                                                                                                                                
    clock: Clock,                                                                                                                                                       
    checkpointDirOption: Option[String])                                                                                                                                
  extends Logging {  

#

/**                                                                                                                                                                     
 * This class manages the execution of the receivers of ReceiverInputDStreams. Instance of                                                                              
 * this class must be created after all input streams have been added and StreamingContext.start()                                                                      
 * has been called because it needs the final set of input streams at the time of instantiation.                                                                        
 *                                                                                                                                                                      
 * @param skipReceiverLaunch Do not launch the receiver. This is useful for testing.                                                                                    
 */                                                                                                                                                                     
private[streaming]                                                                                                                                                      
class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false) extends Logging {   

它的重点则是

  /** This thread class runs all the receivers on the cluster.  */                                                                                                      
  class ReceiverLauncher {     d

Job

/**                                                                                                                                                                     
 * Class representing a Spark computation. It may contain multiple Spark jobs.                                                                                          
 */                                                                                                                                                                     
private[streaming]                                                                                                                                                      
class Job(val time: Time, func: () => _) {      

JobSet

/** Class representing a set of Jobs                                                                                                                                    
  * belong to the same batch.                                                                                                                                           
  */                                                                                                                                                                    
private[streaming]                                                                                                                                                      
case class JobSet(                                                                                                                                                      
    time: Time,                                                                                                                                                         
    jobs: Seq[Job],                                                                                                                                                     
    receivedBlockInfo: Map[Int, Array[ReceivedBlockInfo]] = Map.empty                                                                                                   
  ) {    

#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值