赞
踩
以上是字节二面的一些问题,面完之后其实挺后悔的,没有提前把各个知识点都复习到位。现在重新好好复习手上的面试大全资料(含JAVA、MySQL、算法、Redis、JVM、架构、中间件、RabbitMQ、设计模式、Spring等),现在起闭关修炼半个月,争取早日上岸!!!
下面给大家分享下我的面试大全资料
后端JAVA面试大全
MySQL+Redis学习笔记算法+JVM+JAVA核心知识整理
MySQL+Redis学习笔记算法+JVM+JAVA核心知识整理
用户提交Flink任务时,通过先后调用transform()——>doTransform()——>addOperator()方法,将map、flatMap、filter、process等算子添加到List<Transformation<?>> transformations集合中。在执行execute()方法时,会使用StreamGraphGenerator的generate()方法构建流拓扑StreamGraph(即Pipeline),数据结构属于有向无环图。
在StreamGraph中,StreamNode用于记录算子信息,而StreamEdge则用于记录数据交换方式,包括以下几种Partitioner:
Partitioner类都是StreamPartitioner类的子类,它们通过实现isPointwise()方法来确定自身的类型。一种是ALL_TO_ALL,另一个种是POINTWISE。
/\*\* \* A distribution pattern determines, which sub tasks of a producing task are connected to which \* consuming sub tasks. \* \* <p>It affects how {@link ExecutionVertex} and {@link IntermediateResultPartition} are connected \* in {@link EdgeManagerBuildUtil} \*/ public enum DistributionPattern { /\*\* Each producing sub task is connected to each sub task of the consuming task. \*/ ALL\_TO\_ALL, /\*\* Each producing sub task is connected to one or more subtask(s) of the consuming task. \*/ POINTWISE }
ALL_TO_ALL意味着上游的每个subtask需要与下游的每个subtask建立连接。
POINTWISE则是上游的每个subtask和下游的一个或多个subtask连接。
StreamGraph构建完成后,,会通过 PipelineExecutorUtils.getJobGraph()构建JobGraph,具体流程是:
——>PipelineExecutorUtils.getJobGraph()
——>FlinkPipelineTranslationUtil.getJobGraph()
——>StreamGraphTranslator.translateToJobGraph()
——>StreamGraph.getJobGraph()
——>StreamingJobGraphGenerator.createJobGraph()
JobGraph是优化后的StreamGraph,如果相连的算子支持chaining,合并到一个StreamNode,chaining在StreamingJobGraphGenerator的setChaining()方法中实现:
/\*\* \* Sets up task chains from the source {@link StreamNode} instances. \* \* <p>This will recursively create all {@link JobVertex} instances. \*/ private void setChaining(Map<Integer, byte[]> hashes, List<Map<Integer, byte[]>> legacyHashes) { // we separate out the sources that run as inputs to another operator (chained inputs) // from the sources that needs to run as the main (head) operator. final Map<Integer, OperatorChainInfo> chainEntryPoints = buildChainedInputsAndGetHeadInputs(hashes, legacyHashes); final Collection<OperatorChainInfo> initialEntryPoints = chainEntryPoints.entrySet().stream() .sorted(Comparator.comparing(Map.Entry::getKey)) .map(Map.Entry::getValue) .collect(Collectors.toList()); // iterate over a copy of the values, because this map gets concurrently modified for (OperatorChainInfo info : initialEntryPoints) { createChain( info.getStartNodeId(), 1, // operators start at position 1 because 0 is for chained source inputs info, chainEntryPoints); } }
我还为大家准备了一套体系化的架构师学习资料包以及BAT面试资料,供大家参考及学习
已经将知识体系整理好(源码,笔记,PPT,学习视频)
net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。