【Yarn】Yarn的基本执行流程(二)AM Container的启动

2024-08-29 08:52

本文主要是介绍【Yarn】Yarn的基本执行流程(二)AM Container的启动,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Yarn的基本执行流程之AM Container的启动

文章目录

  • Yarn的基本执行流程之AM Container的启动
    • AM Container(第一个Container)的启动
      • NM RM心跳交互触发调度Container的启动流程
      • RM中调度启动AM流程
      • AMLauncher启动流程
      • NM上容器的启动流程
        • 下载资源
        • AM Container 启动与运行
      • NM RM心跳交互触发调度更新Container的状态
    • AM启动之后怎么注册到RM上
    • AM怎么申请运行其他Container

AM Container(第一个Container)的启动

NM RM心跳交互触发调度Container的启动流程

NodeStatusUpdaterImpl ResourceTrackerService RMNodeImpl FairScheduler NM上的定时触发项RM进行心跳交互 1.NM向RM进行心跳交互 nodeHeartbeat(request) 2.触发RMNodeStatusEvent (RMNodeEventType.STATUS_UPDATE) StatusUpdateWhenHealthyTransition() 3.触发NodeUpdateSchedulerEvent (SchedulerEventType.NODE_UPDATE) nodeUpdate() NodeStatusUpdaterImpl ResourceTrackerService RMNodeImpl FairScheduler

当有NM节点向RM发送心跳请求时,RM内部最终会以事件的形式通知到调度器,调度器则选择合适的应用为其分配资源。

  1. NM上的节点NodeStatusUpdater服务的实现NodeStatusUpdaterImpl与ResourceTrackerService保持心跳联系,定时发送信息。
  2. ResourceTrackerService验证相关信息后,会向调度器发送RMNodeStatusEvent事件。
  3. RMNodeImpl向调度器发送NodeUpdateSchedulerEvent事件,由FairScheduler进行nodeUpdate处理,其中就包含了启动AM流程。

RM中调度启动AM流程

FairScheduler FSAppAttempt RMContainerImpl RMAppAttemptImpl SchedulerApplicationAttempt RMAppImpl RMStateStore ApplicationMasterLauncher 1.尝试为Container分配资源 assignContainer() 2.分配资源 allocate() 3.触发 RMContainerEvent (RMContainerEventType.START) ContainerStartedTransition() 4.触发 RMAppAttemptEvent (RMAppAttemptEventType.CONTAINER_ALLOCATED) AMContainerAllocatedTransition() 5. Acquire the AM container from the scheduler. allocate() 6.pullNewlyAllocatedContainers() 7.触发 RMContainerEvent (RMContainerEventType.ACQUIRED) AcquiredTransition() 8.触发 RMAppRunningOnNodeEvent (RMAppEventType.APP_RUNNING_ON_NODE) AppRunningOnNodeTransition() 9.异步存储attempt storeNewApplicationAttempt() 10.触发 RMStateStoreAppAttemptEvent (RMStateStoreEventType.STORE_APP_ATTEMPT) StoreAppAttemptTransition() 11.触发 RMAppAttemptEvent (RMAppAttemptEventType.ATTEMPT_NEW_SAVED) AttemptStoredTransition() 12.触发 AMLauncherEvent (AMLauncherEventType.LAUNCH) FairScheduler FSAppAttempt RMContainerImpl RMAppAttemptImpl SchedulerApplicationAttempt RMAppImpl RMStateStore ApplicationMasterLauncher
  1. FairSchduler在更新节点时会调用attemptScheduling方法,尝试为Container分配资源
  2. FSAppAttempt申请分配Container资源,实例化Container。
  3. 申请到了Container资源,触发RMContainerEventType.START事件。在完成ContainerStartedTransition方法后,RMContainerState.NEW将变为RMContainerState.ALLOCATED
  4. ContainerStartedTransition方法发送了RMAppAttemptEventType.CONTAINER_ALLOCATED事件,触发AMContainerAllocatedTransition方法,RMAppAttemptState.SCHEDULED将变为RMAppAttemptState.ALLOCATED_SAVING
  5. 从调度器获取启动 AM 的 Container。
  6. 把之前申请资源拿走。
  7. 处理RMContainerEventType.ACQUIRED事件,RMContainerState.ALLOCATED将变为RMContainerState.ACQUIRED
  8. 把当前Container所处的Node放入上下文,RMAppState.ACCEPTED保持不变
  9. 当第5步开始的链路结束后,回到RMAppAttemptImpl,执行异步存储Attempt信息。
  10. 处理RMStateStoreEventType.STORE_APP_ATTEMPT事件,RMStateStore.storeApplicationAttemptStateInternal持久化存储,是存ZK???
  11. 存储成功时候,发送RMAppAttemptEventType.ATTEMPT_NEW_SAVED事件,RMAppAttemptState.ALLOCATED_SAVING将变为RMAppAttemptState.ALLOCATED
  12. 执行registerClientToken()注册客户端token,向处理器发送AMLauncherEventType.LAUNCH事件。处理器是将事件交由ApplicationMasterLauncher继续处理AMLauncher启动流程。

