【快速使用ShardingJDBC的哈希分片策略进行分库分表】

文章目录

  • 🔊博主介绍
  • 🥤本文内容
    • 🍊1.引入maven依赖
    • 🍊2.启动类上添加注解@MapperScan
    • 🍊3.添加application.properties配置
    • 🍊4.普通的自定义实体类
    • 🍊5.写个测试类验证一下
    • 🍊6.控制台打印的日志
    • 🍊7.观察一下数据库的数据
    • 🍊8.maven的setting文件
  • 📢文章总结
  • 📥博主目标

🔊博主介绍

🌟我是廖志伟,一名Java开发工程师、Java领域优质创作者、CSDN博客专家、51CTO专家博主、阿里云专家博主、清华大学出版社签约作者、产品软文专业写手、技术文章评审老师、问卷调查设计师、个人社区创始人、开源项目贡献者。🌎跑过十五公里、🚀徒步爬过衡山、🔥有过三个月减肥20斤的经历、是个喜欢躺平的狠人。

📕拥有多年一线研发和团队管理经验,研究过主流框架的底层源码(Spring、SpringBoot、Spring MVC、SpringCould、Mybatis、Dubbo、Zookeeper),消息中间件底层架构原理(RabbitMQ、RockerMQ、Kafka)、Redis缓存、MySQL关系型数据库、 ElasticSearch全文搜索、MongoDB非关系型数据库、Apache ShardingSphere分库分表读写分离、设计模式、领域驱动DDD、Kubernetes容器编排等。

📙有过从0到1的项目高并发项目开发与管理经验,对JVM调优、MySQL调优、Redis调优 、ElasticSearch调优、消息中间件调优、系统架构调优都有着比较全面的实战经验。

📘有过云端搭建服务器环境,自动化部署CI/CD,弹性伸缩扩容服务器(最高200台),了解过秒级部署(阿里云的ACK和华为云的云容器引擎CCE)流程,能独立开发和部署整个后端服务,有过分库分表的实战经验。

🎥经过多年在CSDN创作上千篇文章的经验积累,我已经拥有了不错的写作技巧,与清华大学出版社签下了四本书籍的合约,并将陆续在明年出版。这些书籍包括了基础篇、进阶篇、架构篇的📌《Java项目实战—深入理解大型互联网企业通用技术》📌,以及📚《解密程序员的思维密码–沟通、演讲、思考的实践》📚。具体出版计划会根据实际情况进行调整,希望各位读者朋能够多多支持!


文章目录

  • 🔊博主介绍
  • 🥤本文内容
    • 🍊1.引入maven依赖
    • 🍊2.启动类上添加注解@MapperScan
    • 🍊3.添加application.properties配置
    • 🍊4.普通的自定义实体类
    • 🍊5.写个测试类验证一下
    • 🍊6.控制台打印的日志
    • 🍊7.观察一下数据库的数据
    • 🍊8.maven的setting文件
  • 📢文章总结
  • 📥博主目标

📚前面提到过【快速使用ShardingJDBC的哈希分片策略进行分表】,接下来就需要对其进行分库了。

🌾阅读前,快速浏览目录和章节概览可帮助了解文章结构、内容和作者的重点。了解自己希望从中获得什么样的知识或经验是非常重要的。建议在阅读时做笔记、思考问题、自我提问,以加深理解和吸收知识。

💡在这个美好的时刻,本人不再啰嗦废话,现在毫不拖延地进入文章所要讨论的主题。接下来,我将为大家呈现正文内容。

🥤本文内容

CSDN

🍊1.引入maven依赖

在pom.xml中添加依赖

