embulk-input-bigquery_extract_files 0.0.3 → 0.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ea87433e2ed5453de192fc5ea73c4e1b7499b6
|
4
|
+
data.tar.gz: f28b4f9530974d7f2614392f951823af1213ed4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54384d90f6fab9406c1d56aa4f8eff7fb3ed78aff8564bf910f8aa36610447bfc878e4f025a8a466e4e14afdca0457a5ca087e8cb62151744b786635179bfd8c
|
7
|
+
data.tar.gz: 775aff297708f182088b36ad48664d70ae0a4a411184ba6ae47cf719651c32b9ef582f3037b1d75d6dac7288511cc9420179d02d052553a50748f404bcbebda3
|
data/build.gradle
CHANGED
data/src/main/java/org/embulk/input/bigquery_export_gcs/BigqueryExportGcsFileInputPlugin.java
CHANGED
@@ -116,10 +116,13 @@ public class BigqueryExportGcsFileInputPlugin
|
|
116
116
|
@ConfigDefault("null")
|
117
117
|
public Optional<String> getTempSchemaFilePath();
|
118
118
|
|
119
|
-
@Config("
|
119
|
+
@Config("temp_schema_file_type")
|
120
120
|
@ConfigDefault("null")
|
121
121
|
public Optional<String> getTempSchemaFileType();
|
122
122
|
|
123
|
+
@Config("bigquery_job_wait_second")
|
124
|
+
@ConfigDefault("600")
|
125
|
+
public Optional<Integer> getBigqueryJobWaitingSecond();
|
123
126
|
|
124
127
|
@Config("cleanup_gcs_files")
|
125
128
|
@ConfigDefault("false")
|
@@ -133,7 +133,7 @@ public class BigqueryExportUtils
|
|
133
133
|
log.info("query to Table jobId : {}",jobId);
|
134
134
|
log.info("waiting for job end....... ");
|
135
135
|
|
136
|
-
Job lastJob = waitForJob(bigquery, task.getProject(), jobId);
|
136
|
+
Job lastJob = waitForJob(bigquery, task.getProject(), jobId, task.getBigqueryJobWaitingSecond().get());
|
137
137
|
|
138
138
|
log.debug("waiting for job end....... {}", lastJob.toPrettyString());
|
139
139
|
}
|
@@ -301,25 +301,31 @@ public class BigqueryExportUtils
|
|
301
301
|
log.info("extract jobId : {}",jobId);
|
302
302
|
log.debug("waiting for job end....... ");
|
303
303
|
|
304
|
-
waitForJob(bigquery, task.getProject(), jobId);
|
304
|
+
waitForJob(bigquery, task.getProject(), jobId, task.getBigqueryJobWaitingSecond().get());
|
305
305
|
return embulkSchema;
|
306
306
|
}
|
307
307
|
|
308
|
-
public static Job waitForJob(Bigquery bigquery, String project, String jobId) throws IOException, InterruptedException{
|
309
|
-
int maxAttempts =
|
308
|
+
public static Job waitForJob(Bigquery bigquery, String project, String jobId, int bigqueryJobWaitingSecond) throws IOException, InterruptedException{
|
309
|
+
int maxAttempts = bigqueryJobWaitingSecond;
|
310
310
|
int initialRetryDelay = 1000; // ms
|
311
311
|
Job pollingJob = null;
|
312
|
-
|
312
|
+
log.info("waiting for job end : {}",jobId);
|
313
|
+
int tryCnt = 0;
|
314
|
+
for (tryCnt=0; tryCnt < maxAttempts; tryCnt++){
|
313
315
|
pollingJob = bigquery.jobs().get(project, jobId).execute();
|
314
316
|
String state = pollingJob.getStatus().getState();
|
315
317
|
log.debug("Job Status {} : {}",jobId, state);
|
318
|
+
|
316
319
|
if (pollingJob.getStatus().getState().equals("DONE")) {
|
317
320
|
break;
|
318
321
|
}
|
319
|
-
log.
|
322
|
+
log.info("waiting {} ... ",tryCnt);
|
320
323
|
Thread.sleep(initialRetryDelay);
|
321
|
-
|
322
324
|
}
|
325
|
+
if(tryCnt + 1 == maxAttempts){
|
326
|
+
log.error("Bigquery Job Waiting exceed : over {} second...", bigqueryJobWaitingSecond);
|
327
|
+
}
|
328
|
+
|
323
329
|
return pollingJob;
|
324
330
|
}
|
325
331
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-bigquery_extract_files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jo8937
|
@@ -64,7 +64,7 @@ files:
|
|
64
64
|
- src/test/java/org/embulk/input/bigquery_export_gcs/UnitTestInitializer.java
|
65
65
|
- classpath/commons-codec-1.3.jar
|
66
66
|
- classpath/commons-logging-1.1.1.jar
|
67
|
-
- classpath/embulk-input-bigquery_extract_files-0.0.
|
67
|
+
- classpath/embulk-input-bigquery_extract_files-0.0.4.jar
|
68
68
|
- classpath/google-api-client-1.23.0.jar
|
69
69
|
- classpath/google-api-services-bigquery-v2-rev363-1.23.0.jar
|
70
70
|
- classpath/google-api-services-storage-v1-rev59-1.21.0.jar
|