AMLauncher启动流程

RMContainerImpl StartContainerRequest StartContainersRequest ApplicationMasterLauncher LauncherThread AMLauncher ContainerManagerImpl 1.创建AMLauncher实例 createRunnableLauncher() 2.masterEvents.add(launcher) 3.获取队列的事件元素 masterEvents.take() 4. 执行AMLauncher线程 launcherPool.execute(toLaunch) 5.与NM交互启动容器 launch() 与NM建立连接 connect() 构建AM容器,并设置相关参数 createAMContainerLaunchContext 使用AM容器构建StartContainerRequest请求 使用StartContainerRequest构建StartContainersRequest请求 启动容器 startContainers() 6.触发 RMAppAttemptEvent (RMAppAttemptEventType.LAUNCHED) AMLaunchedTransition() RMContainerImpl StartContainerRequest StartContainersRequest ApplicationMasterLauncher LauncherThread AMLauncher ContainerManagerImpl

ResourceManager启动的时候会将会创建ApplicationMasterLauncher服务,用来进行AM Container的启动与关闭。

  1. ApplicationMasterLauncher回去创建一个AMLauncher实例,用来启动AM Container。

  2. 将AMLauncher实例放入masterEvents队列。AMLauncher实例的处理是一种异步的处理方式。

  3. 在实例化ApplicationMasterLauncher时,会创建一个LauncherThread线程实例,用来调度处理masterEvents。

  4. LauncherThread从队列中获取AMLauncher调度执行。

  5. 执行launch()方法,这里面包含了与NM交互,具体启动NM上Container的部分。

  6. 向事件处理器发送RMAppAttemptEventType.LAUNCHED事件,调度执行RMAppAttemptImpl的AMLaunchedTransition(),此时认为AM container已经启动,等待AM container注册到RN上,将刚刚启动的 ApplicationMaster 注册到 AMLivelinessMonitor,启动心跳监控。RMAppAttemptState.ALLOCATED将变为 RMAppAttemptState.LAUNCHED

NM上容器的启动流程

由ContainerManagerImpl被调用到startContainers()方法展开。遍历StartContainerRequests,处理每个StartContainerRequest。具体操作是在startContainerInternal() 方法。

