本文整理汇总了Java中org.apache.zookeeper.Watcher.Event.EventType.None方法的典型用法代码示例。如果您正苦于以下问题:Java EventType.None方法的具体用法?Java EventType.None怎么用?Java EventType.None使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.zookeeper.Watcher.Event.EventType
的用法示例。
在下文中一共展示了EventType.None方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void process(WatchedEvent event) {
if (event.getState() == KeeperState.SyncConnected) {
if (latch != null) {
latch.countDown();
}
}
if (event.getType() == EventType.None) {
return;
}
try {
events.put(event);
} catch (InterruptedException e) {
Assert.assertTrue("interruption unexpected", false);
}
}
示例2: queueEvent
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
private void queueEvent(WatchedEvent event,
Set<Watcher> materializedWatchers) {
if (event.getType() == EventType.None
&& sessionState == event.getState()) {
return;
}
sessionState = event.getState();
final Set<Watcher> watchers;
if (materializedWatchers == null) {
// materialize the watchers based on the event
watchers = watcher.materialize(event.getState(),
event.getType(), event.getPath());
} else {
watchers = new HashSet<Watcher>();
watchers.addAll(materializedWatchers);
}
WatcherSetEventPair pair = new WatcherSetEventPair(watchers, event);
// queue the pair (watch set & event) for later processing
waitingEvents.add(pair);
}
示例3: queueEvent
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void queueEvent(WatchedEvent event) {
if (event.getType() == EventType.None
&& sessionState == event.getState()) {
return;
}
sessionState = event.getState();
// materialize the watchers based on the event
WatcherSetEventPair pair = new WatcherSetEventPair(
watcher.materialize(event.getState(), event.getType(),
event.getPath()),
event);
// queue the pair (watch set & event) for later processing
waitingEvents.add(pair);
}
示例4: process
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void process(WatchedEvent event) {
System.err.println(event);
synchronized (this) {
if (event.getType() == EventType.None) {
connected = (event.getState() == KeeperState.SyncConnected);
notifyAll();
}
}
}
示例5: process
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void process(WatchedEvent event) {
super.process(event);
if (event.getType() != EventType.None) {
try {
events.put(event);
} catch (InterruptedException e) {
LOG.warn("ignoring interrupt during event.put");
}
}
}
示例6: process
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void process(WatchedEvent event) {
LOG.debug("Event path : {}, eventPath : {}"
+ new Object[] { path, event.getPath() });
this.eventPath = event.getPath();
// notifies watcher removal
if (latch.getCount() == 0) {
if (event.getType() != EventType.None) {
eventsAfterWatchRemoval.add(event.getType());
}
}
if (event.getType() == EventType.ChildWatchRemoved
|| event.getType() == EventType.DataWatchRemoved) {
latch.countDown();
}
}
示例7: process
import org.apache.zookeeper.Watcher.Event.EventType; //导入方法依赖的package包/类
public void process(WatchedEvent event) {
super.process(event);
if (event.getType() == EventType.None) {
states.add(event);
}
}