2023年10月17日
摘要: private static ExecutorService executors = new ThreadPoolExecutor(5, 20, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(10), new ThreadF 阅读全文
posted @ 2023-10-17 14:54 十七年蝉 阅读(76) 评论(0) 推荐(0) 编辑
  2023年7月19日
摘要: 在平时业务中我们会发现当分页数据特别大的时候,会出现SQL很慢的情况,下面我们来分析下为什么会出现这种情况以及如何去解决 一、limit深分页问题解析 我们有如下一张表 CREATE TABLE account ( id int(11) NOT NULL AUTO_INCREMENT COMMENT 阅读全文
posted @ 2023-07-19 10:59 十七年蝉 阅读(195) 评论(0) 推荐(0) 编辑
  2023年5月24日
摘要: 使用AOP注解方式在controller接口上实现的请求接口限流 一:核心逻辑 package com.simple.common.aop;import com.simple.common.model.ErrorCode; import com.simple.common.model.Operati 阅读全文
posted @ 2023-05-24 15:51 十七年蝉 阅读(19) 评论(1) 推荐(0) 编辑
  2022年9月22日
摘要: 一、依赖引入 <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.7</version> </dependency> 二、使用HttpCl 阅读全文
posted @ 2022-09-22 19:21 十七年蝉 阅读(271) 评论(0) 推荐(1) 编辑
  2022年8月23日
摘要: public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory t 阅读全文
posted @ 2022-08-23 15:24 十七年蝉 阅读(81) 评论(0) 推荐(0) 编辑
  2022年6月8日
摘要: 在新建一张账单结算信息表bill_settlement_info的时候,建立的唯一索引uk_bill_no(bill_no,tenant_id)。由于列表查询用到该表的字段。所以在sql中自然做了jeft join查询。 on条件是bill.billNo=bill_settlement_info.b 阅读全文
posted @ 2022-06-08 11:35 十七年蝉 阅读(1802) 评论(0) 推荐(0) 编辑
  2022年4月19日
摘要: MySql 事务隔离级别 事务隔离级别 脏读 不可重复读 幻读 读未提交(read-uncommitted) 是 是 是 读已提交(read-committed) 否 是 是 可重复读(repeatable-read) 否 否 是 串行化(serializable) 否 否 否 1、脏读:事务A读取 阅读全文
posted @ 2022-04-19 17:31 十七年蝉 阅读(819) 评论(0) 推荐(0) 编辑
  2021年12月3日
摘要: Java启动线程的代码: new Thread(() -> { // todo }).start(); // JDK 源码 public synchronized void start() { if (threadStatus != 0) throw new IllegalThreadStateEx 阅读全文
posted @ 2021-12-03 16:00 十七年蝉 阅读(152) 评论(0) 推荐(0) 编辑
  2020年11月27日
摘要: // 根据name去重 List<Person> unique = persons.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.compa 阅读全文
posted @ 2020-11-27 15:08 十七年蝉 阅读(5616) 评论(0) 推荐(1) 编辑
  2020年7月20日
摘要: 1 public class TestThreadLocalNpe { 2 private static ThreadLocal<Long> threadLocal = new ThreadLocal(); 3 4 public static void set() { 5 threadLocal.s 阅读全文
posted @ 2020-07-20 13:30 十七年蝉 阅读(464) 评论(0) 推荐(1) 编辑