下载资源
ContainerManagerImpl ContainerImpl ApplicationImpl NMLeveldbStateStoreService LogAggregationService ResourceLocalizationService LocalResourcesTrackerImpl LocalizedResource LocalizerRunner PublicLocalizer ContainerScheduler 1. 创建容器实例 (填充信息) 2. 创建Application实例 (填充信息) 3. 存储Application信息 storeApplication() 4. 触发ApplicationInitEvent (ApplicationEventType.INIT_APPLICATION) AppInitTransition() 5. 触发LogHandlerAppStartedEvent (LogHandlerEventType.APPLICATION_STARTED) 6. 触发 ApplicationEvent (ApplicationEventType.APPLICATION_LOG_HANDLING_INITED) AppLogInitDoneTransition() 7. 触发 ApplicationLocalizationEvent (LocalizationEventType.INIT_APPLICATION_RESOURCES) 8. 触发 ApplicationInitedEvent (ApplicationEventType.APPLICATION_INITED) AppInitDoneTransition() 9. 触发 ContainerInitEvent (ContainerEventType.INIT_CONTAINER) RequestResourcesTransition() 10. 触发 ContainerLocalizationRequestEvent (LocalizationEventType.LOCALIZE_CONTAINER_RESOURCES) RequestResourcesTransition() 11. 为每个容器资源获取本地资源追踪器 12. 触发 ResourceRequestEvent (ResourceEventType.REQUEST) FetchResourceTransition() 13. 触发 LocalizerResourceRequestEvent (LocalizerEventType.REQUEST_RESOURCE_LOCALIZATION) FetchResourceTransition() 14. 为Application创建对应的LocalizerRunner实例,并启动该线程实例 15. 将公共资源下载交给PublicLocalizer下载 16. 触发ResourceLocalizedEvent (ResourceEventType.LOCALIZED) FetchSuccessTransition() 17. 触发ContainerResourceLocalizedEvent (ContainerEventType.RESOURCE_LOCALIZED) LocalizedTransition() 18. ContainerLocalizationEvent (LocalizationEventType..CONTAINER_RESOURCES_LOCALIZED) 19. 触发 ContainerSchedulerEvent (ContainerSchedulerEventType.SCHEDULE_CONTAINER) loop [ContainerResourceLocalizedEvent] loop [ResourceRequestEvent] loop [getLocalResourcesTracker] loop [ContainerInitEvent] loop [startContainerInternal synchronized] ContainerManagerImpl ContainerImpl ApplicationImpl NMLeveldbStateStoreService LogAggregationService ResourceLocalizationService LocalResourcesTrackerImpl LocalizedResource LocalizerRunner PublicLocalizer ContainerScheduler
  1. 创建一个ContainerImpl实例,初始化相关信息。
  2. 为新的appc创建一个Application实例,即app的AM Container来初始化。
  3. 获取日志聚合上下文,将Application信息,存储下来。
  4. 向调度器发送ApplicationInitEvent(ApplicationEventType.INIT_APPLICATION)事件,调用AppInitTransition()方法,执行成功后会将ApplicationState.INITING变成ApplicationState.RUNNING
  5. 发送LogHandlerAppStartedEvent(LogHandlerEventType.APPLICATION_STARTED)事件,由LogAggregationService来处理。会为APP创建一个AppLogAggregatorImpl实例,并由线程池调度它。
  6. 向调度器发送ApplicationEvent(ApplicationEventType.APPLICATION_LOG_HANDLING_INITED)事件,触发AppLogInitDoneTransition()方法。
  7. 向调度器发送ApplicationLocalizationEvent(LocalizationEventType.INIT_APPLICATION_RESOURCES)事件,由ResourceLocalizationService来处理。开始对app的创建应用程序资源跟踪。
  8. 向调度器发送ApplicationInitedEvent(ApplicationEventType.APPLICATION_INITED)事件,调用ApplicationImpl中的AppInitDoneTransition方法处理。
  9. 遍历此APP中的所有Container(需要建立的),向调度器发送ContainerInitEvent(ContainerEventType.INIT_CONTAINER)事件,由ContainerImpl的RequestResourcesTransition方法处理,ContainerState.LOCALIZING.NEW将变为ContainerState.LOCALIZING
  10. 会发送辅助服务的相关事件AuxServicesEvent(AuxServicesEventType.CONTAINER_INIT)AuxServicesEvent(AuxServicesEventType.APPLICATION_INIT)暂时展开,之后发送ContainerLocalizationRequestEvent事件,进行容器资源的本地化。
  11. 资源本地服务ResourceLocalizationService为每个资源请求构建LocalResourcesTracker(LocalResourcesTrackerImpl)。
  12. 由LocalResourcesTrackerImpl发送ResourceRequestEvent(ResourceEventType.REQUEST)事件,ResourceState.INIT将变为ResourceState.DOWNLOADING
  13. 转发LocalizerResourceRequestEvent<br>(LocalizerEventType.REQUEST_RESOURCE_LOCALIZATION)事件给ResourceLocalizationService
  14. 按照资源的分类交交由PublicLocalizer和LocalizerRunner两个线程进行处理,此时该容器应该是没有对应的LocalizerRunner的,所以先进行LocalizerRunner实例化之后再启动。将PRIVATE和APPLICATION资源交给LocalizerRunner。
  15. 请求公共资源下载交给PublicLocalizer。
  16. 发送ResourceLocalizedEvent(ResourceEventType.LOCALIZED)事件,交由LocalizedResource处理。
  17. 没当一个下载完成之后,发送ContainerEventType.RESOURCE_LOCALIZED事件,触发该容器的全部资源的检查,如果还有资源没下载,就保持ContainerState.LOCALIZING,等待下次事件触发。
  18. 如果全部资源下载完成,则发送ContainerLocalizationEvent(LocalizationEventType.CONTAINER_RESOURCES_LOCALIZED)事件给ResourceLocalizationService,去销毁该容器的LocalizerRunner线程,
  19. 发送ContainerSchedulerEvent<br>(ContainerSchedulerEventType.SCHEDULE_CONTAINER)事件给ContainerScheduler。

