Skip to content

Commit

Permalink
add constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
wsorenson committed Jan 6, 2015
1 parent ec1dcac commit ad415f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import javax.inject.Singleton;

import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.hubspot.singularity.config.SingularityConfiguration;
Expand All @@ -18,7 +17,7 @@ public class SingularityCleanupPoller extends SingularityLeaderOnlyPoller {

@Inject
SingularityCleanupPoller(SingularityConfiguration configuration, SingularityCleaner cleaner, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock) {
super(configuration.getCleanupEverySeconds(), TimeUnit.SECONDS, Optional.of(lock));
super(configuration.getCleanupEverySeconds(), TimeUnit.SECONDS, lock);

this.cleaner = cleaner;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import javax.inject.Singleton;

import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.hubspot.singularity.config.SingularityConfiguration;
Expand All @@ -18,7 +17,7 @@ public class SingularityCooldownPoller extends SingularityLeaderOnlyPoller {

@Inject
SingularityCooldownPoller(SingularityConfiguration configuration, SingularityCooldownChecker checker, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock) {
super(TimeUnit.MINUTES.toMillis(configuration.getCooldownExpiresAfterMinutes()) / 2, TimeUnit.MILLISECONDS, Optional.of(lock));
super(TimeUnit.MINUTES.toMillis(configuration.getCooldownExpiresAfterMinutes()) / 2, TimeUnit.MILLISECONDS, lock);

this.checker = checker;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.hubspot.mesos.JavaUtils;
Expand All @@ -24,7 +23,7 @@ public class SingularityDeployPoller extends SingularityLeaderOnlyPoller {

@Inject
SingularityDeployPoller(SingularityDeployChecker deployChecker, SingularityConfiguration configuration, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock) {
super(configuration.getCheckDeploysEverySeconds(), TimeUnit.SECONDS, Optional.of(lock));
super(configuration.getCheckDeploysEverySeconds(), TimeUnit.SECONDS, lock);

this.deployChecker = deployChecker;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ protected SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit) {
this(pollDelay, pollTimeUnit, Optional.<Lock> absent());
}

protected SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit, Optional<Lock> lockHolder) {
protected SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit, Lock lock) {
this(pollDelay, pollTimeUnit, Optional.of(lock));
}

private SingularityLeaderOnlyPoller(long pollDelay, TimeUnit pollTimeUnit, Optional<Lock> lockHolder) {
this.pollDelay = pollDelay;
this.pollTimeUnit = pollTimeUnit;
this.lockHolder = lockHolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Named;
Expand All @@ -27,7 +26,7 @@ public class SingularitySchedulerPoller extends SingularityLeaderOnlyPoller {
@Inject
SingularitySchedulerPoller(Provider<SingularitySchedulerStateCache> stateCacheProvider, SingularityScheduler scheduler,
SingularityConfiguration configuration, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock) {
super(configuration.getCheckSchedulerEverySeconds(), TimeUnit.SECONDS, Optional.of(lock));
super(configuration.getCheckSchedulerEverySeconds(), TimeUnit.SECONDS, lock);

this.stateCacheProvider = stateCacheProvider;
this.scheduler = scheduler;
Expand Down

0 comments on commit ad415f6

Please sign in to comment.