<!-- Maven 构建配置 -->
<build><!-- 插件列表 --><plugins><!-- Maven 编译插件 --><plugin><!-- 插件所在 groupId --><groupId>org.apache.maven.plugins</groupId><!-- 插件所在 artifactId --><artifactId>maven-compiler-plugin</artifactId><!-- 插件配置 --><configuration><!-- 源码编译版本 --><source>8</source><!-- 目标编译版本 --><target>8</target></configuration></plugin></plugins>
</build><!-- Maven 依赖管理配置 -->
<dependencyManagement><!-- 依赖列表 --><dependencies><!-- Spring Boot 依赖管理 --><dependency><!-- 依赖所在 groupId --><groupId>org.springframework.boot</groupId><!-- 依赖所在 artifactId --><artifactId>spring-boot-dependencies</artifactId><!-- 依赖版本 --><version>2.3.1.RELEASE</version><!-- 依赖类型 --><type>pom</type><!-- 依赖范围 --><scope>import</scope></dependency></dependencies>
</dependencyManagement><!-- 项目依赖列表 -->
<dependencies><!-- 分库分表组件 Sharding JDBC --><dependency><!-- 依赖所在 groupId --><groupId>org.apache.shardingsphere</groupId><!-- 依赖所在 artifactId --><artifactId>sharding-jdbc-spring-boot-starter</artifactId><!-- 依赖版本 --><version>4.1.1</version></dependency><!-- Spring Boot 核心依赖 --><dependency><!-- 依赖所在 groupId --><groupId>org.springframework.boot</groupId><!-- 依赖所在 artifactId --><artifactId>spring-boot-starter</artifactId></dependency><!-- Spring Boot 测试依赖 --><dependency><!-- 依赖所在 groupId --><groupId>org.springframework.boot</groupId><!-- 依赖所在 artifactId --><artifactId>spring-boot-starter-test</artifactId></dependency><!-- 数据源连接池组件 Druid --><dependency><!-- 依赖所在 groupId --><groupId>com.alibaba</groupId><!-- 依赖所在 artifactId --><artifactId>druid</artifactId><!-- 依赖版本 --><version>1.1.22</version></dependency><!-- MySQL 驱动依赖 --><dependency><!-- 依赖所在 groupId --><groupId>mysql</groupId><!-- 依赖所在 artifactId --><artifactId>mysql-connector-java</artifactId></dependency><!-- MyBatis-Plus 集成依赖 --><dependency><!-- 依赖所在 groupId --><groupId>com.baomidou</groupId><!-- 依赖所在 artifactId --><artifactId>mybatis-plus-boot-starter</artifactId><!-- 依赖版本 --><version>3.0.5</version></dependency>
</dependencies>

🍊2.启动类上添加注解@MapperScan

扫描对应的mapper路径

@MapperScan("com.example.shardingDemo.mapper")
@SpringBootApplication
public class ShardingJDBCApplication {public static void main(String[] args) {SpringApplication.run(ShardingJDBCApplication.class,args);}
}

🍊3.添加application.properties配置