此时ContainerState.LOCALIZING变为ContainerState.SCHEDULED

AM Container 启动与运行
ContainerScheduler ContainerImpl ContainersLauncher ContainerLaunch ContainersMonitorImpl NMLeveldbStateStoreService DefaultContainerExecutor 1. sendLaunchEvent() 2. 触发ContainersLauncherEvent (ContainersLauncherEventType.LAUNCH_CONTAINER) 3. 创建ContainerLaunch实例 由线程池启动call() 4. 触发 ContainerEvent (ContainerEventType.CONTAINER_LAUNCHED) LaunchTransition() 5. 触发 ContainerStartMonitoringEvent (ContainersMonitorEventType.START_MONITORING_CONTAINER) 6. 存储ContainerLaunched信息 storeContainerLaunched() 7. 启动容器 launchContainer ContainerScheduler ContainerImpl ContainersLauncher ContainerLaunch ContainersMonitorImpl NMLeveldbStateStoreService DefaultContainerExecutor
  1. 尝试启动pending的容器们,在资源满足情况的前提下,遍历容器,按队列顺序向ContainerImpl发送启动事件,直到无法满足。

  2. 向容器启动器发送ContainersLauncherEvent<br>(ContainersLauncherEventType.LAUNCH_CONTAINER)事件

  3. 创建ContainerLaunch实例,并由线程池启动该实例线程

  4. 更新容器信息到对应的日志目录和工作目录,将待运行的 Container 所需的环境和运行命令写到 Shell 脚本中launch_container.sh 脚本中,并将启动该脚本的命令写入 default_container_executro.sh 中,然后通过该脚本启动 Container。在这里主要对执行的环境和内容进行相关配置。ContainerState.SCHEDULED将变为ContainerState.RUNNING

  5. 发送ContainerStartMonitoringEvent事件,开启容器监控。此刻以及认为容器以及启动了。

  6. 将容器的启动信息更新进持久化存储

  7. 发送启动命令给默认容器执行器(DefaultContainerExecutor),真正启动 Container。

    在DefaultContainerExecutor的launchContainer方法中会执行bash default_container_executor.sh命令,default_container_executor.sh脚本的包含部分内容有:,其中huatuo是队列名称,/data10/yarn是配置yarn.nodemanager.local-dirs的值。

    /bin/bash "/data10/yarn/usercache/huatuo/appcache/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001/default_container_executor.sh"
    

    调用了default_container_executor_session.sh脚本

    #!/bin/bash
    ...
    exec /bin/bash "/data10/yarn/usercache/huatuo/appcache/appcache/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001/launch_container.sh"
    

    最后调用了launch_container.sh脚本,内容如下:

    ...
    echo "Launching container"
    exec /bin/bash -c "$JAVA_HOME/bin/java -server -Djava.net.preferIPv6Addresses=false -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED -Djdk.reflect.useDirectMethodHandle=false -Xmx2048m -Djava.io.tmpdir=$PWD/tmp '-XX:MaxMetaspaceSize=512m' '-XX:+PrintGCDetails' '-XX:+PrintGCDateStamps' '-XX:+UseParNewGC' '-XX:+UseConcMarkSweepGC' '-XX:CMSInitiatingOccupancyFraction=70' '-XX:+UseCMSInitiatingOccupancyOnly' '-XX:+ExplicitGCInvokesConcurrent' '-XX:ParallelGCThreads=4' '-XX:ConcGCThreads=2' '-XX:GCTimeLimit=90' '-XX:GCHeapFreeLimit=10' '-XX:OnOutOfMemoryError=kill %p' '-Dfastjson.parser.safeMode=true' -Xloggc:/data10/logs/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001/gclog -Dspark.yarn.app.container.log.dir=/data10/logs/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001 org.apache.spark.deploy.yarn.ApplicationMaster --class 'com.suning.bigquery.worker.BigqueryWorker' --jar file:/home/bigquery/software/bigquery-3.0.2/lib/worker/bigquery-worker-3.0.2.jar --arg 'huatuo' --arg '0' --arg 'namenode1-sit.cnsuning.com:2015,namenode2-sit.cnsuning.com:2015,slave01-sit.cnsuning.com:2015' --properties-file $PWD/__spark_conf__/__spark_conf__.properties --dist-cache-conf $PWD/__spark_conf__/__spark_dist_cache__.properties 1> /data10/logs/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001/stdout 2> /data10/logs/application_1723033197835_26906/container_e87_1723033197835_26906_01_000001/stderr"
    

    这个container是个Spark任务,所以这里调用的是org.apache.spark.deploy.yarn.ApplicationMaster,并将标准输出写到stdout中,将标准错误输出写到stderr中。这也就是container的log目录里有三个文件的原因。至此,AM Container启动完毕。

