Lucene的段
倒排索引是有一定格式的,而这个格式一旦写入是非常难以改变的,那么如何进行增量索引呢?
Lucene使用段来解决这个问题。对于每一个已经生成的段,其倒排索引结构不会再改变,而增量添加的文档添加到新的段中,段之间在一定时刻进行合并,从而形成新的倒排索引结构
有时候我们并不想把所有的配置信息都放到spring的配置文件中,这样的话也不太好维护,比如说数据库的信息
1 | <bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> |
这样配置当然也可以,只是要去修改spring配置文件的时候由于spring的配置文件内容太多,不太方便,所以有时候会引入外部的属性文件
可以使用<context:property-placeholder>
标签来进行引入
1 | <beans xmlns="http://www.springframework.org/schema/beans" |
db.properties属性文件
1 | url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8 |
<context:property-placeholder>
会生成一个PropertySourcesPlaceholderConfigurer类来解析占位符
分区就是将一个表分解成多个区块进行操作和保存,从而降低每次操作的数据,提高性能。而对应用来说是透明的,从逻辑上看是只有一个表,但在物理上这个表可能是由多个物理分区组成的,每个分区都是一个独立的对象,可以进行独立处理
注:如果表中存在primary key或者unique key时,分区的列必须是primary key或者unique key的一个组成部分,也就是说,分区函数的列只能从pk或者uk这些key中取子集
如果表中不存在任何的primary key或者unique key,则可以指定任何一个列作为分区列