# 哈希分片策略分库分表
# 设置数据源名称为 m1
spring.shardingsphere.datasource.names=m1,m2
# 设置数据源类型为 Druid 数据源
spring.shardingsphere.datasource.m1.type=com.alibaba.druid.pool.DruidDataSource
# 设置数据源驱动为 MySQLJDBC 驱动
spring.shardingsphere.datasource.m1.driver-class-name=com.mysql.cj.jdbc.Driver
# 设置数据源连接 URL,连接本地 MySQL 数据库的 userdb 库
spring.shardingsphere.datasource.m1.url=jdbc:mysql://192.168.122.128:3306/masterdemo?serverTimezone=GMT%2B8
# 设置连接数据库所需的用户名和密码
spring.shardingsphere.datasource.m1.username=root
spring.shardingsphere.datasource.m1.password=bfb8f36cc2616995
# 设置数据源名称为 m2
spring.shardingsphere.datasource.m2.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.m2.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.m2.url=jdbc:mysql://192.168.122.128:3306/masterdemo2?serverTimezone=GMT%2B8
spring.shardingsphere.datasource.m2.username=root
spring.shardingsphere.datasource.m2.password=bfb8f36cc2616995
# 设置分片表的实际数据节点,对应两个数据表:m1.t_user_1 和 m1.t_user_2
spring.shardingsphere.sharding.tables.user.actual-data-nodes=m$->{1..2}.t_user_$->{1..2}
# 设置分片键为 user_id
spring.shardingsphere.sharding.tables.user.key-generator.column=user_id
# 设置分布式 ID 生成算法为 SNOWFLAKE 算法,worker ID1
spring.shardingsphere.sharding.tables.user.key-generator.type=SNOWFLAKE
# Spring Boot 应用配置项:ShardingSphere 分库分表配置之课程表的主键生成策略配置项,属性名: worker.id,属性值: 1 (表示该应用程序所使用的 Snowflake 算法的工作节点 ID1)
spring.shardingsphere.sharding.tables.user.key-generator.props.worker.id=1
# 设置分表算法为 inline 分片算法,分片列为 user_id,分片规则为课程编号为奇数的记录在 m1.t_user_1 表中,课程编号为偶数的记录在 m1.t_user_2 表中
spring.shardingsphere.sharding.tables.user.table-strategy.inline.sharding-column=user_id
# table-strategy.inline:表示使用内联表达式的分片策略。lgorithm-expression:表示表名生成算法表达式。t_user_$->{user_id%2+1}:表示生成的表名,即t_user_后面接下标为(user_id%2+1)的表。
# user_id是表中的一个自增主键,%2表示对2取余数,+1表示取余结果加1,即user_id值为偶数进入到t_user_1表,user_id值为奇数进入到t_user_2表。
spring.shardingsphere.sharding.tables.user.table-strategy.inline.algorithm-expression=t_user_$->{user_id%2+1}
# 使用 SpringShardingSphere 进行数据库分片,将 user 表根据 user_id 字段进行分片,数据库策略为 inline,即使用算法表达式进行分片
spring.shardingsphere.sharding.tables.user.database-strategy.inline.sharding-column=user_id
# 用户 ID2取余再加1,结果为12,根据结果选择数据库 m1 或 m2 进行存储
spring.shardingsphere.sharding.tables.user.database-strategy.inline.algorithm-expression=m$->{user_id%2+1}
# 设置 SQL 显示开启,方便调试
spring.shardingsphere.props.sql.show=true
# 允许覆盖 Bean 定义,用于调试时快速更新配置
spring.main.allow-bean-definition-overriding=true

🍊4.普通的自定义实体类

import lombok.Data;
@Data
public class User {private int userId;private String userName;private String status;private int age;
}

🍊5.写个测试类验证一下

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.shardingDemo.entity.Course;
import com.example.shardingDemo.entity.Dict;
import com.example.shardingDemo.entity.User;
import com.example.shardingDemo.mapper.CourseMapper;
import com.example.shardingDemo.mapper.DictMapper;
import com.example.shardingDemo.mapper.UserMapper;
import org.apache.shardingsphere.api.hint.HintManager;
import org.junit.Test;
import org.junit.jupiter.api.Tags;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;@RunWith(SpringRunner.class)
@SpringBootTest
public class ShardingJDBCTest {@ResourceCourseMapper courseMapper;@ResourceDictMapper dictMapper;@ResourceUserMapper userMapper;@Testpublic void addUser(){for(int i = 0 ; i < 10 ; i ++){User user = new User();user.setUserId(i);user.setUserName("张三"+i);user.setAge(i);user.setStatus("1");userMapper.insert(user);}}
}

🍊6.控制台打印的日志

  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.3.1.RELEASE)2023-11-08 19:05:14.284  INFO 20848 --- [           main] c.e.a.ShardingJDBCTest                   : Starting ShardingJDBCTest on WIN-20230222ULN with PID 20848 (started by Administrator in E:\WarkSpace\基础篇书籍\第8章\apache-shardingsphere-demo)
