File tree Expand file tree Collapse file tree 2 files changed +1
-19
lines changed
src/main/java/io/elastic/jdbc/triggers Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -83,23 +83,14 @@ public final void execute(ExecutionParameters parameters) {
83
83
.rowsPolling (pollingField , pollingValue );
84
84
query .setMaxPollingValue (cts );
85
85
ArrayList <JsonObject > resultList = query .executePolling (connection );
86
+
86
87
for (int i = 0 ; i < resultList .size (); i ++) {
87
88
LOGGER .info ("Columns count: {} from {}" , i + 1 , resultList .size ());
88
89
LOGGER .info ("Emitting data {}" , resultList .get (i ).toString ());
89
90
parameters .getEventEmitter ()
90
91
.emitData (new Message .Builder ().body (resultList .get (i )).build ());
91
92
}
92
93
93
- if (resultList .size () == 0 ) {
94
- resultList .add (Json .createObjectBuilder ()
95
- .add ("empty dataset" , "no data" )
96
- .build ());
97
- LOGGER .info ("Emitting empty data" );
98
- query .setMaxPollingValue (new java .sql .Timestamp (System .currentTimeMillis ()));
99
- parameters .getEventEmitter ()
100
- .emitData (new Message .Builder ().body (resultList .get (0 )).build ());
101
- }
102
-
103
94
formattedDate = new SimpleDateFormat (PROPERTY_DATETIME_FORMAT )
104
95
.format (query .getMaxPollingValue ());
105
96
Original file line number Diff line number Diff line change @@ -84,15 +84,6 @@ public final void execute(ExecutionParameters parameters) {
84
84
.emitData (new Message .Builder ().body (resultList .get (i )).build ());
85
85
}
86
86
87
- if (resultList .size () == 0 ) {
88
- resultList .add (Json .createObjectBuilder ()
89
- .add ("empty dataset" , "no data" )
90
- .build ());
91
- LOGGER .info ("Emitting data {}" , resultList .get (0 ).toString ());
92
- parameters .getEventEmitter ()
93
- .emitData (new Message .Builder ().body (resultList .get (0 )).build ());
94
- }
95
-
96
87
snapshot = Json .createObjectBuilder ()
97
88
.add (PROPERTY_SKIP_NUMBER , skipNumber + resultList .size ())
98
89
.add (LAST_POLL_PLACEHOLDER , pollingValue .toString ())
You can’t perform that action at this time.
0 commit comments