diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java b/container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java index f57a5f4ab1e..49529936901 100644 --- a/container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java +++ b/container-search/src/main/java/com/yahoo/search/query/UniqueRequestId.java @@ -1,6 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.query; +import com.yahoo.container.Server; + import java.util.concurrent.atomic.AtomicLong; /** @@ -25,6 +27,17 @@ public class UniqueRequestId { /** * Creates a session id which is unique across the cluster this runtime is a member of each time this is called. * Calling this causes synchronization. + * + * @deprecated use nextId(serverId) instead + */ + @Deprecated + public static UniqueRequestId next() { + return new UniqueRequestId(Server.get().getServerDiscriminator(), System.currentTimeMillis(), sequenceCounter.getAndIncrement()); + } + + /** + * Creates a session id which is unique across the cluster this runtime is a member of each time this is called. + * Calling this causes synchronization. */ public static UniqueRequestId next(String serverId) { return new UniqueRequestId(serverId, System.currentTimeMillis(), sequenceCounter.getAndIncrement()); |