new Thread(() -> { for (int i = 0;i < maxStep;i++) { File file = new File(getFilesDir().toString() + File.separatorChar + fileName[i]); //上传数据 PostProcedure postProcedure = new PostProcedure(); JSONObject jsonObject = new JSONObject(); try { jsonObject.put("menuId", data); jsonObject.put("content", arrayList.get(i).getDetail()); jsonObject.put("file", file); } catch (JSONException e) { throw new RuntimeException(e); } Map map = null; try { map = postProcedure.postRequestProcedure("/menu/step/save", jsonObject); } catch (JSONException e) { throw new RuntimeException(e); } Map finalMap = map; runOnUiThread(() -> { if (finalMap == null) { ToastUtil.show(this, "网络异常"); } else { String message = (String) finalMap.get("message"); ToastUtil.show(this, message.equals("ok") ? "步骤上传成功!" : message); } }); } }).start();

时间: 2024-02-10 11:06:36 浏览: 28
这段代码是在Android平台中使用多线程的方式上传文件和数据到服务器。代码中使用了一个线程,循环上传多个文件和数据。具体步骤如下: 1. 创建一个新的线程,使用lambda表达式来实现Runnable接口的run()方法。 2. 在循环中,获取当前要上传的文件,创建一个PostProcedure对象,用于发送POST请求到服务器。 3. 构建一个JSONObject对象,用于封装要上传的数据。其中包括menuId、content和file三个字段。其中file字段是一个文件对象,用来上传文件数据。 4. 调用PostProcedure的postRequestProcedure()方法,将构建好的JSONObject对象作为参数传入,发送POST请求到服务器。 5. 在请求返回后,根据返回的结果显示相应的提示信息。如果上传成功,则弹出“步骤上传成功”提示框;否则,弹出“网络异常”或者具体的错误信息。 需要注意的是,由于Android平台中不允许在主线程中进行网络请求,因此需要在新的线程中发送请求。同时,由于上传文件和数据较为耗时,因此需要使用多线程的方式来实现异步上传,以避免阻塞主线程。
相关问题

public static void main(String[] args) throws IOException { Workbook workbook = WorkbookFactory.create(new File("lib/1.xlsx")); Sheet sheet = workbook.getSheetAt(0); int rowCount = sheet.getLastRowNum() + 1; int colCount = sheet.getRow(0).getLastCellNum(); int cellWidth = 100 / colCount; int cellHeight = 100 / rowCount; StringBuilder html = new StringBuilder(); html.append("<table>"); for (int i = 0; i < rowCount; i++) { html.append("<tr>"); for (int j = 0; j < colCount; j++) { Cell cell = sheet.getRow(i).getCell(j); String value = cell.getStringCellValue(); html.append("<td style="width: " + cellWidth + "%; height: " + cellHeight + "%;">"); html.append(value); html.append("</td>"); } html.append("</tr>"); } html.append("</table>"); FileOutputStream fos = new FileOutputStream("lib/output.html"); fos.write(html.toString().getBytes()); fos.close();提示错误Exception in thread "main" java.lang.NullPointerException at a.b.main(b.java:26)第26行是Cell cell = sheet.getRow(i).getCell(j);

这个错误通常是因为在获取行或单元格时,没有检查它们是否为 null 引用。你可以尝试在访问行或单元格之前先检查它们是否为 null,如果是 null,则可能是因为该行或单元格为空。以下是一个示例代码片段,可以用于检查并避免 NullPointerException 错误: ``` for (int i = 0; i < rowCount; i++) { Row row = sheet.getRow(i); if (row != null) { html.append("<tr>"); for (int j = 0; j < colCount; j++) { Cell cell = row.getCell(j); if (cell != null) { String value = cell.getStringCellValue(); html.append("<td style='width: " + cellWidth + "%; height: " + cellHeight + "%;'>"); html.append(value); html.append("</td>"); } } html.append("</tr>"); } } ``` 在这个示例代码中,我们在访问每一行和单元格之前,都先检查了它们是否为 null 引用,如果是 null,则跳过该行或单元格。这样可以避免 NullPointerException 错误。

为这段代码解决Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4问题 public class readCproject { public Object[][] readProjectData(String ProjectParam) { Object[][] ProjectSum = new String[100][50]; for(int i=0;i<100;i++) { ProjectSum[i]=new String [50]; } try { // 文件 File file = new File(ProjectParam); // 判断如果文件不存在,则创建文件 if(!file.exists()) { try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } else{ BufferedReader br = new BufferedReader(new FileReader(file)); String s = null; int j = 0; while((s = br.readLine())!=null){ String[] strArray = s.split(","); System.out.println(strArray[0]); for(int l=0;l<4;l++) { ProjectSum[j][l]=strArray[l]; } j=j+1; } br.close(); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return ProjectSum; } }

在代码的第19行,你使用了一个数组索引变量l来访问strArray数组的元素。然而,在第20行中,你假设strArray数组的长度为4,但实际上并没有判断strArray数组的长度。因此,当strArray数组的长度小于4时,你将会遇到ArrayIndexOutOfBoundsException异常。 为了解决这个问题,你可以使用strArray.length来获取strArray数组的长度,并使用Math.min方法来确保不会超出数组的长度。修改第20行代码如下: for(int l=0;l<Math.min(strArray.length, 4);l++) { ProjectSum[j][l]=strArray[l]; }

相关推荐

解释这段代码package question7; import java.io.DataOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.Random; public class Test { public static void main(String args[]){ Test test=new Test(); Scanner input=new Scanner(System.in); String s1=new String(); s1=input.nextLine(); String[] s2 = s1.split(" "); int[] l=new int[s2.length]; for(int i=0 ; i<s2.length;i++){ l[i]=Integer.parseInt(s2[i]); } test.write("test.txt", l); int[] readlist=test.read("test.txt",l); isPrime isprime=new isPrime(readlist); for(int i=1;i<=10;i++){ new Thread(isprime).start(); } try { Thread.sleep(1000); //1000 毫秒,也就是1秒. } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } Set<Integer> set=new HashSet(); set=isprime.getSet(); System.out.println("素数set"+set); System.out.println("输入查询数字"); int num=input.nextInt(); if(set.contains(num)){ System.out.println(num+"是素数"); } else System.out.println(num+"不是是素数"); } public void write(String filename,int a[]){ File file = new File(filename); try { PrintWriter output=new PrintWriter(file); for(int i=0;i<a.length;i++){ output.print(a[i]+" "); } output.close(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public int[] read(String filename,int a[]){ File file=new File(filename); try { Scanner input=new Scanner(file); int i=0; while(input.hasNext()){ a[i]=input.nextInt(); i++; } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return a; } }

这段代码中 public int convert2Ofd(int imagefileid, String filename,String docdcsurl) { writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------start"); //String docdcsurl = Util.null2String(getPropValue("yzDcsUrl", "docdcsurl")); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------imagefileid=" + imagefileid + ";filename=" + filename + ";docdcsurl=" + docdcsurl); int newimagefileid = -1; try { if (imagefileid > 0 && !"".equals(filename) && !"".equals(docdcsurl)) { String fileext = ""; if (filename.indexOf(".") != -1) { fileext = filename.substring(filename.lastIndexOf(".")); } writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------fileext=" + fileext); String sourcefilepath = getImageFile(imagefileid + ""); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------sourcefilepath=" + sourcefilepath); if (!"".equals(sourcefilepath)) { String dcsurl = convert(docdcsurl, sourcefilepath, "29"); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------dcsurl=" + dcsurl); if (!"".equals(dcsurl)) { InputStream input = getInputStreamFromDcs(dcsurl); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------input=" + input); String newfilename = filename.substring(0, filename.lastIndexOf(".")) + ".ofd"; if (input != null) { newimagefileid = savePdfImageFile(input, newfilename); } if (new File(sourcefilepath).exists() && new File(sourcefilepath).isFile()) { new File(sourcefilepath).delete(); } } } } } catch (Exception e) { writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------Exception=" + e); } writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------newimagefileid=" + newimagefileid); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------end"); return newimagefileid; }报这个异常 应该怎么修改2023-06-07 10:00:41,501 INFO A2 - [null] pool-20-thread-1-827[weaver.odoc.ofd.util.ConvertToPdfForDcs:395] - ConvertToPdfForDcsE9--convertUot2Ofd-------------------Exception=java.net.MalformedURLException: no protocol:

修改代码,消除错误,错误如下:OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file C:\projects\bytedeco\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.1.0\modules\imgproc\src\color.cpp, line 8000 Exception in thread "main" java.lang.RuntimeException: C:\projects\bytedeco\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.1.0\modules\imgproc\src\color.cpp:8000: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor代码如下cvtColor(src_blur, src_gray, CV_RGB2GRAY); if (debug) { opencv_imgcodecs.imwrite("D:\\PlateLocate\\"+"gray"+".jpg", src_gray); System.out.println("灰度"+"D:\\PlateLocate\\"+"gray"+".jpg"); } public int plateDetect(final Mat src, Vector<Mat> resultVec) { //车牌定位 Vector<Mat> matVec = plateLocate.plateLocate(src); if (0 == matVec.size()) { return -1; } //车牌判断 if (0 != plateJudge.plateJudge(matVec, resultVec)) { return -2; } if (getPDDebug()) { int size = (int) resultVec.size(); for (int i = 0; i < size; i++) { Mat img = resultVec.get(i); //车牌定位图片 String str = "D:\\PlateLocate\\carPlateLocation.jpg"; System.out.println("车牌定位图片"+str); opencv_imgcodecs.imwrite(str, img); } } return 0; } public static String[] multiPlateRecognise(opencv_core.Mat mat) { PlateDetect plateDetect = new PlateDetect(); plateDetect.setPDLifemode(true); Vector<opencv_core.Mat> matVector = new Vector<opencv_core.Mat>(10); if (0 == plateDetect.plateDetect(mat, matVector)) { CharsRecognise cr = new CharsRecognise(); String[] results = new String[matVector.size()]; for (int i = 0; i < matVector.size(); ++i) { String result = cr.charsRecognise(matVector.get(i)); results[i] = result; } return results; } return null; } public static String[] multiPlateRecognise(String imgPath) { opencv_core.Mat src = opencv_imgcodecs.imread(imgPath); return multiPlateRecognise(src); } public static void main(String[] args) { // 多张车牌图片路径 String[] imgPaths = {"res/image/test_image/plate_locate.jpg", "res/image/test_image/test.jpg", "res/image/test_image/plate_detect.jpg", "res/general_test/京A88731.jpg"}; int sum = imgPaths.length; // 总共处理的图片数量 int errNum = 0; // 识别错误的数量 int sumTime = 0; // 总耗时 long longTime = 0; // 最长处理时长 for (int i = 0; i < sum; i++) { opencv_cor

#include /* __init and __exit macroses */ #include /* KERN_INFO macros */ #include /* required for all kernel modules */ #include /* module_param() and MODULE_PARM_DESC() */ #include /* struct file_operations, struct file */ #include /* struct miscdevice and misc_[de]register() */ #include /* kzalloc() function */ #include /* copy_{to,from}_user() */ #include //init_task再次定义 #include "proc_relate.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Wu Yimin>"); MODULE_DESCRIPTION("proc_relate kernel modoule"); static int proc_relate_open(struct inode *inode, struct file *file) { struct proc_info *buf; int err = 0; buf=kmalloc(sizeof(struct proc_info)*30,GFP_KERNEL); file->private_data = buf; return err; } static ssize_t proc_relate_read(struct file *file, char __user * out,size_t size, loff_t * off) { struct proc_info *buf = file->private_data; /* 你需要补充的代码 */ } static int proc_relate_close(struct inode *inode, struct file *file) { struct buffer *buf = file->private_data; kfree(buf); return 0; } static struct file_operations proc_relate_fops = { .owner = THIS_MODULE, .open = proc_relate_open, .read = proc_relate_read, .release = proc_relate_close, .llseek = noop_llseek }; static struct miscdevice proc_relate_misc_device = { .minor = MISC_DYNAMIC_MINOR, .name = "proc_relate", .fops = &proc_relate_fops }; static int __init proc_relate_init(void) { misc_register(&proc_relate_misc_device); printk(KERN_INFO "proc_relate device has been registered.\n"); return 0; } static void __exit proc_relate_exit(void) { misc_deregister(&proc_relate_misc_device); printk(KERN_INFO "proc_relate device has been unregistered\n"); } module_init(proc_relate_init); module_exit(proc_relate_exit);补充这段代码需要补充的函数部分,使其能编译为内核模块,安装该内核模块后测试程序,运行结果类似如下:Here is parent process,pid = 7329 this is a child,pid is 7330 this is another child,pid is 7331 this is a child,pid is 7333 In thread,pid=7331 tid=7334 thread id=1254224352 this is a child,pid is 7332 this is a child,pid is 7335 ------------------------------------------------------- pid=2616 tgid=2616 comm=sshd sessionid=4 mm=ffff8000fae19000 activeMM=ffff8000fae19000 parent =1971 real_parent=1971 group_leader2616 ------------------------------------------------------- pid=2670 tgid=2670 comm=sshd sessionid=4 mm=ffff8000fa477500 activeMM=ffff8000fa477500 parent =2616 real_parent=2616 group_leader2670 -------------------------------------------------------

#include <stdio.h> #include <iostream> #include <chrono> #include <thread> #include <DjiRtspImageSource.h> #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" static inline int64_t now() { return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(); } static int write_data_to_file(const char* name, uint8_t* data, int size) { FILE* fd = fopen(name, "wb"); if(fd) { int w = (int)fwrite(data, 1, size, fd); fclose(fd); return w; } else { return -1; } } char rtsp_url = "rtsp://192.168.42.142:8554/live"; int main(int argc, char** argv) { if(argc < 1) return -1; if(argc == 1) { std::cout << "Usage : " << argv[0] << " <url>" << std::endl; return -1; } int64_t ts = now(); DjiRtspImageSource service(rtsp_url); service.setImageCallback(nullptr, [&ts](void* handler, uint8_t* frmdata, int frmsize, int width, int height, int pixfmt) -> void { printf("Image %d@%p -- %dx%d -- %d\n", frmsize, frmdata, width, height, pixfmt); if(frmdata) { int64_t t = now(); if(t - ts > 1000) { ts = t; char name[64]; static int counter = 0; sprintf(name, "pictures/%dx%d-%d_%d.jpg", width, height, pixfmt, ++counter); if(pixfmt == 5) stbi_write_jpg(name, width, height, 3, frmdata, 80); } } }); service.start(); for(;;) //for(int i=0; i<30; i++) { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } service.stop(); std::cout << "done." << std::endl; return 0; } 利用上述代码实现提取并解码二维码的信息,并将解码结果保存到tta文件夹下保存为文件名为 list_of_goods,给出c++源码

这个错误怎么解决,代码怎么修改OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file C:\projects\bytedeco\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.1.0\modules\imgproc\src\color.cpp, line 8000 Exception in thread "main" java.lang.RuntimeException: C:\projects\bytedeco\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.1.0\modules\imgproc\src\color.cpp:8000: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor代码如下 public static void main(String[] args) { // 多张车牌图片路径 String[] imgPaths = {"res/image/test_image/plate_locate.jpg", "res/image/test_image/test.jpg", "res/image/test_image/plate_detect.jpg", "res/general_test/京A88731.jpg"}; int sum = imgPaths.length; // 总共处理的图片数量 int errNum = 0; // 识别错误的数量 int sumTime = 0; // 总耗时 long longTime = 0; // 最长处理时长 for (int i = 0; i < sum; i++) { opencv_core.Mat src = opencv_imgcodecs.imread(imgPaths[i]); String[] ret = multiPlateRecognise(src); long now = System.currentTimeMillis(); System.err.println(Arrays.toString(ret)); long s = System.currentTimeMillis() - now; if (s > longTime) { longTime = s; } sumTime += s; boolean flag =false;//是否有一个车牌号识别错误 for (String plate:ret) { if (plate == null) { continue; } String targetPlate = getTargetPlate(imgPaths[i]); if (!plate.equals(targetPlate)){ flag = true; break; } } if (flag) { errNum++; } } BigDecimal errSum = new BigDecimal(errNum); BigDecimal sumNum = new BigDecimal(sum); BigDecimal c = sumNum.subtract(errSum).divide(sumNum,2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); System.err.println("总耗时:" + sumTime + "ms,平均处理时长:" + sumTime/sum + "ms,错误数量:" + errNum + ",正确识别率:" + c + "%"); } }

void URcontrolcenter::start() { // 创建六个线程 for (int i = 0; i < 6; ++i) { threads.push_back(std::thread(&URcontrolcenter::processTasks, this));//六个线程同时运行 } // 将任务分配到队列中 for (int i = 0; i < relationship_list.size(); ++i) { taskQueue.push(i); } // 等待所有任务完成 std::unique_lockstd::mutex lock(mutex); conditionVariable.wait(lock, //阻塞当前线程 this{ return tasksCompleted == relationship_list.size(); });//表示所有任务已经完成,线程可以继续执行。 } void URcontrolcenter::processTasks() { //下面先报完成,然后下一轮上面给弹出 RewriteRelationShip relationship; int taskNumber; while (true) { // 获取下一个任务 { std::lock_guardstd::mutex lock(mutex);//使用线程锁确保线程安全 if (taskQueue.empty()) { //检查当前任务是否已经全部完成,如果已经完成,则退出循环,否则获取下一个任务,并处理该任务。 return; } taskNumber = taskQueue.front(); taskQueue.pop(); } // 处理任务 relationship.parseData(relationship_list[taskNumber],worningcrosstype);//应该输入直接带relationship的 // 在任务完成后,增加了已完成任务的数量,并检查是否所有任务都已经完成。如果所有任务都已经完成,则调用conditionVariable.notify_one()函数,通知等待线程可以继续执行。 { std::lock_guardstd::mutex lock(mutex);//使用了std::lock_guard对象锁定了互斥锁mutex,以确保线程安全。 ++tasksCompleted; if (tasksCompleted == relationship_list.size()) { // 所有任务已完成,通知等待线程 conditionVariable.notify_one(); } } } } 如何写析构函数

最新推荐

recommend-type

基于Yolov5的旋转检测

旋转检测 要求 torch==1.6 shapely==1.7.1 opencv==4.2.0.34
recommend-type

MATLAB 代码解决 Timothy Sauer 的教科书“数值分析”第三版中的两组计算机问题.zip

1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
recommend-type

基于SpringBoot+SpringCloud微服务的商城项目.zip

基于springboot的java毕业&课程设计
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

实现实时数据湖架构:Kafka与Hive集成

![实现实时数据湖架构:Kafka与Hive集成](https://img-blog.csdnimg.cn/img_convert/10eb2e6972b3b6086286fc64c0b3ee41.jpeg) # 1. 实时数据湖架构概述** 实时数据湖是一种现代数据管理架构,它允许企业以低延迟的方式收集、存储和处理大量数据。与传统数据仓库不同,实时数据湖不依赖于预先定义的模式,而是采用灵活的架构,可以处理各种数据类型和格式。这种架构为企业提供了以下优势: - **实时洞察:**实时数据湖允许企业访问最新的数据,从而做出更明智的决策。 - **数据民主化:**实时数据湖使各种利益相关者都可
recommend-type

SQL怎么实现 数据透视表

SQL可以通过使用聚合函数和GROUP BY子句来实现数据透视表。 例如,假设有一个销售记录表,其中包含产品名称、销售日期、销售数量和销售额等信息。要创建一个按照产品名称、销售日期和销售额进行汇总的数据透视表,可以使用以下SQL语句: ``` SELECT ProductName, SaleDate, SUM(SaleQuantity) AS TotalQuantity, SUM(SaleAmount) AS TotalAmount FROM Sales GROUP BY ProductName, SaleDate; ``` 该语句将Sales表按照ProductName和SaleDat
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

实现实时监控告警系统:Kafka与Grafana整合

![实现实时监控告警系统:Kafka与Grafana整合](https://imgconvert.csdnimg.cn/aHR0cHM6Ly9tbWJpei5xcGljLmNuL21tYml6X2pwZy9BVldpY3ladXVDbEZpY1pLWmw2bUVaWXFUcEdLT1VDdkxRSmQxZXB5R1lxaWNlUjA2c0hFek5Qc3FyRktudFF1VDMxQVl3QTRXV2lhSWFRMEFRc0I1cW1ZOGcvNjQw?x-oss-process=image/format,png) # 1.1 Kafka集群架构 Kafka集群由多个称为代理的服务器组成,这