Github user laurentgo commented on a diff in the pull request:
https://github.com/apache/drill/pull/1055#discussion_r154153939
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/testing/PauseInjection.java
---
@@ -44,14 +46,31 @@ private PauseInjection(@JsonProperty("address") final
String address,
@JsonProperty("siteClass") final String siteClass,
@JsonProperty("desc") final String desc,
@JsonProperty("nSkip") final int nSkip) throws
InjectionConfigurationException {
- super(address, port, siteClass, desc, nSkip, 1);
+ //nFire is 1 since we will inject pauses only once
+ //msPause is 0 (i.e. not time-bound)
+ super(address, port, siteClass, desc, nSkip, 1, 0L);
+ }
+
+ @JsonCreator // ensures instances are created only through JSON
+ private PauseInjection(@JsonProperty("address") final String address,
+ @JsonProperty("port") final int port,
+ @JsonProperty("siteClass") final String siteClass,
+ @JsonProperty("desc") final String desc,
+ @JsonProperty("nSkip") final int nSkip,
+ @JsonProperty("msPause") final long msPause)
throws InjectionConfigurationException {
+ //nFire is 1 since we will inject pauses only once
+ super(address, port, siteClass, desc, nSkip, 1, msPause);
}
- public void pause() {
+ public void pause() throws InterruptedException {
--- End diff --
I would not expose the interruption but handle it internally instead (by
decreasing the latch counter)
---