2023-11-08 19:05:14.285  INFO 20848 --- [           main] c.e.a.ShardingJDBCTest                   : No active profile set, falling back to default profiles: default
2023-11-08 19:05:14.668  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.675  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere.sharding-org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.sharding.SpringBootShardingRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.678  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere.masterslave-org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.masterslave.SpringBootMasterSlaveRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.680  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere.encrypt-org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.encrypt.SpringBootEncryptRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.682  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere.shadow-org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.shadow.SpringBootShadowRuleConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.685  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere-org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.common.SpringBootPropertiesConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.811  INFO 20848 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration' of type [org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$bfc54c27] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-11-08 19:05:14.990  INFO 20848 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2023-11-08 19:05:15.410  INFO 20848 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-2} inited
2023-11-08 19:05:15.462  INFO 20848 --- [           main] o.a.s.core.log.ConfigurationLogger       : ShardingRuleConfiguration:
tables:user:actualDataNodes: m$->{1..2}.t_user_$->{1..2}databaseStrategy:inline:algorithmExpression: m$->{user_id%2+1}shardingColumn: user_idkeyGenerator:column: user_idprops:worker.id: '1'type: SNOWFLAKElogicTable: usertableStrategy:inline:algorithmExpression: t_user_$->{user_id%2+1}shardingColumn: user_id2023-11-08 19:05:15.462  INFO 20848 --- [           main] o.a.s.core.log.ConfigurationLogger       : Properties:
sql.show: 'true'2023-11-08 19:05:15.471  INFO 20848 --- [           main] ShardingSphere-metadata                  : Loading 1 logic tables' meta data.
2023-11-08 19:05:15.520  INFO 20848 --- [           main] ShardingSphere-metadata                  : Meta data load finished, cost 58 milliseconds._ _   |_  _ _|_. ___ _ |    _ 
| | |\/|_)(_| | |_\  |_)||_|_\ /               |         3.0.5 
2023-11-08 19:05:15.618  WARN 20848 --- [           main] c.b.m.core.toolkit.TableInfoHelper       : Warn: Could not find @TableId in Class: com.example.apacheshardingspheredemo.entity.Course.
2023-11-08 19:05:15.687  WARN 20848 --- [           main] c.b.m.core.toolkit.TableInfoHelper       : Warn: Could not find @TableId in Class: com.example.apacheshardingspheredemo.entity.Dict.
2023-11-08 19:05:15.699  WARN 20848 --- [           main] c.b.m.core.toolkit.TableInfoHelper       : Warn: Could not find @TableId in Class: com.example.apacheshardingspheredemo.entity.User.
2023-11-08 19:05:15.786  INFO 20848 --- [           main] c.e.a.ShardingJDBCTest                   : Started ShardingJDBCTest in 1.657 seconds (JVM running for 2.159)
2023-11-08 19:05:16.150  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.150  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@63e70bf9), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@63e70bf9, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[0, 张三0, 1, 0])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[0])])
2023-11-08 19:05:16.150  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m1 ::: INSERT INTO t_user_1  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [0, 张三0, 1, 0]
2023-11-08 19:05:16.171  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.171  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@67dc6b48), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@67dc6b48, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[1, 张三1, 1, 1])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[1])])
2023-11-08 19:05:16.171  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m2 ::: INSERT INTO t_user_2  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [1, 张三1, 1, 1]
2023-11-08 19:05:16.174  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.174  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@11cadb32), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@11cadb32, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[2, 张三2, 1, 2])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[2])])
2023-11-08 19:05:16.174  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m1 ::: INSERT INTO t_user_1  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [2, 张三2, 1, 2]
2023-11-08 19:05:16.177  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.178  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@704c3bdf), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@704c3bdf, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[3, 张三3, 1, 3])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[3])])
2023-11-08 19:05:16.178  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m2 ::: INSERT INTO t_user_2  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [3, 张三3, 1, 3]
2023-11-08 19:05:16.181  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.181  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@605eb072), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@605eb072, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[4, 张三4, 1, 4])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[4])])
2023-11-08 19:05:16.181  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m1 ::: INSERT INTO t_user_1  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [4, 张三4, 1, 4]
2023-11-08 19:05:16.184  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.184  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@43fd77d8), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@43fd77d8, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[5, 张三5, 1, 5])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[5])])
2023-11-08 19:05:16.184  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m2 ::: INSERT INTO t_user_2  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [5, 张三5, 1, 5]
2023-11-08 19:05:16.187  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.187  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@32ba5c65), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@32ba5c65, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[6, 张三6, 1, 6])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[6])])
2023-11-08 19:05:16.187  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m1 ::: INSERT INTO t_user_1  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [6, 张三6, 1, 6]
2023-11-08 19:05:16.191  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.191  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@5d96d434), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@5d96d434, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[7, 张三7, 1, 7])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[7])])
2023-11-08 19:05:16.191  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m2 ::: INSERT INTO t_user_2  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [7, 张三7, 1, 7]
2023-11-08 19:05:16.195  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.195  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@13dd7887), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@13dd7887, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[8, 张三8, 1, 8])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[8])])
2023-11-08 19:05:16.195  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m1 ::: INSERT INTO t_user_1  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [8, 张三8, 1, 8]
2023-11-08 19:05:16.199  INFO 20848 --- [           main] ShardingSphere-SQL                       : Logic SQL: INSERT INTO user  ( user_id,
user_name,
status,
age )  VALUES  ( ?,
?,
?,
? )
2023-11-08 19:05:16.199  INFO 20848 --- [           main] ShardingSphere-SQL                       : SQLStatement: InsertStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement@538aa83f, tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@44de8e00), tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@44de8e00, columnNames=[user_id, user_name, status, age], insertValueContexts=[InsertValueContext(parametersCount=4, valueExpressions=[ParameterMarkerExpressionSegment(startIndex=65, stopIndex=65, parameterMarkerIndex=0), ParameterMarkerExpressionSegment(startIndex=68, stopIndex=68, parameterMarkerIndex=1), ParameterMarkerExpressionSegment(startIndex=71, stopIndex=71, parameterMarkerIndex=2), ParameterMarkerExpressionSegment(startIndex=74, stopIndex=74, parameterMarkerIndex=3)], parameters=[9, 张三9, 1, 9])], generatedKeyContext=Optional[GeneratedKeyContext(columnName=user_id, generated=false, generatedValues=[9])])
2023-11-08 19:05:16.199  INFO 20848 --- [           main] ShardingSphere-SQL                       : Actual SQL: m2 ::: INSERT INTO t_user_2  ( user_id,
user_name,
status,
age )  VALUES  (?, ?, ?, ?) ::: [9, 张三9, 1, 9]
2023-11-08 19:05:16.207  INFO 20848 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...
2023-11-08 19:05:16.208  INFO 20848 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed
2023-11-08 19:05:16.209  INFO 20848 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-2} closing ...
2023-11-08 19:05:16.209  INFO 20848 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-2} closed
Disconnected from the target VM, address: '127.0.0.1:53866', transport: 'socket'Process finished with exit code 0