NM RM心跳交互触发调度更新Container的状态

NodeStatusUpdaterImpl ResourceTrackerService RMNodeImpl FairScheduler AbstractYarnScheduler containerLaunchedOnNode RMContainerImpl NM上的定时触发项RM进行心跳交互 1.NM向RM进行心跳交互 nodeHeartbeat(request) 2.触发RMNodeStatusEvent (RMNodeEventType.STATUS_UPDATE) StatusUpdateWhenHealthyTransition() 3.触发NodeUpdateSchedulerEvent (SchedulerEventType.NODE_UPDATE) nodeUpdate() 4. nodeUpdate() 5. containerLaunchedOnNode() 3. 触发 RMContainerEvent (RMContainerEventType.LAUNCHED) nodeUpdate() NodeStatusUpdaterImpl ResourceTrackerService RMNodeImpl FairScheduler AbstractYarnScheduler containerLaunchedOnNode RMContainerImpl

RMContainerState.ACQUIRED, RMContainerState.RUNNING

AM启动之后怎么注册到RM上

不同的任务类型在AM Container 启动的类不同,由这个l类管理进行AM注册到RM上

  • mapreduce任务的AM上启动类:org.apache.hadoop.mapreduce.v2.app.MRAppMaster

  • spark任务的AM上启动类:org.apache.spark.deploy.yarn.ApplicationMaster

  • flink任务的AM上启动类:org.apache.flink.yarn.entrypoint.YarnApplicationClusterEntryPoint

