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


Java ZooTrace.SERVER_PING_TRACE_MASK属性代码示例

本文整理汇总了Java中org.apache.zookeeper.server.ZooTrace.SERVER_PING_TRACE_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java ZooTrace.SERVER_PING_TRACE_MASK属性的具体用法?Java ZooTrace.SERVER_PING_TRACE_MASK怎么用?Java ZooTrace.SERVER_PING_TRACE_MASK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.zookeeper.server.ZooTrace的用法示例。


在下文中一共展示了ZooTrace.SERVER_PING_TRACE_MASK属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMask

private static long getMask(String mask) {
    long retv = 0;
    if (mask.equalsIgnoreCase("CLIENT_REQUEST_TRACE_MASK")) {
        retv = ZooTrace.CLIENT_REQUEST_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("CLIENT_DATA_PACKET_TRACE_MASK")) {
        retv = ZooTrace.CLIENT_DATA_PACKET_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("CLIENT_PING_TRACE_MASK")) {
        retv = ZooTrace.CLIENT_PING_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("SERVER_PACKET_TRACE_MASK")) {
        retv = ZooTrace.SERVER_PACKET_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("SESSION_TRACE_MASK")) {
        retv = ZooTrace.SESSION_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("EVENT_DELIVERY_TRACE_MASK")) {
        retv = ZooTrace.EVENT_DELIVERY_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("SERVER_PING_TRACE_MASK")) {
        retv = ZooTrace.SERVER_PING_TRACE_MASK;
    } else if (mask.equalsIgnoreCase("WARNING_TRACE_MASK")) {
        retv = ZooTrace.WARNING_TRACE_MASK;
    }
    return retv;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:21,代码来源:ServerAdminClient.java

示例2: readPacket

/**
 * read a packet from the leader
 *
 * @param pp
 *                the packet to be instantiated
 * @throws IOException
 */
void readPacket(QuorumPacket pp) throws IOException {
    synchronized (leaderIs) {
        leaderIs.readRecord(pp, "packet");
    }
    long traceMask = ZooTrace.SERVER_PACKET_TRACE_MASK;
    if (pp.getType() == Leader.PING) {
        traceMask = ZooTrace.SERVER_PING_TRACE_MASK;
    }
    if (LOG.isTraceEnabled()) {
        ZooTrace.logQuorumPacket(LOG, traceMask, 'i', pp);
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:19,代码来源:Learner.java

示例3: sendPackets

/**
 * This method will use the thread to send packets added to the
 * queuedPackets list
 *
 * @throws InterruptedException
 */
private void sendPackets() throws InterruptedException {
    long traceMask = ZooTrace.SERVER_PACKET_TRACE_MASK;
    while (true) {
        try {
            QuorumPacket p;
            p = queuedPackets.poll();
            if (p == null) {
                bufferedOutput.flush();
                p = queuedPackets.take();
            }

            if (p == proposalOfDeath) {
                // Packet of death!
                break;
            }
            if (p.getType() == Leader.PING) {
                traceMask = ZooTrace.SERVER_PING_TRACE_MASK;
            }
            if (LOG.isTraceEnabled()) {
                ZooTrace.logQuorumPacket(LOG, traceMask, 'o', p);
            }
            oa.writeRecord(p, "packet");
        } catch (IOException e) {
            if (!sock.isClosed()) {
                LOG.warn("Unexpected exception at " + this, e);
                try {
                    // this will cause everything to shutdown on
                    // this learner handler and will help notify
                    // the learner/observer instantaneously
                    sock.close();
                } catch(IOException ie) {
                    LOG.warn("Error closing socket for handler " + this, ie);
                }
            }
            break;
        }
    }
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:44,代码来源:LearnerHandler.java

示例4: sendPackets

/**
 * This method will use the thread to send packets added to the
 * queuedPackets list
 *
 * @throws InterruptedException
 */
private void sendPackets() throws InterruptedException {
    long traceMask = ZooTrace.SERVER_PACKET_TRACE_MASK;
    while (true) {
        try {
            QuorumPacket p;
            p = queuedPackets.poll();
            if (p == null) {
                bufferedOutput.flush();
                p = queuedPackets.take();
            }

            if (p == proposalOfDeath) {
                // Packet of death!
                break;
            }
            if (p.getType() == Leader.PING) {
                traceMask = ZooTrace.SERVER_PING_TRACE_MASK;
            }
            if (p.getType() == Leader.PROPOSAL) {
                syncLimitCheck.updateProposal(p.getZxid(), System.nanoTime());
            }
            if (LOG.isTraceEnabled()) {
                ZooTrace.logQuorumPacket(LOG, traceMask, 'o', p);
            }
            oa.writeRecord(p, "packet");
        } catch (IOException e) {
            if (!sock.isClosed()) {
                LOG.warn("Unexpected exception at " + this, e);
                try {
                    // this will cause everything to shutdown on
                    // this learner handler and will help notify
                    // the learner/observer instantaneously
                    sock.close();
                } catch(IOException ie) {
                    LOG.warn("Error closing socket for handler " + this, ie);
                }
            }
            break;
        }
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:47,代码来源:LearnerHandler.java


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