🍊7.观察一下数据库的数据

masterdemo.t_user_1表的数据如图下所示:
masterdemo.t_user_1表

可以发现masterdemo库的t_user_1表的user_id都是偶数,masterdemo库的t_user_2表没有数据。

masterdemo2.course_2表的数据如图下所示:
masterdemo2.course_2表

可以发现masterdemo2库的t_user_2表的user_id都是奇数,masterdemo2库的t_user_1表没有数据。

🍊8.maven的setting文件

为了避免部分同学下载依赖包不一致导致maven依赖下载不下来,我这里给上自己的配置文件,代码如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Maven 的配置文件 -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0http://maven.apache.org/xsd/settings-1.1.0.xsd"><!-- 设置本地仓库的路径 --><localRepository>D:\Java\ReMaven</localRepository><!-- 设置镜像 --><mirrors><mirror><id>central</id><url>https://repo1.maven.org/maven2/</url><mirrorOf>*</mirrorOf></mirror><!-- 定义一个镜像 --><!-- <mirror><id>aliyunmaven</id> <name>Alibaba Maven Mirror</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>--><mirror><id>aliyunmaven</id><!-- 镜像的id --><mirrorOf>*</mirrorOf><!-- 镜像代理的仓库id,这里将中央仓库的地址替换为阿里云的地址 --><name>阿里云公共仓库</name><!-- 镜像的名称 --><url>https://maven.aliyun.com/repository/public</url><!-- 镜像的地址 --></mirror></mirrors><!-- 设置代理 --><proxies></proxies><!-- 设置私有仓库的认证信息 --><servers></servers><!-- 定义构建时添加的环境参数 --><profiles><!-- 定义一个profile --><profile><id>jdk-1.8</id> <!-- profile的id --><activation> <!-- 激活条件 --><activeByDefault>true</activeByDefault> <!-- 默认激活 --><jdk>1.8</jdk> <!-- 使用的JDK版本 --></activation><properties> <!-- 定义环境变量 --><maven.compiler.source>1.8</maven.compiler.source> <!-- 编译代码的源版本 --><maven.compiler.target>1.8</maven.compiler.target> <!-- 编译代码的目标版本 --><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- 项目源码的编码方式 --><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!-- 项目输出的编码方式 --><java.version>1.8</java.version> <!-- 使用的Java版本 --></properties></profile></profiles><!-- 设置默认激活的环境 --><activeProfiles><activeProfile>jdk-1.8</activeProfile> <!-- 默认激活的profile --></activeProfiles>
</settings>

CSDN

📢文章总结

对本篇文章进行总结:

🔔以上就是今天要讲的内容,阅读结束后,反思和总结所学内容,并尝试应用到现实中,有助于深化理解和应用知识。与朋友或同事分享所读内容,讨论细节并获得反馈,也有助于加深对知识的理解和吸收。

以梦为马,不负韶华

🔔如果您需要转载或者搬运这篇文章的话,非常欢迎您私信我哦~

🚀🎉希望各位读者大大多多支持用心写文章的博主,现在时代变了,🚀🎉 信息爆炸,酒香也怕巷子深🔥,博主真的需要大家的帮助才能在这片海洋中继续发光发热🎨,所以,🏃💨赶紧动动你的小手,点波关注❤️,点波赞👍,点波收藏⭐,甚至点波评论✍️,都是对博主最好的支持和鼓励!

  • 💂 博客主页: 我是廖志伟
  • 👉开源项目:java_wxid
  • 🌥 哔哩哔哩:我是廖志伟
  • 🎏个人社区:幕后大佬
  • 🔖个人微信号SeniorRD
  • 🎉微信号二维码SeniorRD

📥博主目标

探寻内心世界,博主分享人生感悟与未来目标

  • 🍋程序开发这条路不能停,停下来容易被淘汰掉,吃不了自律的苦,就要受平庸的罪,持续的能力才能带来持续的自信。我本是一个很普通的程序员,放在人堆里,除了与生俱来的盛世美颜,就剩180的大高个了,就是我这样的一个人,默默写博文也有好多年了。
  • 📺有句老话说的好,牛逼之前都是傻逼式的坚持,希望自己可以通过大量的作品、时间的积累、个人魅力、运气、时机,可以打造属于自己的技术影响力。
  • 💥内心起伏不定,我时而激动,时而沉思。我希望自己能成为一个综合性人才,具备技术、业务和管理方面的精湛技能。我想成为产品架构路线的总设计师,团队的指挥者,技术团队的中流砥柱,企业战略和资本规划的实战专家。
  • 🎉这个目标的实现需要不懈的努力和持续的成长,但我必须努力追求。因为我知道,只有成为这样的人才,我才能在职业生涯中不断前进并为企业的发展带来真正的价值。在这个不断变化的时代,我们必须随时准备好迎接挑战,不断学习和探索新的领域,才能不断地向前推进。我坚信,只要我不断努力,我一定会达到自己的目标。

🔔有需要对自己进行综合性评估,进行职业方向规划,我可以让技术大牛帮你模拟面试、针对性的指导、传授面试技巧、简历优化、进行技术问题答疑等服务。

