-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guarantee durationMillis is present in getExpiringBounce response #1197
Changes from 3 commits
77cb958
5afce17
298f71c
008eaa2
a469d15
0845b80
e1ee388
cb5cd7f
f7d5211
0d767d2
df9182f
2036fb6
591e238
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.apache.curator.framework.CuratorFramework; | ||
import org.apache.curator.utils.ZKPaths; | ||
|
@@ -53,6 +54,7 @@ public class RequestManager extends CuratorAsyncManager { | |
private final Transcoder<SingularityRequestLbCleanup> requestLbCleanupTranscoder; | ||
|
||
private final SingularityEventListener singularityEventListener; | ||
private final SingularityConfiguration singularityConfiguration; | ||
|
||
private static final String REQUEST_ROOT = "/requests"; | ||
|
||
|
@@ -80,14 +82,16 @@ public class RequestManager extends CuratorAsyncManager { | |
public RequestManager(CuratorFramework curator, SingularityConfiguration configuration, MetricRegistry metricRegistry, SingularityEventListener singularityEventListener, | ||
Transcoder<SingularityRequestCleanup> requestCleanupTranscoder, Transcoder<SingularityRequestWithState> requestTranscoder, Transcoder<SingularityRequestLbCleanup> requestLbCleanupTranscoder, | ||
Transcoder<SingularityPendingRequest> pendingRequestTranscoder, Transcoder<SingularityRequestHistory> requestHistoryTranscoder, Transcoder<SingularityExpiringBounce> expiringBounceTranscoder, | ||
Transcoder<SingularityExpiringScale> expiringScaleTranscoder, Transcoder<SingularityExpiringPause> expiringPauseTranscoder, Transcoder<SingularityExpiringSkipHealthchecks> expiringSkipHealthchecksTranscoder) { | ||
Transcoder<SingularityExpiringScale> expiringScaleTranscoder, Transcoder<SingularityExpiringPause> expiringPauseTranscoder, Transcoder<SingularityExpiringSkipHealthchecks> expiringSkipHealthchecksTranscoder, | ||
SingularityConfiguration singularityConfiguration) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
super(curator, configuration, metricRegistry); | ||
this.requestTranscoder = requestTranscoder; | ||
this.requestCleanupTranscoder = requestCleanupTranscoder; | ||
this.pendingRequestTranscoder = pendingRequestTranscoder; | ||
this.requestHistoryTranscoder = requestHistoryTranscoder; | ||
this.singularityEventListener = singularityEventListener; | ||
this.requestLbCleanupTranscoder = requestLbCleanupTranscoder; | ||
this.singularityConfiguration = singularityConfiguration; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't look like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, sure thing. The perils of moving methods around. |
||
|
||
this.expiringTranscoderMap = ImmutableMap.of( | ||
SingularityExpiringBounce.class, expiringBounceTranscoder, | ||
|
@@ -385,7 +389,9 @@ public <T extends SingularityExpiringParent<? extends SingularityExpiringRequest | |
} | ||
|
||
public Optional<SingularityExpiringBounce> getExpiringBounce(String requestId) { | ||
return getExpiringObject(SingularityExpiringBounce.class, requestId); | ||
return SingularityExpiringBounce.withDefaultExpiringMillis( | ||
getExpiringObject(SingularityExpiringBounce.class, requestId), | ||
TimeUnit.MINUTES.toMillis(singularityConfiguration.getDefaultBounceExpirationMinutes())); | ||
} | ||
|
||
public Optional<SingularityExpiringPause> getExpiringPause(String requestId) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make a
SingularityExpiringBounceBuilder
object instead... that way you can do something like:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, i didn't realize this was so nested (edit: we talked offline and we're gonna do builders for both classes)