Explorar o código

adq-批处理数据

yumeng hai 11 meses
pai
achega
3042b65526

+ 4 - 4
job-adq/src/main/java/cn/com/ctop/job/adq/data/service/impl/AdqAccountReportServiceImpl.java

@@ -194,8 +194,8 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
         log.info("开始执行账户报表定时批处理任务....");
         synchronized (advertiserReportHourBuffer) {
             long now = System.currentTimeMillis();
-            if (advertiserReportHourBuffer.size() >= MAX_BATCH_SIZE ||
-                    (now - advertiserReportHourLastFlushTime) >= MAX_WAIT_TIME_MS && !advertiserReportHourBuffer.isEmpty()) {
+            //  advertiserReportHourBuffer.size() >= MAX_BATCH_SIZE ||  (now - advertiserReportHourLastFlushTime) >= MAX_WAIT_TIME_MS &&
+            if ( !advertiserReportHourBuffer.isEmpty()) {
                 try {
                     long startTime = System.currentTimeMillis();
 
@@ -217,8 +217,8 @@ public class AdqAccountReportServiceImpl implements IAdqAccountReportService {
 
         synchronized (advertiserReportDailyBuffer) {
             long now = System.currentTimeMillis();
-            if (advertiserReportDailyBuffer.size() >= MAX_BATCH_SIZE ||
-                    (now - advertiserReportDailyLastFlushTime) >= MAX_WAIT_TIME_MS && !advertiserReportDailyBuffer.isEmpty()) {
+            //  advertiserReportDailyBuffer.size() >= MAX_BATCH_SIZE || (now - advertiserReportDailyLastFlushTime) >= MAX_WAIT_TIME_MS &&
+            if ( !advertiserReportDailyBuffer.isEmpty()) {
                 try {
                     log.info("Flushed advertiserReportDaily batch size: {}", advertiserReportDailyBuffer.size());
                     accountReportMapper.addAccountDailyListSD(new ArrayList<>(advertiserReportDailyBuffer));

+ 8 - 4
job-adq/src/main/java/cn/com/ctop/job/adq/data/service/impl/AdqCreativeCreativeReportServiceImpl.java

@@ -222,8 +222,8 @@ public class AdqCreativeCreativeReportServiceImpl implements IAdqCreativeReportS
         log.info("开始执行创意报表定时批处理任务....");
         synchronized (creativeReportHourBuffer) {
             long now = System.currentTimeMillis();
-            if (creativeReportHourBuffer.size() >= MAX_BATCH_SIZE ||
-                    (now - creativeReportHourLastFlushTime) >= MAX_WAIT_TIME_MS && !creativeReportHourBuffer.isEmpty()) {
+            //  creativeReportHourBuffer.size() >= MAX_BATCH_SIZE ||  (now - creativeReportHourLastFlushTime) >= MAX_WAIT_TIME_MS &&
+            if (!creativeReportHourBuffer.isEmpty()) {
                 try {
                     long startTime = System.currentTimeMillis();
                     adqReportMapper.addsHourListSD(new ArrayList<>(creativeReportHourBuffer));
@@ -244,8 +244,8 @@ public class AdqCreativeCreativeReportServiceImpl implements IAdqCreativeReportS
 
         synchronized (creativeReportDailyBuffer) {
             long now = System.currentTimeMillis();
-            if (creativeReportDailyBuffer.size() >= MAX_BATCH_SIZE ||
-                    (now - creativeReportDailyLastFlushTime) >= MAX_WAIT_TIME_MS && !creativeReportDailyBuffer.isEmpty()) {
+            // creativeReportDailyBuffer.size() >= MAX_BATCH_SIZE || (now - creativeReportDailyLastFlushTime) >= MAX_WAIT_TIME_MS &&
+            if ( !creativeReportDailyBuffer.isEmpty()) {
                 try {
                     long startTime = System.currentTimeMillis();
                     adqReportMapper.addsDailySD(new ArrayList<>(creativeReportDailyBuffer));
@@ -297,4 +297,8 @@ public class AdqCreativeCreativeReportServiceImpl implements IAdqCreativeReportS
         }
     }
 
+    public static void main(String[] args) {
+
+    }
+
 }