可访问:https://java_wxid.gitee.io/tojson/

开发人员简历优化、面试突击指导、技术问题解答

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/185853.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

c#如何把字符串中的指定字符删除

可以使用以下四种方法&#xff1a; 一、使用关键字&#xff1a;Replace public string Replace(char oldChar,char newChar); 在对象中寻找oldChar&#xff0c;如果寻找到&#xff0c;就用newChar将oldChar替换掉。 1、实例代码&#xff1a; 2、执行结果&#xff1a; 二、Rem…

洛谷P5731 【深基5.习6】蛇形方阵java版题解

import java.util.Arrays; import java.util.Scanner;// 给出一个不大于9的正整数n&#xff0c;输出nn的蛇形方阵。 public class Main {public static void main(String[] args) {Scanner sc new Scanner(System.in);int n sc.nextInt();int[][] a new int[n][n];int total…

AWTK 与 Qt 的异同点比较

相似之处&#xff1a; 跨平台支持&#xff1a; AWTK 和 Qt 都提供了跨平台的支持&#xff0c;可以在多种操作系统上进行开发和部署&#xff0c;包括 Windows、Linux、macOS 等。丰富的组件库&#xff1a; 两者都提供了丰富的图形界面组件库&#xff0c;能够满足各种应用程序的…

在Google Kubernetes集群创建分布式Jenkins(二)

上一篇博客在Google Kubernetes集群创建分布式Jenkins(一)-CSDN博客我介绍了如何在GCP的K8S集群上部署一个分布式的Jenkins&#xff0c;并实现了一个简单的Pipeline的运行。 在实际的开发中&#xff0c;我们通常都会按照以下的CICD流程来设置Pipeline 在我司的实际实践中&…

Spring Cloud之多级缓存

目录 传统缓存 多级缓存 JVM进程缓存 Caffeine 缓存驱逐策略 实现进程缓存 常用Lua语法 数据类型 变量声明 循环使用 定义函数 条件控制 安装OpenResty 实现Nginx业务逻辑编写 请求参数解析 实现lua访问tomcat JSON的序列化和反序列化 Tomcat的集群负载均衡 …

MacOS升级后命令行出现xcrun: error: invalid active developer path报错信息

在Mac上用g编译cpp文件时&#xff0c;出现以下&#xff08;类似于工具环境问题的&#xff09;报错&#xff1a; 解决方案&#xff1a;重新安装最新版的MacOS Command Line Tools xcode-select --install重新尝试编译&#xff1a; 编译成功&#xff08;忽略这个warning&…

vue中插槽slot

一、插槽-默认插槽 1.作用 让组件内部的一些 结构 支持 自定义 2.需求 将需要多次显示的对话框,封装成一个组件 3.问题 组件的内容部分&#xff0c;不希望写死&#xff0c;希望能使用的时候自定义。怎么办 4.插槽的基本语法 组件内需要定制的结构部分&#xff0c;改用&l…

OpenCV 图像复制和图像区域读写

图像复制 共享数据, 使用 new Mat(srcMat, ...) 和 newMatsrcMat 生成新的Mat都和原Mat共享数据, 也就是说如果修改某一Mat,其他Mat也会随之改变复制全新的Mat, 使用CopyTo() 和 Clone() 方法将生成一个全新的Mat, 新Mat和原Mat不共享数据. 图像区域和点的读写 区域读取: 通过s…

线上 kafka rebalance 解决

上周末我们服务上线完毕之后发生了一个kafka相关的异常&#xff0c;线上的kafka频繁的rebalance&#xff0c;详细的报错我已经贴到下面&#xff0c;根据字面意思&#xff1a;消费者异常 org.apache.kafka.clients.consumer.CommitFailedException: 无法完成提交&#xff0c;因为…

《第三期(先导课)》之《Python 开发环境搭建》

文章目录 《第 1 节 初始Python》《第 6 节 pip包管理工具》 《第 1 节 初始Python》 。。。 《第 6 节 pip包管理工具》 pip是Python的包管理工具,用于安装、升级和管理Python包。 pip是Python标准库之外的一个第三方工具,可以从Python Package Index(PyPI)下载和安装各种P…

