embulk-input-marketo_extended 0.6.18 → 0.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -7
- data/build.gradle +4 -1
- data/src/main/java/org/embulk/input/marketo/CsvTokenizer.java +30 -4
- data/src/main/java/org/embulk/input/marketo/MarketoService.java +1 -1
- data/src/main/java/org/embulk/input/marketo/MarketoServiceImpl.java +80 -1
- data/src/main/java/org/embulk/input/marketo/delegate/ActivityBulkExtractInputPlugin.java +1 -1
- data/src/main/java/org/embulk/input/marketo/delegate/MarketoBaseBulkExtractInputPlugin.java +24 -0
- data/src/test/java/org/embulk/input/marketo/delegate/ActivityBulkExtractInputPluginTest.java +6 -0
- data/src/test/resources/fixtures/activity_extract1.csv +3 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 152da149f01fe6b8ddc0e0c7c991294a14f0d49f
|
4
|
+
data.tar.gz: 8697dca8af570c05a81dc37e848ae0ad471795b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f359173dd7a773a5f4901ea417c19c6e816bae5f69e4a9c1ca8600b0a97b778ce567fdb02daecd1ecf85ed44e33f2537739b33a411e3c6416e84f1b5af10bd6
|
7
|
+
data.tar.gz: f94e31e1b2696c34c2076fc1af79d91fa2c8e6266f27b3f4c284c4b29a973b1f54eec5758520d40ffc4d59aa0672e3139e0900ff5b9523f50670575b3179c516
|
data/README.md
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
[](https://codeclimate.com/github/treasure-data/embulk-input-marketo)
|
3
|
-
[](https://codeclimate.com/github/treasure-data/embulk-input-marketo/coverage)
|
4
|
-
[](http://badge.fury.io/rb/embulk-input-marketo)
|
1
|
+
[](http://badge.fury.io/rb/embulk-input-marketo_extended)
|
5
2
|
|
6
|
-
#
|
3
|
+
# Marketo_extended input plugin for Embulk
|
7
4
|
|
8
|
-
embulk-input-
|
5
|
+
embulk-input-marketo_extended is the gem preparing Embulk input plugins for [Marketo](http://www.marketo.com/).
|
6
|
+
This is a forked repo from treasure-data/embulk-input-marketo and it is mainly extended how csv parsing is done.
|
9
7
|
|
10
8
|
- Lead(lead)
|
11
9
|
- Activity log(activity)
|
@@ -28,7 +26,7 @@ Required Embulk version >= 0.8.33 (since 0.6.0).
|
|
28
26
|
## Install
|
29
27
|
|
30
28
|
```
|
31
|
-
$ embulk gem install embulk-input-
|
29
|
+
$ embulk gem install embulk-input-marketo_extended
|
32
30
|
```
|
33
31
|
|
34
32
|
## Configuration
|
data/build.gradle
CHANGED
@@ -16,15 +16,18 @@ repositories {
|
|
16
16
|
configurations {
|
17
17
|
provided
|
18
18
|
}
|
19
|
-
version = "0.6.
|
19
|
+
version = "0.6.24"
|
20
20
|
sourceCompatibility = 1.7
|
21
21
|
targetCompatibility = 1.7
|
22
22
|
|
23
|
+
|
23
24
|
dependencies {
|
25
|
+
|
24
26
|
compile "org.embulk:embulk-core:0.8.+"
|
25
27
|
provided "org.embulk:embulk-core:0.8.+"
|
26
28
|
compile "org.embulk.base.restclient:embulk-base-restclient:0.5.3"
|
27
29
|
compile "org.embulk.base.restclient:embulk-util-retryhelper-jetty92:0.5.3"
|
30
|
+
compile "commons-io:commons-io:2.8.0"
|
28
31
|
testCompile "junit:junit:4.+"
|
29
32
|
testCompile "org.embulk:embulk-core:0.8.+:tests"
|
30
33
|
testCompile "org.embulk:embulk-test:0.8.+"
|
@@ -210,7 +210,15 @@ public class CsvTokenizer
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
}
|
213
|
+
private char peekNextNextChar() {
|
214
|
+
Preconditions.checkState(line != null, "peekNextNextChar is called after end of file");
|
213
215
|
|
216
|
+
if (linePos + 1 >= line.length()) {
|
217
|
+
return END_OF_LINE;
|
218
|
+
} else {
|
219
|
+
return line.charAt(linePos + 1);
|
220
|
+
}
|
221
|
+
}
|
214
222
|
public boolean hasNextColumn()
|
215
223
|
{
|
216
224
|
return recordState == RecordState.NOT_END;
|
@@ -218,6 +226,7 @@ public class CsvTokenizer
|
|
218
226
|
|
219
227
|
public String nextColumn()
|
220
228
|
{
|
229
|
+
String quotesInQuotedFields = "ACCEPT_STRAY_QUOTES_ASSUMING_NO_DELIMITERS_IN_FIELDS2";
|
221
230
|
if (!hasNextColumn()) {
|
222
231
|
throw new TooFewColumnsException("Too few columns");
|
223
232
|
}
|
@@ -370,18 +379,34 @@ public class CsvTokenizer
|
|
370
379
|
}
|
371
380
|
else if (isQuote(c)) {
|
372
381
|
char next = peekNextChar();
|
373
|
-
|
382
|
+
final char nextNext = peekNextNextChar();
|
383
|
+
Exec.getLogger(CsvTokenizer.class).info("Character is {}. Next: {}, NextNext:{}", c,next,nextNext);
|
384
|
+
if (isQuote(next)
|
385
|
+
&& (quotesInQuotedFields != "ACCEPT_STRAY_QUOTES_ASSUMING_NO_DELIMITERS_IN_FIELDS"
|
386
|
+
|| (!isDelimiter(nextNext) && !isEndOfLine(nextNext)))) {
|
387
|
+
// Escaped by preceding it with another quote.
|
388
|
+
// A quote just before a delimiter or an end of line is recognized as a functional quote,
|
389
|
+
// not just as a non-escaped stray "quote character" included the field, even if
|
390
|
+
// ACCEPT_STRAY_QUOTES_ASSUMING_NO_DELIMITERS_IN_FIELDS is specified.
|
374
391
|
quotedValue.append(line.substring(valueStartPos, linePos));
|
375
392
|
valueStartPos = ++linePos;
|
376
|
-
}
|
377
|
-
|
393
|
+
} else if (quotesInQuotedFields == "ACCEPT_STRAY_QUOTES_ASSUMING_NO_DELIMITERS_IN_FIELDS"
|
394
|
+
&& !(isDelimiter(next) || isEndOfLine(next))) {
|
395
|
+
// A non-escaped stray "quote character" in the field is processed as a regular character
|
396
|
+
// if ACCEPT_STRAY_QUOTES_ASSUMING_NO_DELIMITERS_IN_FIELDS is specified,
|
397
|
+
if ((linePos - valueStartPos) + quotedValue.length() > maxQuotedSizeLimit) {
|
398
|
+
throw new QuotedSizeLimitExceededException("The size of the quoted value exceeds the limit size (" + maxQuotedSizeLimit + ")");
|
399
|
+
}
|
400
|
+
} else {
|
378
401
|
quotedValue.append(line.substring(valueStartPos, linePos - 1));
|
402
|
+
Exec.getLogger(CsvTokenizer.class).info("Current column state is {}. Quoted Value : {}", columnState, quotedValue);
|
379
403
|
columnState = ColumnState.AFTER_QUOTED_VALUE;
|
380
404
|
}
|
381
405
|
}
|
382
406
|
else if (isEscape(c)) { // isQuote must be checked first in case of quote == escape
|
383
407
|
// In RFC 4180, CSV's escape char is '\"'. But '\\' is often used.
|
384
408
|
char next = peekNextChar();
|
409
|
+
Exec.getLogger(CsvTokenizer.class).info("Esc Character is {}. Next: {}, column state{}", c,next, columnState);
|
385
410
|
if (isEndOfLine(c)) {
|
386
411
|
// escape end of line. TODO assuming multi-line quoted value without newline?
|
387
412
|
quotedValue.append(line.substring(valueStartPos, linePos));
|
@@ -391,7 +416,7 @@ public class CsvTokenizer
|
|
391
416
|
}
|
392
417
|
valueStartPos = 0;
|
393
418
|
}
|
394
|
-
else if (
|
419
|
+
else if ( isEscape(next)) { // escaped quote
|
395
420
|
quotedValue.append(line.substring(valueStartPos, linePos - 1));
|
396
421
|
quotedValue.append(next);
|
397
422
|
valueStartPos = ++linePos;
|
@@ -406,6 +431,7 @@ public class CsvTokenizer
|
|
406
431
|
break;
|
407
432
|
|
408
433
|
case AFTER_QUOTED_VALUE:
|
434
|
+
|
409
435
|
if (isDelimiter(c)) {
|
410
436
|
if (delimiterFollowingString == null) {
|
411
437
|
return quotedValue.toString();
|
@@ -16,7 +16,7 @@ public interface MarketoService
|
|
16
16
|
|
17
17
|
File extractLead(Date startTime, Date endTime, List<String> extractedFields, String filterField, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
|
18
18
|
|
19
|
-
File extractAllActivity(List<Integer> activityTypeIds, Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond);
|
19
|
+
File extractAllActivity(List<Integer> activityTypeIds, Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond, String landingZone);
|
20
20
|
|
21
21
|
Iterable<ObjectNode> getAllListLead(List<String> extractFields);
|
22
22
|
|
@@ -11,14 +11,21 @@ import org.embulk.input.marketo.rest.RecordPagingIterable;
|
|
11
11
|
import org.embulk.spi.DataException;
|
12
12
|
import org.embulk.spi.Exec;
|
13
13
|
import org.slf4j.Logger;
|
14
|
+
import java.io.IOException;
|
14
15
|
|
15
16
|
import java.io.File;
|
16
17
|
import java.io.FileOutputStream;
|
17
18
|
import java.io.IOException;
|
18
19
|
import java.io.InputStream;
|
19
20
|
import java.io.OutputStream;
|
21
|
+
import org.apache.commons.io.FileUtils;
|
20
22
|
import java.util.Date;
|
21
23
|
import java.util.List;
|
24
|
+
import java.time.format.DateTimeFormatter;
|
25
|
+
import java.text.DateFormat;
|
26
|
+
import java.text.SimpleDateFormat;
|
27
|
+
|
28
|
+
//import com.amazonaws.services.s3.AmazonS3;
|
22
29
|
|
23
30
|
/**
|
24
31
|
* Created by tai.khuu on 9/6/17.
|
@@ -35,6 +42,12 @@ public class MarketoServiceImpl implements MarketoService
|
|
35
42
|
|
36
43
|
private MarketoRestClient marketoRestClient;
|
37
44
|
|
45
|
+
private static Date startTime;
|
46
|
+
|
47
|
+
private DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
|
48
|
+
|
49
|
+
// private AmazonS3 s3;
|
50
|
+
|
38
51
|
public MarketoServiceImpl(MarketoRestClient marketoRestClient)
|
39
52
|
{
|
40
53
|
this.marketoRestClient = marketoRestClient;
|
@@ -43,6 +56,7 @@ public class MarketoServiceImpl implements MarketoService
|
|
43
56
|
@Override
|
44
57
|
public File extractLead(final Date startTime, Date endTime, List<String> extractedFields, String filterField, int pollingTimeIntervalSecond, final int bulkJobTimeoutSecond)
|
45
58
|
{
|
59
|
+
|
46
60
|
final String exportID = marketoRestClient.createLeadBulkExtract(startTime, endTime, extractedFields, filterField);
|
47
61
|
marketoRestClient.startLeadBulkExtract(exportID);
|
48
62
|
try {
|
@@ -83,9 +97,59 @@ public class MarketoServiceImpl implements MarketoService
|
|
83
97
|
return total;
|
84
98
|
}
|
85
99
|
|
100
|
+
// public boolean exists(String bucketName, String key) {
|
101
|
+
// try {
|
102
|
+
// fullObject = s3Client.getObject(new GetObjectRequest(bucketName, key));
|
103
|
+
// System.out.println("s3 object Content-Type: " + fullObject.getObjectMetadata().getContentType());
|
104
|
+
// return fullObject;
|
105
|
+
// } catch(AmazonServiceException e) {
|
106
|
+
// return false;
|
107
|
+
// }
|
108
|
+
// return true;
|
109
|
+
// }
|
110
|
+
// public String getBucket(String s3_key){
|
111
|
+
// if(s3_key.lenght()) {
|
112
|
+
// return s3_key.split('/')[0];
|
113
|
+
// }
|
114
|
+
// }
|
115
|
+
//
|
116
|
+
// public String getKey(String s3_key){
|
117
|
+
// if(s3_key.lenght()) {
|
118
|
+
// String [] key_parts = s3_key.split('/');
|
119
|
+
// String key = "";
|
120
|
+
// for (String k: key_parts){
|
121
|
+
// key = key + "/" + k ;
|
122
|
+
// }
|
123
|
+
// return s3_key.split('/')[0];
|
124
|
+
// }
|
125
|
+
// }
|
126
|
+
|
86
127
|
@Override
|
87
|
-
public File extractAllActivity(List<Integer> activityTypeIds, Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond)
|
128
|
+
public File extractAllActivity(List<Integer> activityTypeIds, Date startTime, Date endTime, int pollingTimeIntervalSecond, int bulkJobTimeoutSecond, String landingZoneFile)
|
88
129
|
{
|
130
|
+
String tempFile = "/tmp/marketo_" + this.dateFormat.format(startTime) +".csv";
|
131
|
+
this.startTime = startTime;
|
132
|
+
|
133
|
+
try{
|
134
|
+
if (landingZoneFile.length()>0){
|
135
|
+
LOGGER.info("Let's check for temp File = {}", tempFile);
|
136
|
+
File f = new File(tempFile);
|
137
|
+
if (f.exists() && f.isFile() && f.canRead()){
|
138
|
+
return f;
|
139
|
+
}
|
140
|
+
// // Lets read and return csv file from s3
|
141
|
+
// s3_object = get_s3_object(getBucket(landingZoneFile), getKey(landingZoneFile));
|
142
|
+
// if(s3_object){
|
143
|
+
// return s3_object.getObjectContent();
|
144
|
+
// }
|
145
|
+
|
146
|
+
}
|
147
|
+
}
|
148
|
+
catch (Exception e){
|
149
|
+
System.out.println("Exception on retrieving from landing zone");
|
150
|
+
System.out.println("Let's continue normal execution.");
|
151
|
+
}
|
152
|
+
|
89
153
|
final String exportID = marketoRestClient.createActivityExtract(activityTypeIds, startTime, endTime);
|
90
154
|
marketoRestClient.startActitvityBulkExtract(exportID);
|
91
155
|
try {
|
@@ -104,9 +168,13 @@ public class MarketoServiceImpl implements MarketoService
|
|
104
168
|
}
|
105
169
|
});
|
106
170
|
}
|
171
|
+
|
172
|
+
|
107
173
|
private File downloadBulkExtract(Function<BulkExtractRangeHeader, InputStream> getBulkExtractfunction)
|
108
174
|
{
|
175
|
+
|
109
176
|
final File tempFile = Exec.getTempFileSpace().createTempFile(DEFAULT_FILE_FORMAT);
|
177
|
+
|
110
178
|
long startByte = 0;
|
111
179
|
int resumeTime = 0;
|
112
180
|
while (resumeTime < MAX_RESUME_TIME) {
|
@@ -114,6 +182,17 @@ public class MarketoServiceImpl implements MarketoService
|
|
114
182
|
InputStream bulkExtractResult = getBulkExtractfunction.apply(bulkExtractRangeHeader);
|
115
183
|
try {
|
116
184
|
saveExtractedFile(bulkExtractResult, tempFile);
|
185
|
+
if (this.startTime != null){
|
186
|
+
String destinationFileName = "/tmp/marketo_" + this.dateFormat.format(this.startTime) +".csv";
|
187
|
+
final File destination = new File(destinationFileName);
|
188
|
+
try{
|
189
|
+
FileUtils.copyFile(tempFile, destination);
|
190
|
+
LOGGER.info("Save activities in file: "+destinationFileName);
|
191
|
+
}
|
192
|
+
catch (IOException e){
|
193
|
+
LOGGER.error("Exception when copying to file destination {}\nException:{}",destination.getPath(),e );
|
194
|
+
}
|
195
|
+
}
|
117
196
|
return tempFile;
|
118
197
|
}
|
119
198
|
catch (DownloadBulkExtractException e) {
|
@@ -143,7 +143,7 @@ public class ActivityBulkExtractInputPlugin extends MarketoBaseBulkExtractInputP
|
|
143
143
|
protected InputStream getExtractedStream(MarketoService service, PluginTask task, DateTime fromDate, DateTime toDate)
|
144
144
|
{
|
145
145
|
try {
|
146
|
-
return new FileInputStream(service.extractAllActivity(task.getActTypeIds(), fromDate.toDate(), toDate.toDate(), task.getPollingIntervalSecond(), task.getBulkJobTimeoutSecond()));
|
146
|
+
return new FileInputStream(service.extractAllActivity(task.getActTypeIds(), fromDate.toDate(), toDate.toDate(), task.getPollingIntervalSecond(), task.getBulkJobTimeoutSecond(), task.getLandingPath()));
|
147
147
|
}
|
148
148
|
catch (FileNotFoundException e) {
|
149
149
|
throw new RuntimeException("Exception when trying to extract activity", e);
|
@@ -34,6 +34,7 @@ import org.embulk.spi.util.InputStreamFileInput;
|
|
34
34
|
import org.embulk.spi.util.LineDecoder;
|
35
35
|
import org.joda.time.DateTime;
|
36
36
|
import org.msgpack.value.Value;
|
37
|
+
import org.slf4j.Logger;
|
37
38
|
|
38
39
|
import java.io.InputStream;
|
39
40
|
import java.text.DateFormat;
|
@@ -64,6 +65,10 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
64
65
|
@ConfigDefault("1")
|
65
66
|
Integer getFetchDays();
|
66
67
|
|
68
|
+
@Config("landing_zone")
|
69
|
+
@ConfigDefault("")
|
70
|
+
String getLandingPath();
|
71
|
+
|
67
72
|
@Config("latest_fetch_time")
|
68
73
|
@ConfigDefault("null")
|
69
74
|
Optional<Long> getLatestFetchTime();
|
@@ -169,6 +174,18 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
169
174
|
int imported = 0;
|
170
175
|
while (csvRecords.hasNext()) {
|
171
176
|
Map<String, String> csvRecord = csvRecords.next();
|
177
|
+
if(csvRecord.containsKey("attributes")) {
|
178
|
+
System.out.println("Attributes Before");
|
179
|
+
System.out.println(csvRecord.get("attributes"));
|
180
|
+
//
|
181
|
+
// csvRecord.put("attributes", csvRecord.get("attributes").replace("\\\"\"","\\\""));
|
182
|
+
// System.out.println("Attributes After");
|
183
|
+
// System.out.println(csvRecord.get("attributes"));
|
184
|
+
// }
|
185
|
+
|
186
|
+
// for (Map.Entry<String, String> entry : csvRecord.entrySet()) {
|
187
|
+
// System.out.println(entry.getKey() + ":" + entry.getValue().toString());
|
188
|
+
}
|
172
189
|
ObjectNode objectNode = MarketoUtils.OBJECT_MAPPER.valueToTree(csvRecord);
|
173
190
|
recordImporter.importRecord(new AllStringJacksonServiceRecord(objectNode), pageBuilder);
|
174
191
|
imported = imported + 1;
|
@@ -357,6 +374,7 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
357
374
|
if (hasNext()) {
|
358
375
|
MarketoUtils.DateRange next = dateRangeIterator.next();
|
359
376
|
InputStream extractedStream = getExtractedStream(marketoService, task, next.fromDate, next.toDate);
|
377
|
+
|
360
378
|
currentLineDecoder = new LineDecoder(new InputStreamFileInput(task.getBufferAllocator(), extractedStream), task);
|
361
379
|
return currentLineDecoder;
|
362
380
|
}
|
@@ -372,6 +390,7 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
372
390
|
|
373
391
|
private class CsvRecordIterator implements Iterator<Map<String, String>>
|
374
392
|
{
|
393
|
+
private final Logger LOGGER = Exec.getLogger(CsvRecordIterator.class);
|
375
394
|
private CsvTokenizer tokenizer;
|
376
395
|
|
377
396
|
private List<String> headers;
|
@@ -395,6 +414,7 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
395
414
|
{
|
396
415
|
if (currentCsvRecord == null) {
|
397
416
|
currentCsvRecord = getNextCSVRecord();
|
417
|
+
|
398
418
|
}
|
399
419
|
return currentCsvRecord != null;
|
400
420
|
}
|
@@ -427,6 +447,10 @@ public abstract class MarketoBaseBulkExtractInputPlugin<T extends MarketoBaseBul
|
|
427
447
|
try {
|
428
448
|
int i = 0;
|
429
449
|
while (tokenizer.hasNextColumn()) {
|
450
|
+
if (i == headers.size()){
|
451
|
+
LOGGER.info("We have reached last column. {}", tokenizer.nextColumnOrNull());
|
452
|
+
break;
|
453
|
+
}
|
430
454
|
kvMap.put(headers.get(i), tokenizer.nextColumnOrNull());
|
431
455
|
i++;
|
432
456
|
}
|
data/src/test/java/org/embulk/input/marketo/delegate/ActivityBulkExtractInputPluginTest.java
CHANGED
@@ -108,16 +108,22 @@ public class ActivityBulkExtractInputPluginTest
|
|
108
108
|
Mockito.when(mockMarketoRestclient.createActivityExtract(any(List.class), any(Date.class), any(Date.class))).thenReturn(exportId1).thenReturn(exportId2).thenReturn(null);
|
109
109
|
Mockito.when(mockMarketoRestclient.getActivitiesBulkExtractResult(Mockito.eq(exportId1), any(BulkExtractRangeHeader.class))).thenReturn(this.getClass().getResourceAsStream("/fixtures/activity_extract1.csv"));
|
110
110
|
Mockito.when(mockMarketoRestclient.getActivitiesBulkExtractResult(Mockito.eq(exportId2), any(BulkExtractRangeHeader.class))).thenReturn(this.getClass().getResourceAsStream("/fixtures/activity_extract2.csv"));
|
111
|
+
System.out.println("*************");
|
111
112
|
ServiceResponseMapper<? extends ValueLocator> mapper = activityBulkExtractInputPlugin.buildServiceResponseMapper(task);
|
113
|
+
System.out.println("-----------------");
|
112
114
|
activityBulkExtractInputPlugin.validateInputTask(task);
|
115
|
+
System.out.println("Before ingestion");
|
113
116
|
TaskReport taskReport = activityBulkExtractInputPlugin.ingestServiceData(task, mapper.createRecordImporter(), 1, pageBuilder);
|
117
|
+
System.out.println("After ingestion");
|
114
118
|
ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);
|
115
119
|
Column marketoGUID = mapper.getEmbulkSchema().lookupColumn("marketoGUID");
|
116
120
|
Mockito.verify(pageBuilder, Mockito.times(55)).setString(Mockito.eq(marketoGUID), argumentCaptor.capture());
|
117
121
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).startActitvityBulkExtract(Mockito.eq(exportId1));
|
122
|
+
System.out.println("Start Extraction");
|
118
123
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).waitActitvityExportJobComplete(Mockito.eq(exportId1), Mockito.eq(task.getPollingIntervalSecond()), Mockito.eq(task.getBulkJobTimeoutSecond()));
|
119
124
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).startActitvityBulkExtract(Mockito.eq(exportId2));
|
120
125
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).waitActitvityExportJobComplete(Mockito.eq(exportId2), Mockito.eq(task.getPollingIntervalSecond()), Mockito.eq(task.getBulkJobTimeoutSecond()));
|
126
|
+
System.out.println("Finished Extraction");
|
121
127
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).createActivityExtract(activityTypeIds, startDate.toDate(), startDate.plusDays(30).toDate());
|
122
128
|
DateTime startDate2 = startDate.plusDays(30).plusSeconds(1);
|
123
129
|
Mockito.verify(mockMarketoRestclient, Mockito.times(1)).createActivityExtract(activityTypeIds, startDate2.toDate(), startDate.plusDays(task.getFetchDays()).toDate());
|
@@ -32,4 +32,6 @@ marketoGUID,leadId,activityDate,activityTypeId,campaignId,primaryAttributeValueI
|
|
32
32
|
558711,102449,2017-09-08T16:39:14Z,12,null,102449,null,"{""Source Type"":""List import"",""List Name"":""Bill Import Test"",""Created Date"":""2017-09-08""}"
|
33
33
|
558712,102450,2017-09-08T16:39:14Z,12,null,102450,null,"{""Source Type"":""List import"",""List Name"":""Bill Import Test"",""Created Date"":""2017-09-08""}"
|
34
34
|
558713,102451,2017-09-08T16:39:14Z,12,null,102451,null,"{""Source Type"":""List import"",""List Name"":""Bill Import Test"",""Created Date"":""2017-09-08""}"
|
35
|
-
558714,102452,2017-09-08T16:39:14Z,12,null,102452,null,"{""Source Type"":""List import"",""List Name"":""Bill Import Test"",""Created Date"":""2017-09-08""}"
|
35
|
+
558714,102452,2017-09-08T16:39:14Z,12,null,102452,null,"{""Source Type"":""List import"",""List Name"":""Bill Import Test"",""Created Date"":""2017-09-08""}"
|
36
|
+
558714,102452,2017-09-08T16:39:14Z,12,null,102452,null,"{""Campaign Run ID"":""85184"",""Client IP Address"":""98.167.134.95"",""Query Parameters"":""mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9"",""Referrer URL"":""https://pages.upwork.com/UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9"",""User Agent"":""Mozilla/5.0 (iPad; CPU OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/86.0.4240.93 Mobile/15E148 Safari/604.1"",""Webpage ID"":4646125,""Webform ID"":""2548"",""Form Fields"":""a:18:{s:6:\""module\"";s:11:\""leadCapture\"";s:6:\""action\"";s:5:\""save2\"";s:12:\""Unsubscribed\"";s:3:\""Yes\"";s:11:\""resubscribe\"";s:0:\""\"";s:6:\""formid\"";s:4:\""2548\"";s:4:\""lpId\"";s:4:\""7518\"";s:5:\""subId\"";s:2:\""13\"";s:10:\""munchkinId\"";s:11:\""518-RKL-392\"";s:5:\""lpurl\"";s:66:\""//pages.upwork.com/UnsubscribePage.html?cr={creative}&kw={keyword}\"";s:2:\""cr\"";s:0:\""\"";s:2:\""kw\"";s:0:\""\"";s:1:\""q\"";s:0:\""\"";s:8:\""_mkt_trk\"";s:56:\""id:518-RKL-392&token:_mch-upwork.com-1604320852930-29224\"";s:7:\""formVid\"";s:4:\""2548\"";s:7:\""mkt_tok\"";s:212:\""eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9\"";s:13:\""_mktoReferrer\"";s:284:\""https://pages.upwork.com/UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9\"";s:14:\""checksumFields\"";s:106:\""Unsubscribed,resubscribe,formid,lpId,subId,munchkinId,lpurl,cr,kw,q,_mkt_trk,formVid,mkt_tok,_mktoReferrer\"";s:8:\""checksum\"";s:64:\""4cec0015c824c862f776c0301f6be5ffa7a5738ae450a7a3a8a57c8ca353e88a\"";}""}"
|
37
|
+
1587928704,53599804,2020-11-02T12:40:58Z,9,17390,24173,2020-10-29 Executive Summary #2.Email,"{""Campaign Run ID"":""85184"",""Client IP Address"":""98.167.134.95"",""Query Parameters"":""mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9"",""Referrer URL"":""https://pages.upwork.com/UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9"",""User Agent"":""Mozilla/5.0 (iPad; CPU OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/86.0.4240.93 Mobile/15E148 Safari/604.1"",""Webpage ID"":4646125,""Webform ID"":""2548"",""Form Fields"":""a:18:{s:6:\""module\"";s:11:\""leadCapture\"";s:6:\""action\"";s:5:\""save2\"";s:12:\""Unsubscribed\"";s:3:\""Yes\"";s:11:\""resubscribe\"";s:0:\""\"";s:6:\""formid\"";s:4:\""2548\"";s:4:\""lpId\"";s:4:\""7518\"";s:5:\""subId\"";s:2:\""13\"";s:10:\""munchkinId\"";s:11:\""518-RKL-392\"";s:5:\""lpurl\"";s:66:\""//pages.upwork.com/UnsubscribePage.html?cr={creative}&kw={keyword}\"";s:2:\""cr\"";s:0:\""\"";s:2:\""kw\"";s:0:\""\"";s:1:\""q\"";s:0:\""\"";s:8:\""_mkt_trk\"";s:56:\""id:518-RKL-392&token:_mch-upwork.com-1604320852930-29224\"";s:7:\""formVid\"";s:4:\""2548\"";s:7:\""mkt_tok\"";s:212:\""eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9\"";s:13:\""_mktoReferrer\"";s:284:\""https://pages.upwork.com/UnsubscribePage.html?mkt_unsubscribe=1&mkt_tok=eyJpIjoiTTJWbFlUTTRZakEyT1dZeCIsInQiOiJ3MzVGMnZmblJZSWt1bmZ1dHoyaVZWcnhReEtKR2tSbkdUMHYwbVRPZXcvTHhVS3BRbGhaWnkrSldRaTNINnR4UWNVaVBFLzN4anlaMGlHSDE4MW40bXdlbUMrdVZmNGpSekl1S1BmNmtCcTFZaXJVZjhqOXQxT0NBdVFxQkpwayJ9\"";s:14:\""checksumFields\"";s:106:\""Unsubscribed,resubscribe,formid,lpId,subId,munchkinId,lpurl,cr,kw,q,_mkt_trk,formVid,mkt_tok,_mktoReferrer\"";s:8:\""checksum\"";s:64:\""4cec0015c824c862f776c0301f6be5ffa7a5738ae450a7a3a8a57c8ca353e88a\"";}""}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-marketo_extended
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2020-
|
14
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,8 +138,9 @@ files:
|
|
138
138
|
- src/test/resources/fixtures/lists_response.json
|
139
139
|
- src/test/resources/fixtures/program_response.json
|
140
140
|
- classpath/jetty-io-9.2.14.v20151106.jar
|
141
|
+
- classpath/commons-io-2.8.0.jar
|
141
142
|
- classpath/jetty-util-9.2.14.v20151106.jar
|
142
|
-
- classpath/embulk-input-marketo_extended-0.6.
|
143
|
+
- classpath/embulk-input-marketo_extended-0.6.24.jar
|
143
144
|
- classpath/jetty-http-9.2.14.v20151106.jar
|
144
145
|
- classpath/jetty-client-9.2.14.v20151106.jar
|
145
146
|
- classpath/embulk-base-restclient-0.5.3.jar
|