Skip to content

Commit

Permalink
Restore the old constructor to avoid incompatible issue
Browse files Browse the repository at this point in the history
  • Loading branch information
brycezhongqing committed Oct 17, 2024
1 parent bd54a98 commit 9510c64
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and what APIs have changed, if applicable.

## [Unreleased]

## [29.59.1] - 2024-10-17
- Restore the old constructor to avoid incompatible issue

## [29.59.0] - 2024-10-07
- Add support for announcing/deannoucing service only to INDIS

Expand Down Expand Up @@ -5746,7 +5749,8 @@ patch operations can re-use these classes for generating patch messages.

## [0.14.1]

[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.59.0...master
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.59.1...master
[29.59.1]: https://github.com/linkedin/rest.li/compare/v29.59.0...v29.59.1
[29.59.0]: https://github.com/linkedin/rest.li/compare/v29.58.11...v29.59.0
[29.58.11]: https://github.com/linkedin/rest.li/compare/v29.58.10...v29.58.11
[29.58.10]: https://github.com/linkedin/rest.li/compare/v29.58.9...v29.58.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,23 +141,78 @@ public class ZooKeeperAnnouncer implements D2ServiceDiscoveryEventHelper
// Field to store the dark warm-up time duration in seconds, defaults to zero
private int _warmupDuration;

/**
* @deprecated Use the constructor {@link #ZooKeeperAnnouncer(LoadBalancerServer)} instead.
*/
@Deprecated
public ZooKeeperAnnouncer(ZooKeeperServer server)
{
this(server, true);
}

public ZooKeeperAnnouncer(LoadBalancerServer server)
{
this(server, true);
}

/**
* @deprecated Use the constructor {@link #ZooKeeperAnnouncer(LoadBalancerServer, boolean)} instead.
*/
@Deprecated
public ZooKeeperAnnouncer(ZooKeeperServer server, boolean initialIsUp)
{
this(server, initialIsUp, DEFAULT_DARK_WARMUP_ENABLED, DEFAULT_DARK_WARMUP_CLUSTER_NAME, DEFAULT_DARK_WARMUP_DURATION, (ScheduledExecutorService) null);
}

public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp)
{
this(server, initialIsUp, DEFAULT_DARK_WARMUP_ENABLED, DEFAULT_DARK_WARMUP_CLUSTER_NAME, DEFAULT_DARK_WARMUP_DURATION, (ScheduledExecutorService) null);
}

/**
* @deprecated Use the constructor {@link #ZooKeeperAnnouncer(LoadBalancerServer, boolean, boolean, String, int, ScheduledExecutorService)} instead.
*/
@Deprecated
public ZooKeeperAnnouncer(ZooKeeperServer server, boolean initialIsUp,
boolean isDarkWarmupEnabled, String warmupClusterName, int warmupDuration,
ScheduledExecutorService executorService)
{
this(server, initialIsUp, isDarkWarmupEnabled, warmupClusterName, warmupDuration, executorService,
new LogOnlyServiceDiscoveryEventEmitter()); // default to use log-only event emitter
}

public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp,
boolean isDarkWarmupEnabled, String warmupClusterName, int warmupDuration, ScheduledExecutorService executorService)
{
this(server, initialIsUp, isDarkWarmupEnabled, warmupClusterName, warmupDuration, executorService,
new LogOnlyServiceDiscoveryEventEmitter()); // default to use log-only event emitter
}

/**
* @deprecated Use the constructor {@link #ZooKeeperAnnouncer(LoadBalancerServer, boolean, boolean, String, int, ScheduledExecutorService, ServiceDiscoveryEventEmitter)} instead.
*/
@Deprecated
public ZooKeeperAnnouncer(ZooKeeperServer server, boolean initialIsUp,
boolean isDarkWarmupEnabled, String warmupClusterName, int warmupDuration, ScheduledExecutorService executorService, ServiceDiscoveryEventEmitter eventEmitter)
{
_server = server;
// initialIsUp is used for delay mark up. If it's false, there won't be markup when the announcer is started.
_isUp = initialIsUp;
_isWarmingUp = false;
_isRetryWarmup = false;
_pendingMarkDown = new ArrayDeque<>();
_pendingMarkUp = new ArrayDeque<>();
_pendingWarmupMarkDown = new ArrayDeque<>();

_isDarkWarmupEnabled = isDarkWarmupEnabled;
_warmupClusterName = warmupClusterName;
_warmupDuration = warmupDuration;
_executorService = executorService;
_eventEmitter = eventEmitter;

server.setServiceDiscoveryEventHelper(this);
}

public ZooKeeperAnnouncer(LoadBalancerServer server, boolean initialIsUp,
boolean isDarkWarmupEnabled, String warmupClusterName, int warmupDuration, ScheduledExecutorService executorService, ServiceDiscoveryEventEmitter eventEmitter)
{
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=29.59.0
version=29.59.1
group=com.linkedin.pegasus
org.gradle.configureondemand=true
org.gradle.parallel=true
Expand Down

0 comments on commit 9510c64

Please sign in to comment.