以MRAppMaster为例:

MRAppMaster RMContainerAllocator RMCommunicator ApplicationMasterService AMSProcessingChain DefaultAMSProcessor RMAppAttemptImpl RMAppImpl 1.创建实例 2.serviceInit() 3.serviceStart() 4.registerApplicationMaster() 与RM基于ApplicationMasterProtocol协议建立连接 5.registerApplicationMaster() 6.registerApplicationMaster() 7. 触发 RMAppAttemptRegistrationEvent (RMAppAttemptEventType.REGISTERED) AMRegisteredTransition() 8. 触发 RMAppEvent (RMAppEventType.ATTEMPT_REGISTERED) AMRegisteredTransition() MRAppMaster RMContainerAllocator RMCommunicator ApplicationMasterService AMSProcessingChain DefaultAMSProcessor RMAppAttemptImpl RMAppImpl
  1. Container启动的时候会去加载实例化MRAppMaster类,由MRAppMaster类中去创建RMContainerAllocator。
  2. 通过服务框架进行服务的初始化
  3. 通过服务框架进行服务的启动
  4. 与RM基于ApplicationMasterProtocol协议建立连接,调用执行ApplicationMasterService的registerApplicationMaster方法,
  5. 通过AMS处理链进行转发
  6. 获取节点上的需要更新的Container,即是获取nodeUpdateQueue队列中的元素,其中包含了新启动的Container。
  7. 触发 RMAppAttemptRegistrationEvent (RMAppAttemptEventType.REGISTERED) 事件,执行AMRegisteredTransition方法,RMAppAttemptState.ALLOCATED将变成RMAppAttemptState.RUNNING,
  8. 触发 RMAppEvent (RMAppEventType.ATTEMPT_REGISTERED) 事件,执行方法AMRegisteredTransition(),RMAppState.ACCEPTED将变成RMAppState.RUNNING

AM怎么申请运行其他Container

以MRAppMaster为例:

在MRAppMaster启动中会创建一个JobImpl,由JobImpl计算出需要的MapTasks和ReduceTasks的个数。在RMCommunicator中会独立有一个AllocatorRunnable线程,在注册AM之后,会启动该线程,通过心跳机制,请求与RM中ApplicationMasterService服务的allocate方法,进行资源申请的调度。

MRAppMaster RMContainerAllocator AllocatorRunnable RMContainerRequestor TaskAttemptImpl ContainerLauncherImpl RMCommunicator ApplicationMasterService ContainerManagerImpl 1.创建实例 2.serviceInit() 3.serviceStart() 与RM通信 4.registerApplicationMaster() 返回RegisterApplicationMasterResponse 5.startAllocatorThread() 6.heartbeat() 7.makeRemoteRequest() 与RM通信 8.allocate() 返回AllocateResponse 返回AllocateResponse 9. TaskAttemptContainerAssignedEvent TaskAttemptEventType.TA_ASSIGNED ContainerAssignedTransition() 10. createContainerLaunchContext 11. ContainerRemoteLaunchEvent ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH launch() 与NM通信 12. startContainers() 返回 StartContainersResponse 13. executeHeartbeatCallbacks() MRAppMaster RMContainerAllocator AllocatorRunnable RMContainerRequestor TaskAttemptImpl ContainerLauncherImpl RMCommunicator ApplicationMasterService ContainerManagerImpl

