From 91c0f0ce66dde11020682bcc8bdf71bddb2bb885 Mon Sep 17 00:00:00 2001 From: zhanyun Date: Mon, 17 Oct 2016 20:58:01 +0800 Subject: [PATCH] gather_program solved some bugs --- gather_program/bin/resources/log4j.xml | 81 +++++++------------ .../ossean/gather/process/GatherThread.java | 2 +- .../ossean/gather/targetDao/PointerDao.java | 14 ++-- .../resource/applicationContext-myBatis.xml | 4 +- 4 files changed, 40 insertions(+), 61 deletions(-) diff --git a/gather_program/bin/resources/log4j.xml b/gather_program/bin/resources/log4j.xml index c902410e6..cad5b8ff1 100644 --- a/gather_program/bin/resources/log4j.xml +++ b/gather_program/bin/resources/log4j.xml @@ -2,60 +2,39 @@ - - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/gather_program/src/main/java/org/ossean/gather/process/GatherThread.java b/gather_program/src/main/java/org/ossean/gather/process/GatherThread.java index a07eb7a91..7149774c1 100644 --- a/gather_program/src/main/java/org/ossean/gather/process/GatherThread.java +++ b/gather_program/src/main/java/org/ossean/gather/process/GatherThread.java @@ -78,7 +78,7 @@ public class GatherThread implements Runnable { idsIncrement = conf.getIdsIncrement(); idsBegin = readPointer(conf.getPointerTableName(), sourceTableName, conf.getTargetTableName()); - idsEnd = maxId = pointerDao.getMaxId(sourceTableName); + idsEnd = maxId = gatherDao.getMaxId(sourceTableName); while (idsBegin < idsEnd) { beginId = idsBegin; endId = beginId + idsIncrement - 1; // 取数据时两边都取等号 diff --git a/gather_program/src/main/java/org/ossean/gather/targetDao/PointerDao.java b/gather_program/src/main/java/org/ossean/gather/targetDao/PointerDao.java index 9ba87eade..613879cab 100644 --- a/gather_program/src/main/java/org/ossean/gather/targetDao/PointerDao.java +++ b/gather_program/src/main/java/org/ossean/gather/targetDao/PointerDao.java @@ -7,13 +7,13 @@ import org.apache.ibatis.annotations.Update; public interface PointerDao { - // 读取表中最小id值 - @Select("select min(id) from ${table}") - public int getMinId(@Param("table") String table); - - // 读取表中最大id值 - @Select("select max(id) from ${table}") - public int getMaxId(@Param("table") String table); +// // 读取表中最小id值 +// @Select("select min(id) from ${table}") +// public int getMinId(@Param("table") String table); +// +// // 读取表中最大id值 +// @Select("select max(id) from ${table}") +// public int getMaxId(@Param("table") String table); @Select("select Pointer from ${table} where SourceTableName=#{SourceTableName} and TargetTableName=#{TargetTableName}") public int getPointer(@Param("table") String table, diff --git a/gather_program/src/main/resource/applicationContext-myBatis.xml b/gather_program/src/main/resource/applicationContext-myBatis.xml index 58d2329c8..1eb00058d 100644 --- a/gather_program/src/main/resource/applicationContext-myBatis.xml +++ b/gather_program/src/main/resource/applicationContext-myBatis.xml @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ - +