- MacOS Catalina 从源码构建Qt6.2开发库之01: 编译Qt6.2源代码
捕鲸叉
QTmacosc++QT
安装xcode,cmake,ninjabrewinstallnodemac下安装OpenGL库并使之对各项目可见在macOS上安装OpenGL通常涉及到安装一些依赖库,如MGL、GLUT或者是GLEW等,同时确保LLVM的OpenGL框架和相关工具链的兼容性。以下是一个基本的安装步骤,你可以在终端中执行:安装Homebrew(如果还没有安装的话):/bin/bash-c"$(curl-fsSLht
- isa 底层结构分析
远方竹叶
OC对象的本质在我们日常的开发中,会创建很多个自定义的对象,大部分是继承自NSObject,但是具体到源码实现,就看不到了,怎么办呢?编译器clang就要登场了ClangClang是一个有Apple主导编写,基于LLVM的C/C++/Objective-C的编译器主要用于底层编译,将一些文件输出为C++文件,可以更好的查看底层的结构以及实现逻辑探索在main函数中创建一个LCPerson类,添加n
- centOS:如何用手机或桌面客户端远程登录centos服务器
每日出拳老爷子
linuxcentos
查看SSH服务状态,端口等:systemctlstatussshd.service当安装Module总是说找不到时,做下面这步再重新安装即可:yuminstallepel-release安装centos桌面yum-ygroupsinstall“GNOMEDesktop”启动桌面startx如果上面还不行,就先Update再装桌面yumcheck-updateyum-yinstalllvm2devi
- 华为NPU下安装apex
门前大橋下丶
npuapex
apt-getupdate-yapt-getinstall-ypatchbuild-essentiallibbz2-devlibreadline-devwgetcurlllvmlibncurses5-devlibncursesw5-devxz-utilstk-devliblzma-devm4dos2unixlibopenblas-devgitpipinstallwheelgitclone-b5.0
- 【vscode】vscode+cmake+llvm+ninja开发环境的搭建(draft)
真·Wild·攻城狮
码农日常vscodec++
文章目录前言1软件、工具和插件安装1.1vscode安装1.2cmake安装1.3安装LLVM1.4安装Ninja1.5vscode插件安装2工具链和CMakeLists2.1工具链(toolchain.cmake)2.2CMakeLists.txt2.3基本语法注释前言本文是一个使用vscode的小白扫盲贴。所谓工欲善其事必先利其器,作为码农的生产工具,vscode的开发配置是生产的第一步。1软
- 仓颉语言的编译和构建
小菜鸟学开发
HarmonyOS#仓颉编程语言harmonyos华为
一、cjc使用cjc是仓颉编程语言的编译命令,其提供了丰富的功能及对应的编译选项,本章将对基本使用方法进行介绍。cjc-frontend(仓颉前端编译器)会随cjc一起通过CangjieSDK提供,cjc-frontend能够将仓颉源码编译至仓颉的中间表示(LLVMIR)。cjc-frontend仅进行仓颉代码的前端编译,虽然cjc-frontend和cjc共享部分编译选项,但编译流程会在前端编译
- @llvm.amdgcn.workitem.id.x()引发的一些前后端的调研
jc小小川+幻幻融hr
小小川编译器elasticsearch大数据搜索引擎
记录资料:UserGuideforAMDGPUBackend—LLVM5documentationintrinsic函数会执行lowerintrinsicspassllvm-project-main/llvm/lib/CodeGen/IntrinsicLowering.cppllvm-project-main/llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics
- 不怕没项目做!github上的STM32 优秀开源项目和初学者项目
石头嵌入式
STM32stm32学习嵌入式硬件githubSTM32项目
优秀开源项目TinyGo-Go语言编译器,适用于微控制器、WebAssembly、命令行工具,基于LLVM。语言:Go星标数:14,267+描述:TinyGo带来了Go语言在嵌入式系统的实现,使得STM32等微控制器编程更加多样化。FlipperZeroFirmware-FlipperZero的固件源码。语言:C星标数:10,699+描述:为FlipperZero多功能设备提供固件支持,包含了许多
- LLVM User 重载 new 分析
跳跃的芋头人
c++学习笔记
关于Value,User,Use这三个类的一些介绍Value表示了LLVMIR中需要通过指令运行得到的值。它是Instruction和Function的父类。每一个值都持有一个Type指针(表达了在IR中的值类型)和一个Use指针(指向了一个uselist)。User(Value的子类)定义了使用值的接口。Instruction和Constants这两个常见类都是User的子类。Use表示了了Us
- Visual Studio Code &C++ on macOS
Hanbaxia
C++C++MACVSCODE环境搭建C++标准输入
一、预备知识1、理解mac环境的开发环境名称在开发环境中作用举例文本编辑器编写代码sublime,atom,visualstdiocode,nodepad++,vi/vim,emacs编译器文本编辑器写的代码翻译成机器代码链接器代码经编译二进制机器代码后,与系统提供的二进制库进行组合,生成一个可执行文件通常编译器和连接器一起的。vc/vc++,gcc/g++,clang+llvm项目管理工具管理程
- llvm之clang前端的一些例子:
me1o
初学LLVMllvm编辑器clang入门
这是我第一次写博客,最近刚刚接触llvm,写这篇blog主要是边学习边总结,当然有很多理解不到位,甚至是错误的地方。我非常愿意和大家一起探讨,请教llvm的相关知识。这篇blog不求能帮助大家,只求能不误导大家就好。以后也要养成写blog的习惯,在这里非常感谢@snsn1984在他blog里我学到很多东西,也正是这个原因激发了自己写blog的动力,希望能够坚持下去。有问题也希望能够和大家一起探讨!
- LLVM的中间表示
Back~~
LLVM学习
概括选择编译器IR的决策很重要,它决定了优化过程将拥有多少信息来使代码运行得更快。一方面非常高层级的IR允许优化器轻松地提取原始源代码的相关信息。另一方面,低层的IR更加贴近目标机器,这样编译器更容易为特定的硬件生成相应的代码,并有可能利用目标机器的特性但是IR的层级又不能太低当编译器将程序转换为更接近机器指令的表示时,将程序片段映射到源码会变得越来越困难如果编译器的IR设计采用与特定目标机器非常
- clang前端
Back~~
LLVM学习
Clang可以处理C、C++和Objective-C源代码Clang简介Clang可能指三种不同的实体:前端(在Clang库中实现)编译驱动程序(在clang命令和Clang驱动程序库中实现)实际的编译器(在clang-ccl命令中实现)clang-ccl中的编译器不仅是由Clang库实现的,而且还广泛使用其他LLVM库来实现编译器的中间部分、后端以及集成的汇编器先分析clang编译器驱动程序的命
- Python 潮流周刊#34:Python 3.13 的 JIT 方案又新又好
Python猫
python开发语言
△△请给“Python猫”加星标,以免错过文章推送你好,我是猫哥。这里每周分享优质的Python、AI及通用技术内容,大部分为英文。本周刊开源,欢迎投稿[1]。另有电报频道[2]作为副刊,补充发布更加丰富的资讯,欢迎关注。文章&教程1、简单聊聊Python3.13的JIT方案[3]Python3.13将引入一个copy-and-patchJIT编译器,它尽可能地利用了LLVM生态的东西,编译器用c
- Bitcode
道道明明白白
Bitcode是LLVM编译器将C/C++/OC/Swift等前端变成语言编译成多种不同芯片上的机器指令过程中的中间代码。并且这个中间代码是CPU无关的。原本我们的APP里要包含多种支持CPU架构的代码。支持Bitcode的优势就是在提交store后,苹果再动态生成相应CPU的APP版本,这样每个版本的APP就相对小了很多。相关bitcode的详细介绍参看这篇文章:http://www.jians
- LLVM 编译器 原理解析, 插件编写
咖啡豆8888
前言官网地址:LLVMLLVM项目是模块化,可重用的编译器以及工具链技术的集合创始人,亦是Swift之父ChrisLattner编译器GCCLLVMClang编译器原理:将代码首先进过编译器前端,目的是将代码规范化(词法分析,语法分析),检查错误等操作,然后生成编译中间代码(LLVMIR),然后经过编译器后端不同架构生成对应的机器码(x86,PC,ARM不同处理器生成不同的机器码)LLVM架构展示
- 5、iOS强化 --- 链接与符号(补充内容)
Jax_YD
上一篇文章4、iOS强化---链接与符号(Symbol)中我们提到了链接链接的本质就是把多个目标文件组合成一个文件但是有一些地方说的不够详细,这里我们做一下补充。首先我们知道,在生成.o目标文件的过程中,链接器(llvm-ld)并没有被执行,这个过程就是编译的过程。那么llvm-ld在哪里执行呢?答案:在最终生成Mach-O文件的过工程中被执行。过程如下:image.png1、多个目标文件合并2、
- OLLVM(以DES.c为示例进行测试)
Back~~
LLVM学习
https://blog.csdn.net/m0_72827793/article/details/135850403之前学了DES算法,刚好用作示例进行测试一下OLLVM本代码来自https://blog.csdn.net/zytjulie/article/details/123095529clang-emit-llvm-SDES.c-oDES.llclang-emit-llvm-SDES.c-
- 编写Makefile
Back~~
LLVM学习
现在我们将创建一个程序,该程序能够读取次位码文件并打印其中定义的函数名称,以及它们的基本块数,从而显示LLVM库的易用性什么是Makefile?C语言中,我们使用visualstudio开发软件时候,写程序开始时候都会创建一个project项目文件,然后在文件里面编译.h和.c的文件。在Linux中,有一个叫make的东西,就相当于C语言的集成开发环境,我们只需要在make里面创建文件,写代码,m
- 编写代码(LLVM的第一个项目)
Back~~
LLVM学习
下面这个完整代码它相对较短,因为它建立在LLVM流程的基础设施上后者替我们完成大部分工作我们从程序使用cl命名空间中的llvm工具(cl代表命令行)来实现我们的命令行接口需要调用ParseCommandLineOption函数声明cl::类型的全局变量以显示我们的程序收单个参数,并且该函数是包含位码文件名的string类型之后我们实例化一个LLVMContext对象,以存放于LLVM编译相关的所有
- Linux系统c/c++开发环境配置
UCASers
开发环境问题linuxc语言c++
安装LLVM全家桶及CMAKE输入以下命令,安装clang,clangd,lldb及cmake。sudoaptinstallclangclangdlldbcmakeyukeyang@DESKTOP-QFK2F47:~/myfiles/test$sudoaptinstallclangclangdlldbcmake[sudo]passwordforyukeyang:Readingpackagelist
- Metal Shader language (着色语言规范)总结
汉包包
Metal简述Metal着色器语言是用来编写3D图形渲染逻辑、并行Metal计算核心逻辑的一门编程语言,当你使用Metal框架来完成APP的实现时则需要使用Metal编程语言。Metal语言使用Clang和LLVM进行编译处理,编译器对于在GPU上的代码执行效率有更好的控制Metal基于C++11.0语言设计的,在C++基础上多了一些扩展和限制,主要用来编写在GPU上执行的图像渲染逻辑代码以及通用
- [LLVM_PASS]build pass on Windows vs2017
HAPPYers
推荐https://blog.csdn.net/asmcvc/article/details/80105190最后的效果opt-help...-mypass-Printallfunctionnames....λopt-mypassC:\Users\pcy19\Desktop\test.ll-debug-pass=StructureWARNING:You'reattemptingtoprintout
- Micro Language Compiler
nicename5
javawindows开发语言
Assignment1:MicroLanguageCompiler1IntroductionInthisassignment,youarerequiredtodesignandimplementacompilerfrontendforMicrolanguagewhichtransformstheMicroProgramintocorrespondingLLVMIntermediateReprese
- iOS底层-29:LLVM
Irino
LLVM概述LLVM是架构编译器(compiler)的框架系统,以C++编写而成,用于优化以任意程序语言编写的程序的编译时间(compile-time)、链接时间(link-time)、运行时间(run-time)以及空闲时间(idle-time),对开发者保持开放,并兼容已有脚本。LLVM计划启动于2000年,最初由美国UIUC大学的ChrisLatter博士支持开展。2006年ChrisLat
- LLVM实战之将.ll文件转换成bitcode文件
Aria_J
LLVM汇编LLVM编译器底层机器码
目录1.详细步骤2.原理3.扩展本文将介绍如何从LLVM的.ll文件来生成bitcode。LLVMbitcode(也称为字节码——bytecode)由两部分组成:位流(bitstream,可类比字节流),以及将LLVMIR编码成位流的编码格式。同样,这一步骤的前提是安装llvm-as工具,并添加到PATH环境变量中。1.详细步骤(1)首先创建LLVMIR文件作为llvm-as的输入:$cattes
- LLVM实战之LLVM bitcode转换成目标平台汇编码
Aria_J
汇编LLVM编译器底层机器码
目录1.详细步骤2.原理3.扩展本文将介绍如何将LLVMbitcode文件转换成目标机器的汇编码。当然,前提还是需要安装LLVM工具链的LLVM静态编译器llc。1.详细步骤(1)前一文章(
- LLVM实战之opt工具的使用
Aria_J
汇编LLVM编译器底层机器码
目录1.详细步骤2.原理3.扩展本文将介绍使用opt工具把IR转换成其他形式,以及对IR代码实施的多个优化。前提还是安装opt工具。1.详细步骤(1)使用以下命令用opt执行转换Pass:$opt–passnameinput.ll–ooutput.ll其中–passname参数可以替换成要使用的pass。(
- LLVM实战之将LLVM bitcode转回为LLVM汇编码
Aria_J
汇编LLVM编译器底层机器码
目录1.详细步骤2.原理本文将介绍如何通过反汇编工具llvm-dis把LLVMbitcode转回为LLVMIR。前提是已经安装llvm-dis工具(在LLVM工具链中)。1.详细步骤为了验证将bitcode文件转成IR的正确性,这里将使用前面(链接)文章中的test.bc文件作为输入。执行如下步骤:(1)执行以下命令把bitcode文件转换为IR文件:$llvm-distest.bc–otest.
- MinGW/MSYS/GCC/GNU/MSVC/Clang/LLVM都是什么
yao00037
c++c语言windows
MinGW(MinimalistGNUforWindows):MinGW(MinimalistGNUforWindows)是一个用于Windows平台的开发工具集,它提供了一组用于编译和构建应用程序的工具和库。它的目标是在Windows环境下提供一个类Unix的开发体验。MinGW的核心是GNU编译器集合(GCC),它是一个开源的编译器套件,支持多种编程语言,如C、C++和Fortran。通过Mi
- SQL的各种连接查询
xieke90
UNION ALLUNION外连接内连接JOIN
一、内连接
概念:内连接就是使用比较运算符根据每个表共有的列的值匹配两个表中的行。
内连接(join 或者inner join )
SQL语法:
select * fron
- java编程思想--复用类
百合不是茶
java继承代理组合final类
复用类看着标题都不知道是什么,再加上java编程思想翻译的比价难懂,所以知道现在才看这本软件界的奇书
一:组合语法:就是将对象的引用放到新类中即可
代码:
package com.wj.reuse;
/**
*
* @author Administrator 组
- [开源与生态系统]国产CPU的生态系统
comsci
cpu
计算机要从娃娃抓起...而孩子最喜欢玩游戏....
要让国产CPU在国内市场形成自己的生态系统和产业链,国家和企业就不能够忘记游戏这个非常关键的环节....
投入一些资金和资源,人力和政策,让游
- JVM内存区域划分Eden Space、Survivor Space、Tenured Gen,Perm Gen解释
商人shang
jvm内存
jvm区域总体分两类,heap区和非heap区。heap区又分:Eden Space(伊甸园)、Survivor Space(幸存者区)、Tenured Gen(老年代-养老区)。 非heap区又分:Code Cache(代码缓存区)、Perm Gen(永久代)、Jvm Stack(java虚拟机栈)、Local Method Statck(本地方法栈)。
HotSpot虚拟机GC算法采用分代收
- 页面上调用 QQ
oloz
qq
<A href="tencent://message/?uin=707321921&Site=有事Q我&Menu=yes">
<img style="border:0px;" src=http://wpa.qq.com/pa?p=1:707321921:1></a>
- 一些问题
文强chu
问题
1.eclipse 导出 doc 出现“The Javadoc command does not exist.” javadoc command 选择 jdk/bin/javadoc.exe 2.tomcate 配置 web 项目 .....
SQL:3.mysql * 必须得放前面 否则 select&nbs
- 生活没有安全感
小桔子
生活孤独安全感
圈子好小,身边朋友没几个,交心的更是少之又少。在深圳,除了男朋友,没几个亲密的人。不知不觉男朋友成了唯一的依靠,毫不夸张的说,业余生活的全部。现在感情好,也很幸福的。但是说不准难免人心会变嘛,不发生什么大家都乐融融,发生什么很难处理。我想说如果不幸被分手(无论原因如何),生活难免变化很大,在深圳,我没交心的朋友。明
- php 基础语法
aichenglong
php 基本语法
1 .1 php变量必须以$开头
<?php
$a=” b”;
echo
?>
1 .2 php基本数据库类型 Integer float/double Boolean string
1 .3 复合数据类型 数组array和对象 object
1 .4 特殊数据类型 null 资源类型(resource) $co
- mybatis tools 配置详解
AILIKES
mybatis
MyBatis Generator中文文档
MyBatis Generator中文文档地址:
http://generator.sturgeon.mopaas.com/
该中文文档由于尽可能和原文内容一致,所以有些地方如果不熟悉,看中文版的文档的也会有一定的障碍,所以本章根据该中文文档以及实际应用,使用通俗的语言来讲解详细的配置。
本文使用Markdown进行编辑,但是博客显示效
- 继承与多态的探讨
百合不是茶
JAVA面向对象 继承 对象
继承 extends 多态
继承是面向对象最经常使用的特征之一:继承语法是通过继承发、基类的域和方法 //继承就是从现有的类中生成一个新的类,这个新类拥有现有类的所有extends是使用继承的关键字:
在A类中定义属性和方法;
class A{
//定义属性
int age;
//定义方法
public void go
- JS的undefined与null的实例
bijian1013
JavaScriptJavaScript
<form name="theform" id="theform">
</form>
<script language="javascript">
var a
alert(typeof(b)); //这里提示undefined
if(theform.datas
- TDD实践(一)
bijian1013
java敏捷TDD
一.TDD概述
TDD:测试驱动开发,它的基本思想就是在开发功能代码之前,先编写测试代码。也就是说在明确要开发某个功能后,首先思考如何对这个功能进行测试,并完成测试代码的编写,然后编写相关的代码满足这些测试用例。然后循环进行添加其他功能,直到完全部功能的开发。
- [Maven学习笔记十]Maven Profile与资源文件过滤器
bit1129
maven
什么是Maven Profile
Maven Profile的含义是针对编译打包环境和编译打包目的配置定制,可以在不同的环境上选择相应的配置,例如DB信息,可以根据是为开发环境编译打包,还是为生产环境编译打包,动态的选择正确的DB配置信息
Profile的激活机制
1.Profile可以手工激活,比如在Intellij Idea的Maven Project视图中可以选择一个P
- 【Hive八】Hive用户自定义生成表函数(UDTF)
bit1129
hive
1. 什么是UDTF
UDTF,是User Defined Table-Generating Functions,一眼看上去,貌似是用户自定义生成表函数,这个生成表不应该理解为生成了一个HQL Table, 貌似更应该理解为生成了类似关系表的二维行数据集
2. 如何实现UDTF
继承org.apache.hadoop.hive.ql.udf.generic
- tfs restful api 加auth 2.0认计
ronin47
目前思考如何给tfs的ngx-tfs api增加安全性。有如下两点:
一是基于客户端的ip设置。这个比较容易实现。
二是基于OAuth2.0认证,这个需要lua,实现起来相对于一来说,有些难度。
现在重点介绍第二种方法实现思路。
前言:我们使用Nginx的Lua中间件建立了OAuth2认证和授权层。如果你也有此打算,阅读下面的文档,实现自动化并获得收益。SeatGe
- jdk环境变量配置
byalias
javajdk
进行java开发,首先要安装jdk,安装了jdk后还要进行环境变量配置:
1、下载jdk(http://java.sun.com/javase/downloads/index.jsp),我下载的版本是:jdk-7u79-windows-x64.exe
2、安装jdk-7u79-windows-x64.exe
3、配置环境变量:右击"计算机"-->&quo
- 《代码大全》表驱动法-Table Driven Approach-2
bylijinnan
java
package com.ljn.base;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.uti
- SQL 数值四舍五入 小数点后保留2位
chicony
四舍五入
1.round() 函数是四舍五入用,第一个参数是我们要被操作的数据,第二个参数是设置我们四舍五入之后小数点后显示几位。
2.numeric 函数的2个参数,第一个表示数据长度,第二个参数表示小数点后位数。
例如:
select cast(round(12.5,2) as numeric(5,2))  
- c++运算符重载
CrazyMizzz
C++
一、加+,减-,乘*,除/ 的运算符重载
Rational operator*(const Rational &x) const{
return Rational(x.a * this->a);
}
在这里只写乘法的,加减除的写法类似
二、<<输出,>>输入的运算符重载
&nb
- hive DDL语法汇总
daizj
hive修改列DDL修改表
hive DDL语法汇总
1、对表重命名
hive> ALTER TABLE table_name RENAME TO new_table_name;
2、修改表备注
hive> ALTER TABLE table_name SET TBLPROPERTIES ('comment' = new_comm
- jbox使用说明
dcj3sjt126com
Web
参考网址:http://www.kudystudio.com/jbox/jbox-demo.html jBox v2.3 beta [
点击下载]
技术交流QQGroup:172543951 100521167
[2011-11-11] jBox v2.3 正式版
- [调整&修复] IE6下有iframe或页面有active、applet控件
- UISegmentedControl 开发笔记
dcj3sjt126com
// typedef NS_ENUM(NSInteger, UISegmentedControlStyle) {
// UISegmentedControlStylePlain, // large plain
&
- Slick生成表映射文件
ekian
scala
Scala添加SLICK进行数据库操作,需在sbt文件上添加slick-codegen包
"com.typesafe.slick" %% "slick-codegen" % slickVersion
因为我是连接SQL Server数据库,还需添加slick-extensions,jtds包
"com.typesa
- ES-TEST
gengzg
test
package com.MarkNum;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation
- 为何外键不再推荐使用
hugh.wang
mysqlDB
表的关联,是一种逻辑关系,并不需要进行物理上的“硬关联”,而且你所期望的关联,其实只是其数据上存在一定的联系而已,而这种联系实际上是在设计之初就定义好的固有逻辑。
在业务代码中实现的时候,只要按照设计之初的这种固有关联逻辑来处理数据即可,并不需要在数据库层面进行“硬关联”,因为在数据库层面通过使用外键的方式进行“硬关联”,会带来很多额外的资源消耗来进行一致性和完整性校验,即使很多时候我们并不
- 领域驱动设计
julyflame
VODAO设计模式DTOpo
概念:
VO(View Object):视图对象,用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来。
DTO(Data Transfer Object):数据传输对象,这个概念来源于J2EE的设计模式,原来的目的是为了EJB的分布式应用提供粗粒度的数据实体,以减少分布式调用的次数,从而提高分布式调用的性能和降低网络负载,但在这里,我泛指用于展示层与服务层之间的数据传输对
- 单例设计模式
hm4123660
javaSingleton单例设计模式懒汉式饿汉式
单例模式是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例类的特殊类。通过单例模式可以保证系统中一个类只有一个实例而且该实例易于外界访问,从而方便对实例个数的控制并节约系统源。如果希望在系统中某个类的对象只能存在一个,单例模式是最好的解决方案。
&nb
- logback
zhb8015
loglogback
一、logback的介绍
Logback是由log4j创始人设计的又一个开源日志组件。logback当前分成三个模块:logback-core,logback- classic和logback-access。logback-core是其它两个模块的基础模块。logback-classic是log4j的一个 改良版本。此外logback-class
- 整合Kafka到Spark Streaming——代码示例和挑战
Stark_Summer
sparkstormzookeeperPARALLELISMprocessing
作者Michael G. Noll是瑞士的一位工程师和研究员,效力于Verisign,是Verisign实验室的大规模数据分析基础设施(基础Hadoop)的技术主管。本文,Michael详细的演示了如何将Kafka整合到Spark Streaming中。 期间, Michael还提到了将Kafka整合到 Spark Streaming中的一些现状,非常值得阅读,虽然有一些信息在Spark 1.2版
- spring-master-slave-commondao
王新春
DAOspringdataSourceslavemaster
互联网的web项目,都有个特点:请求的并发量高,其中请求最耗时的db操作,又是系统优化的重中之重。
为此,往往搭建 db的 一主多从库的 数据库架构。作为web的DAO层,要保证针对主库进行写操作,对多个从库进行读操作。当然在一些请求中,为了避免主从复制的延迟导致的数据不一致性,部分的读操作也要到主库上。(这种需求一般通过业务垂直分开,比如下单业务的代码所部署的机器,读去应该也要从主库读取数