1~4为AM注册到RM上流程(同上)

  1. 在注册AM的之后,会启动分配器线程
  2. AllocatorRunnable与RMContainerAllocator之前有心跳交互
  3. 开始触发向RM申请接下来任务需要容器的资源流程
  4. 请求与RM中ApplicationMasterService服务的allocate方法,获取分配结果,去开始对task进行分配和信息填充。
  5. 检查分配的Container信息情况
  6. 为task构建启动Context信息
  7. 触发ContainerRemoteLaunchEvent(ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH)事件,准备向分配的目标NodeManager发送启动容器的请求
  8. 向分配的目标NodeManager发送启动容器请求
  9. 从之前一些注册的心跳回调方法的队列heartbeatCallbacks中获取Runnable并执行

NM上的APP相关的任务会通过心跳机制来进行交互,更新运行情况。

【Yarn】Yarn的基本执行流程(三) 应用运行结束流程

这篇关于【Yarn】Yarn的基本执行流程(二)AM Container的启动的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1117413

相关文章

用js控制视频播放进度基本示例代码

《用js控制视频播放进度基本示例代码》写前端的时候,很多的时候是需要支持要网页视频播放的功能,下面这篇文章主要给大家介绍了关于用js控制视频播放进度的相关资料,文中通过代码介绍的非常详细,需要的朋友可... 目录前言html部分:JavaScript部分:注意:总结前言在javascript中控制视频播放

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

Spring定时任务只执行一次的原因分析与解决方案

《Spring定时任务只执行一次的原因分析与解决方案》在使用Spring的@Scheduled定时任务时,你是否遇到过任务只执行一次,后续不再触发的情况?这种情况可能由多种原因导致,如未启用调度、线程... 目录1. 问题背景2. Spring定时任务的基本用法3. 为什么定时任务只执行一次?3.1 未启用

一文带你了解SpringBoot中启动参数的各种用法

《一文带你了解SpringBoot中启动参数的各种用法》在使用SpringBoot开发应用时,我们通常需要根据不同的环境或特定需求调整启动参数,那么,SpringBoot提供了哪些方式来配置这些启动参... 目录一、启动参数的常见传递方式二、通过命令行参数传递启动参数三、使用 application.pro

SpringBoot项目启动报错"找不到或无法加载主类"的解决方法

《SpringBoot项目启动报错找不到或无法加载主类的解决方法》在使用IntelliJIDEA开发基于SpringBoot框架的Java程序时,可能会出现找不到或无法加载主类com.example.... 目录一、问题描述二、排查过程三、解决方案一、问题描述在使用 IntelliJ IDEA 开发基于

SpringBoot整合MybatisPlus的基本应用指南

《SpringBoot整合MybatisPlus的基本应用指南》MyBatis-Plus,简称MP,是一个MyBatis的增强工具,在MyBatis的基础上只做增强不做改变,下面小编就来和大家介绍一下... 目录一、MyBATisPlus简介二、SpringBoot整合MybatisPlus1、创建数据库和

Spring AI ectorStore的使用流程

《SpringAIectorStore的使用流程》SpringAI中的VectorStore是一种用于存储和检索高维向量数据的数据库或存储解决方案,它在AI应用中发挥着至关重要的作用,本文给大家介... 目录一、VectorStore的基本概念二、VectorStore的核心接口三、VectorStore的

python之流程控制语句match-case详解

《python之流程控制语句match-case详解》:本文主要介绍python之流程控制语句match-case使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录match-case 语法详解与实战一、基础值匹配(类似 switch-case)二、数据结构解构匹

SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法

《SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法》本文主要介绍了SpringBoot项目启动错误:找不到或无法加载主类的几种解决方法,具有一定的参考价值,感兴趣的可以了解一下... 目录方法1:更改IDE配置方法2:在Eclipse中清理项目方法3:使用Maven命令行在开发Sprin

如何通过Golang的container/list实现LRU缓存算法

《如何通过Golang的container/list实现LRU缓存算法》文章介绍了Go语言中container/list包实现的双向链表,并探讨了如何使用链表实现LRU缓存,LRU缓存通过维护一个双向... 目录力扣:146. LRU 缓存主要结构 List 和 Element常用方法1. 初始化链表2.