- 博客(10)
- 收藏
- 关注
原创 MyCat 分片算法 PartitionByMonthAndHistory
rule.xml 配置如下<function name="partition-by-month-history" class="io.mycat.route.function.PartitionByMonthAndHistory"> <property name="dateFormat">yyyy-MM-dd</property> <prop
2019-03-14 17:24:48
1058
1
原创 guava - Preconditions
通过该类,可完成一些基本校验,其提供的静态方法如下:方法 备注 checkArgument 如果校验的表达式为false,则抛出 IllegalArgumentException 异常 checkNotNull 判断是否为空,若为空,则抛出NullPointerException checkElementIndex 判断索引及长度是否合法,index >...
2019-03-13 11:36:42
200
原创 Mycat 分片算法 PartitionByHotDate
该算法根据时间分片,热数据存储在索引为 0 的dataNode中,其余数据根据sPartionDay进行分片存储,用户可配置属性 dataFormat、 sLastDay、 sPartionDay。dataFormat: 时间解析格式; sLastDay:热数据范围,如该值配置为10,则表示从现在往前推10天的数据为热点数据。将存储在第一个dataNode中,需要 注意的是如果插入数据晚...
2019-03-12 15:57:37
721
1
原创 guava - CaseFormat
实用程序类各种ASCII案例格式之间的转换。public void test(){ String result1 = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE,"test-data"); String result2 = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER...
2019-03-12 14:00:47
243
原创 Mycat 分片算法 PartitionByMod | PartitionByHashMod
分片算法PartitionByMod 和PartitionByHashMod 类似,只是在支持的字端类型上有稍微区别,放在一起说明:<function name="part-by-mod" class="io.mycat.route.function.PartitionByMod"> <property name="count">3</propert...
2019-03-11 23:03:50
2840
原创 guava - Joiner
Joiner 用于连接操作,类似于+或者StringBuilder的append。 @Test public void test(){ String[] strArray1 = {"abc","def"}; String result1 = Joiner.on(",").join(strArray1); System.out.pr...
2019-03-11 17:07:24
120
原创 guava - Splitter
在我们使用 java 的split 方法时,如果不是对该方法足够了解,可能会得到我们意想之外的结果。记录下踩过的坑:public void test(){ String str = "a,b,c,,,a,c,,,"; String[] splitArray = str.split(","); printArray(splitArray);}public void...
2019-03-08 17:28:01
264
原创 Mycat 分片算法 LatestMonthPartion
关于分片算法 LatestMonthPartion,rule.xml 的配置为:<function name="latestMonth" class="io.mycat.route.function.LatestMonthPartion"> <property name="splitOneDay">24</property></func
2019-03-07 23:10:09
515
原创 Mycat 分片算法 AutoPartitionByLong
关于分片算法 AutoPartitionByLong,rule.xml 的配置为:<function name="rang-long" class="io.mycat.route.function.AutoPartitionByLong"> <property name="mapFile">autopartition-long.txt</property...
2019-03-07 17:36:32
1179
原创 Mycat 分片算法 PartitionByDate 两点疑问
最近学习mycat,关于PartitionByDate有两点疑问,在此记录一下,理解有误的地方还望各位大神指正!io.mycat.route.function.PartitionByDate,根据时间字端,按天分片<function name="partition-by-date" class="io.mycat.route.function.PartitionByDate">...
2019-03-07 16:24:11
1298
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人