当前位置: 首页>>代码示例>>Java>>正文


Java EventType.None方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:17,代码来源:WatcherFuncTest.java

示例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);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:21,代码来源:ClientCnxn.java

示例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);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:16,代码来源:ClientCnxn.java

示例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();
        }
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:10,代码来源:GenerateLoad.java

示例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");
        }
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:11,代码来源:ClientTest.java

示例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();
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:16,代码来源:RemoveWatchesTest.java

示例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);
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:7,代码来源:SessionTest.java


注:本文中的org.apache.zookeeper.Watcher.Event.EventType.None方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。