01-2021年6月

2021年6月20日22:05:43

  1. Spring源码阅读:
    1.1 wrapIfNecessary
    1.2 判断是否为空: StringUtils.hasLength(beanName);
    1.3 使用布尔的包装类: Boolean.FALSE.equals(this.advisedBeans.get(cacheKey))
    1.4 判断Advice类是否是beanClass的父类: Advice.class.isAssignableFrom(beanClass)
    1.5 语法规则:
    父类.class.isAssignableFrom(子类.class)
    子类实例 instanceof 父类类型
    1.6 AOP原理: 动态代理
    createProxy(bean.getClass(), beanName, specificInterceptors, new SingletonTargetSource(bean));

2021年6月23日07:02:09

  1. 关于 Mybatis 批量更新
    使用 标签的时候, 如果参数中有?特殊字符, 会发生参数错位的情况, 最后使用批量update处理.
  2. 中文官网:
    https://mybatis.org/mybatis-3/zh/dynamic-sql.html

2021年6月27日09:58:16

  1. @Configuration 没有配置这个注解事务是没有用的
  2. 图灵学院vip学院笔记
    1. JVM专题
    2. JavaSE专题
    3. 并发专题
    4. Spring专题
    4.1 Spring源码编译教程
    4.2 手写模拟Spring框架核心逻辑
    4.3 Spring中核心概念详解
    4.4 Spring中Bean的生命周期详解
    4.5 Spring中依赖注入源码解析
    4.6 ApplicationContext启动过程
    4.7 Spring解析配置类
    4.8 Spring中的推断构造方法
    4.9 Spring整合Mybatis核心原理
    4.10 Spring循环依赖源码解析
    4.11 Spring中AOP底层原理分析
    4.12 Spring中事务的底层工作原理
    5. SpringMVC专题
    6. SpringBoot专题
    7. Mybatis专题
    周瑜老师之前讲过的VIP课程
    Spring相关知识点脑图

架构师学习线路

2021年6月29日00:26:19

  1. 马士兵教育

  2. Spring源码常见问题:
    2.1 方法论: 如何高效的学习源码
    2.2 SpringIOC源码
    2.3 Spring程序的启动
    2.4 Spring是如何加载配置文件到应用程序的?
    2.5 核心接口: BeanDefinitionReader
    2.6 核心接口: BeanFactory
    2.7 彻底搞懂Spring的refresh方法
    2.8 BeanPostProcessor 接口的作用及实现
    2.9 BeanFactoryPostProcessor接口的作用及实现
    2.10 Spring Bean有没有必要实现Aware接口
    2.11 Spring Bean 实例化过程大揭秘
    2.12 Spring Bean 初始化到底干了什么
    2.13 彻底理解 FactoryBean 接口
    2.14 完美解释Spring Bean的生命周期
    2.15 Spring的Environment接口有什么作用
    2.16 为什么会产生循环依赖问题
    2.17 循环依赖在Spring中是如何解决的
    2.18 Spring IOC面试题

  3. Recent Files 这个是否可以启用呢?
    3.1 默认快捷键: Ctrl + E 可以试试

https://zhuanlan.zhihu.com/p/366436588

2021年7月1日22:55:53

  1. 去哪里找IDEA的离线插件: 插件官网

  2. 因为有几个有用的插件版本不匹配

  3. 创建对象几种方式:
    3.1 构造方法
    3.2 反射
    3.3 克隆(意义不大)
    3.4 序列化(意义不大)

  4. 反射:
    Class clazz = Class.forName();
    Class clazz = 类名.class;
    Class clazz = 对象名.getClass();
    Constructor ctor = clazz.getDeclareConstructor();
    Object obj = ctor.newInstance();

2021年7月2日07:10:05

  1. Mybatis-Log-Plugin:
    在这里插入图片描述

2021年7月4日17:22:11

  1. 词汇: 动词
    处理: process

  2. 词汇: 名词:
    候选者: Candidate

  3. List排序:

configCandidates.sort((bd1, bd2) -> { 	
	int i1 = ConfigurationClassUtils.getOrder(bd1.getBeanDefinition()); 	
	int i2 = ConfigurationClassUtils.getOrder(bd2.getBeanDefinition()); 	
	return Integer.compare(i1, i2); 
});
  1. 集合的容量这里这样指定:
Set<ConfigurationClass> alreadyParsed = new HashSet<>(configCandidates.size());
  1. 表达是否应该的含义:

词汇:

是否应该: should

if (this.conditionEvaluator.shouldSkip(configClass.getMetadata(), ConfigurationPhase.PARSE_CONFIGURATION)) {

2021年7月5日05:56:12

  1. 快捷键:
    翻译: Alt + T 似乎更加顺手一点.

2021年7月6日07:22:15

  1. 有空也要背一下面试题, 可能当时不理解, 其实后期还是很有用的.

2021年7月7日08:10:14

  1. http://plugins.jetbrains.com/

  2. mybatis-log-plugin

2021年7月9日07:59:32

  1. 参考博客: 注释掉的字体改成黄色:
    https://blog.csdn.net/weixin_41298572/article/details/89630972

  2. Editor -> Color Scheme -> Language Defaults -> Comments -> Line comment

  3. CodeSheep: 很厉害的博主
    https://github.com/rd2coding/Road2Coding

2021年7月13日07:31:21

  1. @SuppressWarnings(“serial”)
    参考博客: https://blog.csdn.net/csdn972356101/article/details/84249597

  2. 看着就舒服:

Assert.notNull(other, "Other ProxyConfig object must not be null");
  1. 两个常用的动词:
if (!proxyFactory.isProxyTargetClass()) {
	if (shouldProxyTargetClass(beanClass, beanName)) {
		proxyFactory.setProxyTargetClass(true);
	}
	else {
		evaluateProxyInterfaces(beanClass, proxyFactory);
	}
}

should: 是否应该呢?
evaluate: 有评估的意思

  1. @link 标签的使用:
 * Check the interfaces on the given bean class and apply them to the {@link ProxyFactory},
 * if appropriate.
  1. IDEA:

Cc: Match Case: Alt + C
Use Tab to focus on an option, and Space to toggle it

Words: Alt + Words
use Tab to focus on an option, and Space to toggle it

Regex: Alt + X
Use Tab to focus on an option, and Space to toggle it

IDEA: Match Case, Words, Regex作用
参考博客: https://localhost.blog.csdn.net/article/details/100052759

  1. 定制: customize
customizeProxyFactory(proxyFactory);
  1. frozen: 冰冻, 固化的含义
proxyFactory.setFrozen(this.freezeProxy);
  1. @NotNull 和 @Nullable

在写程序的时候你可以定义是否可为空指针。通过使用像@NotNull和@Nullable之类的annotation来声明一个方法是否是空指针安全的。现代的编译器、IDE或者工具可以读此annotation并帮你添加忘记的空指针检查,或者向你提示出不必要的乱七八糟的空指针检查。IntelliJ和findbugs已经支持了这些annotation。这些annotation同样是JSR 305的一部分,但即便IDE或工具中没有,这个annotation本身可以作为文档。看到@NotNull和@Nullable,程序员自己可以决定是否做空指针检查。顺便说一句,这个技巧对Java程序员来说相对比较新,要采用需要一段时间。
参考博客:
https://blog.csdn.net/kuyuyingzi/article/details/16973429

  1. toString(): 可以使用String.valueOf();
BigDecimal bd = getPrice();
System.out.println(String.valueOf(bd)); //不会抛出空指针异常
System.out.println(bd.toString()); //抛出 "Exception in thread "main" java.lang.NullPointerException" 

2021年7月14日07:27:49

  1. 这里可以看到PDM/PLM:
    在这里插入图片描述

2021年7月16日08:20:29

  1. 关于处理历史数据的方案, 如果有Deme就更好了:
    参考博客: https://blog.csdn.net/KuaiLeShiFu/article/details/49388011

  2. 可以看看是否适用:

package com.jzt.web;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TreeSet;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jzt.dao.mapper.CampaignMapper;
import com.jzt.domain.Campaign;
import com.keyword.dao.mapper.KeywordMapper;
import com.keyword.domain.Keyword;
import com.keyword.domain.PagePackage;

@RequestMapping("/keywordv2")
@Controller
public class KeywordV2Controller {
	private final static Logger logger = LoggerFactory.getLogger(ChangeDataController.class);

	private final static Integer PAGESIZE = 2000;

	private Integer threadSize = 20;

	private boolean flag = true;

	/**
	 * 使用20个线程, 需要根据服务器的core决定, 否则资源被浪费在线程的竞争中
	 */
	private ExecutorService services = Executors.newFixedThreadPool(threadSize);

	/**
	 * 阻塞队列
	 */
	final BlockingQueue queue = new ArrayBlockingQueue(20000);

	@Resource
	private KeywordMapper keywordMappper;

	@Resource
	private CampaignMapper campaignMapper;

	@ResponseBody
	@RequestMapping("/go")
	public void handleAll(String table) {
		if (table != null) {
			String tableName = "ad_keyword_" + table;
			Keyword param = new Keyword();
			param.setTableName(tableName);
			Integer total = keywordMappper.queryCountByParam(param);
			final int pageCount = (int) Math.ceil((double) total / PAGESIZE);
			handleOneTable(tableName, total, pageCount);
		} else {
			BlockingQueue tables = new ArrayBlockingQueue(25);
			for (int i = 466; i <= 490; i++) {
				tables.add(i);
			}
			logger.info("进入while....466开始");
			while (tables.size() > 0) {
				if (new Date().getDay() == 2 && new Date().getHours() >= 1) {    //晚上21点再次启动
					flag = true;
				} else {
					flag = false;
				}
				while (flag) {
					flag = false;
					String tableName = null;
					try {
						tableName = "ad_keyword_" + tables.take();
						if (new Date().getHours() > 5 && new Date().getHours() < 21) {
							logger.info(">>>>>>>>>>>>>>>>>>>>" + tableName);
							flag = false;
							break;
						}
					} catch (InterruptedException e) {
						logger.info(e.toString());
					}
					Keyword param = new Keyword();
					param.setTableName(tableName);
					Integer total = keywordMappper.queryCountByParam(param);
					final int pageCount = (int) Math.ceil((double) total / PAGESIZE);  //总页数
					handleOneTable(tableName, total, pageCount);
				}  //END flag
			} //END startUp
		}
	}

	private void handleOneTable(final String tableName, Integer total, final int pageCount) {
		logger.info("关键词刷数据开始...");
		Keyword param = new Keyword();
		param.setTableName(tableName);
		logger.info(String.format("查询关键词表[%s]总数[%s]每页[%s]共[%s]页", tableName, total, PAGESIZE, pageCount));
		//取执行记录起始点的id
		Long idIndex = 0L;
		List firstRecord = keywordMappper.queryFirstKeyword(param);
		if (firstRecord != null && firstRecord.size() == 1) {
			idIndex = firstRecord.get(0).getId() - 1;
			logger.info(tableName + "从id=" + idIndex + "开始执行");
		}
		param.setPageSize(PAGESIZE);
		PagePackage pagePackage = null;
		for (int page = 1; page <= pageCount; page++) {
			param.setId(idIndex);
			pagePackage = new PagePackage();
			// 分页获取关键词
			final List keywordResult = keywordMappper.queryListByPage(param);
			if (keywordResult != null && keywordResult.size() > 0) {
				pagePackage.setTableName(tableName);
				pagePackage.setKeywords(keywordResult);
				pagePackage.setPageIndex(page);
				pagePackage.setPageSize(keywordResult.size());
				pagePackage.setPageCount(pageCount);
				queue.add(pagePackage);  //向队列中添加要处理的一页数据对象
				idIndex = keywordResult.get(keywordResult.size() - 1).getId();
			}
		}

		for (int i = 0; i
		services.execute(new Runnable() {
			@Override
			public void run() {
				updateRunnable(tableName, queue);
			}
		});
	}
       while(queue.size()>0)

	{
		flag = false;//主线程阻塞
	}

	flag=true;
       logger.info("关键词刷数据结束....");
}


	private void updateRunnable(final String tableName, final BlockingQueue queue) {
		boolean flag2 = true;
		while (flag2) {
			try {
				PagePackage page = queue.take();  //如果队列为空,就等待
				if (page != null) {
					updateOnePage(page);
				} else {
					flag2 = false;

				}
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	private void updateOnePage(PagePackage page) {
		List keywords = page.getKeywords();
		String tableName = page.getTableName();
		Integer pageIndex = page.getPageIndex();
		Integer pageCount = page.getPageCount();
		int hour = new Date().getHours();
		if (new Date().getDay() == 2 && hour >= 1 && hour < 6) {  //0:星期日   1:星期一
			logger.info(String.format("关键词表[%s]的第[%s]页共[%s]页数据处理start...", tableName, pageIndex, pageCount));
			//1.对这一页关键词统计所有的计划ID
			List campaignIds = null;
			List ids = new ArrayList();
			for (Keyword k : keywords) {
				if (k.getCampaignId() != null) {
					ids.add(k.getCampaignId());
				} else {
					logger.info(String.format("【[%s]】表中关键词[%s]没有计划id", tableName, k.getId()));
				}
			}
			campaignIds = new ArrayList(new TreeSet(ids));
			try {
				//2.根据计划id查询出所有计划
				Campaign param = new Campaign();
				param.setIds(campaignIds);
				List campaigns = campaignMapper.queryListByParam(param);
				if (campaigns == null || campaigns.size() == 0) {
					logger.info(String.format("【[%s]】表中关键词所属计划列表为空", tableName));
					return;
				}
				//3.填充待回改的关键词信息,并触发执行更新关键词的SQL
				for (Keyword keyword : keywords) {
					keyword.setYn(null);
					for (Campaign campaign : campaigns) {
						if (keyword.getCampaignId().compareTo(campaign.getId()) == 0) {
							if (campaign.getYn() != null && campaign.getYn() == 0) {
								keyword.setYn(campaign.getYn());
							}
							keyword.setCampaignType(campaign.getCampaignType());
							keyword.setBusinessType(campaign.getBusinessType());
							keyword.setPutType(campaign.getPutType());
							break;
						}
					}
					if (keyword.getCampaignType() != null || keyword.getBusinessType() != null || keyword.getPutType() != null) {
						keyword.setTableName(tableName);
						keywordMappper.updateKeyword(keyword);
					} else {
						logger.info(String.format("关键词表[%s]中id=[%s]的数据没有类型值", tableName, keyword.getId()));
					}
				}
			} catch (Exception ex) {
				logger.info(String.format("关键词表[%s]刷数据异常", tableName), ex);
			}
			logger.info(String.format("关键词表[%s]的第[%s]页共[%s]页数据处理end...", tableName, pageIndex, pageCount));
		} else {
			logger.info(String.format("在规定范围外时间段暂停执行....", tableName, pageIndex, pageCount));
		}
	}
}

2021年7月17日16:39:44

  1. 关于缺陷管理系统:

免费平台:
https://mdly20210717080930523.pingcode.com/workspace/dashboards/60f2903a6519891e947890f7

官网:
https://pingcode.com/

2021年7月18日14:34:53

  1. PotPlayer 常用快捷键:
    参考博客:
    https://blog.csdn.net/acelit/article/details/102492493

  2. 词汇: 调用, 处理之意思
    invoke

invokeBeanFactoryPostProcessors(beanFactory);
  1. 词汇: 具有初始化的含义
    init
initPropertySources();
  1. 词汇: 有更新, 刷新的含义
    refresh
protected final void refreshBeanFactory() throws BeansException {
		if (hasBeanFactory()) {
			destroyBeans();
			closeBeanFactory();
		}
		try {
			DefaultListableBeanFactory beanFactory = createBeanFactory();
			beanFactory.setSerializationId(getId());
			customizeBeanFactory(beanFactory);
			loadBeanDefinitions(beanFactory);
			this.beanFactory = beanFactory;
		}
		catch (IOException ex) {
			throw new ApplicationContextException("I/O error parsing bean definition source for " + getDisplayName(), ex);
		}
	}
  1. 这就仅仅是一个构造方法, 但是还是抽取了, 应为可能公用.
DefaultListableBeanFactory beanFactory = createBeanFactory();
  1. 词汇: 客制化, 定制的含义
    customize
customizeBeanFactory(beanFactory);

2021年7月20日07:34:48

  1. 转义符:

? %3F %3F
在这里插入图片描述

  1. 或者转码存入时候: UrlEncode, 使用时候解码使用.

  2. Python是通过转义实现的:
    4.

  3. 更新spring-framwork项目

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值