Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.apache.zookeeper.data.StatPersisted;
import org.apache.zookeeper.server.watch.IWatchManager;
import org.apache.zookeeper.server.watch.WatchManagerFactory;
import org.apache.zookeeper.server.watch.WatchRegistration;
import org.apache.zookeeper.server.watch.WatcherMode;
import org.apache.zookeeper.server.watch.WatcherOrBitSet;
import org.apache.zookeeper.server.watch.WatchesPathReport;
Expand Down Expand Up @@ -1429,6 +1430,36 @@ public synchronized WatchesPathReport getWatchesByPath() {
return dataWatches.getWatchesByPath();
}

/**
* Returns bounded Data Watch registrations.
*
* @param path exact path filter, or null for every path
* @param sessionIds Session ID filter, or null for every session
* @param maxResults maximum registrations to return
* @return matching Data Watch registrations
*/
public List<WatchRegistration> getDataWatchRegistrations(
String path,
Set<Long> sessionIds,
int maxResults) {
return dataWatches.getWatchRegistrations(path, sessionIds, maxResults);
}

/**
* Returns bounded Children Watch registrations.
*
* @param path exact path filter, or null for every path
* @param sessionIds Session ID filter, or null for every session
* @param maxResults maximum registrations to return
* @return matching Children Watch registrations
*/
public List<WatchRegistration> getChildWatchRegistrations(
String path,
Set<Long> sessionIds,
int maxResults) {
return childWatches.getWatchRegistrations(path, sessionIds, maxResults);
}

/**
* Returns a watch summary.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public long getMostRecentZxid() {


@Override
int getSessionTimeout() {
public int getSessionTimeout() {
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ public ServerCnxn(final ZooKeeperServer zkServer) {
*/
private volatile boolean invalid = false;

abstract int getSessionTimeout();
/**
* Returns the negotiated session timeout in milliseconds.
*
* @return session timeout in milliseconds
*/
public abstract int getSessionTimeout();

public void incrOutstandingAndCheckThrottle(RequestHeader h) {
if (h.getXid() <= 0) {
Expand Down
Loading