Welcome to my tech blog.

Here, I document my technical notes and project experiences.
Hope you find these resources helpful. 🐒

常见网络问题排查及解决

在日常生活中经常会遇到网络连接问题,特别是刚搬家或重新配置网络时。例如,手机可以正常连接 WiFi 上网,但 PC 却无法访问 github 等网站。这类问题可能由多种原...

周四 · 2025-03-13 · 3 分钟 · Yuechen

SpringBatch中的作业调度

6. 作业调度 6.1 JobLauncher的使用 控制任务什么时候启动 pom.xml引入web依赖 <!-- 引入web依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> application.p...

周二 · 2025-02-25 · 3 分钟 · Yuechen

SpringBatch中的错误处理

5. 错误处理 5.1 错误处理概述 默认情况下,当任务出现异常时,SpringBatch会结束任务。 当使用相同的参数重启任务时,SpringBatch会...

周二 · 2025-02-25 · 6 分钟 · Yuechen

SpringBatch中的I/O(数据输出)

4. 数据输出 4.1 ItemWriter 概述 ItemReader是一个数据一个数据的读 ItemWriter是一批一批的输出 写个MyWriter:MyWriter.ja...

周二 · 2025-02-25 · 10 分钟 · Yuechen

SpringBatch中的I/O(数据输入)

3. 数据输入 3.1 ItemReader 概述 写个MyReader import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.NonTransientResourceException; import org.springframework.batch.item.ParseException; import org.springframework.batch.item.UnexpectedInputException; import java.util.Iterator; import java.util.List; public class MyReader implements ItemReader<String> { private Iterator<String> iterator; public MyReader(List<String> list) { this.iterator = list.iterator(); } @Override public String read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { // 默认一个一个读数据 if (iterator.hasNext())...

周二 · 2025-02-25 · 8 分钟 · Yuechen

SpringBatch中的作业流

2. 作业流 2.1 Job 的创建和使用 Job:批处理中的核心概念,是 Batch操作的基础单元。每个Job有1个或多个Step。 import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; import org.springframework.batch.core.scope.context.ChunkContext;...

周二 · 2025-02-25 · 5 分钟 · Yuechen

SpringBatch简介

1. 简介 Spring Batch是一个基于Spring框架的批处理框架,它提供了一组完整的API和工具,用于处理大量数据操作,例如读取、处理和写入数据。S...

周二 · 2025-02-25 · 4 分钟 · Yuechen

Design a Log Aggregation System

Implement a Log Aggregation System which aggregates logs from various services in a datacenter and provides search APIs. Design the LogAggregator class: LogAggregator(int machines, int services) Initializes the object with machines and services representing the number of machines and services in the datacenter, respectively. void pushLog(int logId, int machineId, int serviceId, String message) Adds a log with id logId notifying that the machine machineId sent a string message while executing...

周日 · 2025-02-23 · 4 分钟 · Yuechen