C4D移动坐标轴位置的技巧

我们所创建的模型&#xff0c;刚创建的时候中心的位置就是中心坐标的位置了&#xff0c;如图所示 我们可以选择一个视图模式更好的观察效果 文章源自四五设计网-https://www.45te.com/35303.html 然后将模型给C掉 这样模型变成了可以编辑的模式后&#xff0c;选择左侧的坐标选…

软件测试|selenium执行js脚本

JavaScript是运行在客户端&#xff08;浏览器&#xff09;和服务器端的脚本语言&#xff0c;允许将静态网页转换为交互式网页。可以通过 Python Selenium WebDriver 执行 JavaScript 语句&#xff0c;在Web页面中进行js交互。那么js能做的事&#xff0c;Selenium应该大部分也能…

SLAM从入门到精通(被忽视的基础图像处理)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 工业上用激光slam的多&#xff0c;用视觉slam的少&#xff0c;这是大家都知道的常识。毕竟对于工业来说&#xff0c;健壮和稳定是我们必须要考虑的…

MySQL的表格去重,史上最简便的算法,一看就会

首先&#xff0c;表格my_tab02存在很多重复的数据&#xff1a; #表格的去重 方法一&#xff1a; 详细内容传送门&#xff1a;表格的去重 -- 思路&#xff1a; -- 1.先创建一张临时表 my_tmp,该表的结构和my_tab02一样 -- 2.把my_tmp的记录通过distinct关键字 处理后 把记录复…

Spring Boot 请求/actuator/beans 无法访问 返回404

问题复现 在保证项目加入了spring-boot-starter-actuator依赖&#xff0c;并成功启动后。通过浏览器进行访问&#xff0c;返回如下图结果&#xff1a; 问题排查 1. 查看日志 从日志中可以看到基于路径’/actuator’下只暴露了一个端点 2. 访问http://localhost:8080/actua…

机器视觉opencv答题卡识别系统 计算机竞赛

0 前言 &#x1f525; 优质竞赛项目系列&#xff0c;今天要分享的是 &#x1f6a9; 答题卡识别系统 - opencv python 图像识别 该项目较为新颖&#xff0c;适合作为竞赛课题方向&#xff0c;学长非常推荐&#xff01; &#x1f947;学长这里给一个题目综合评分(每项满分5分…

改进YOLOv5:结合ICCV2023|动态蛇形卷积,构建不规则目标识别网络

🔥🔥🔥 提升多尺度、不规则目标检测,创新提升 🔥🔥🔥 🔥🔥🔥 捕捉图像特征和处理复杂图像特征 🔥🔥🔥 👉👉👉: 本专栏包含大量的新设计的创新想法,包含详细的代码和说明,具备有效的创新组合,可以有效应用到改进创新当中 👉👉👉: �…

C++ http协议POST body raw 字段向服务器发送请求

环境&#xff1a;ubuntu系统c使用http协议不是很方便&#xff0c;通过curl库我们可以很方便使用http协议&#xff0c;由于我的请求方式比较特殊&#xff0c;在网上没有找到相关的资料&#xff0c;之前使用python实现过一版&#xff0c;但是当设备数量超过100台时&#xff0c;程…

操作系统 day08(进程通信)

进程通信的概念 进程间通信是指两个进程之间产生数据交互进程通信需要操作系统的支持&#xff0c;由于进程是分配系统资源&#xff08;包括内存地址&#xff09;的单位&#xff0c;因此各进程拥有的内存地址空间相互独立。同时为了保证安全&#xff0c;一个进程不能直接访问另…

Android Glide transform旋转rotate圆图CircleCrop,Kotlin

Android Glide transform旋转rotate圆图CircleCrop&#xff0c;Kotlin import android.graphics.Bitmap import android.os.Bundle import android.util.Log import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity import com.bumptech.glide.load…