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


Java CobarServer.getInstance方法代码示例

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


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

示例1: getRow

import com.alibaba.cobar.CobarServer; //导入方法依赖的package包/类
private static RowDataPacket getRow(String charset) {
    CobarServer server = CobarServer.getInstance();
    long startupTime = server.getStartupTime();
    long now = TimeUtil.currentTimeMillis();
    long uptime = now - startupTime;
    Runtime rt = Runtime.getRuntime();
    long total = rt.totalMemory();
    long max = rt.maxMemory();
    long used = (total - rt.freeMemory());
    RowDataPacket row = new RowDataPacket(FIELD_COUNT);
    row.add(StringUtil.encode(FormatUtil.formatTime(uptime, 3), charset));
    row.add(LongUtil.toBytes(used));
    row.add(LongUtil.toBytes(total));
    row.add(LongUtil.toBytes(max));
    row.add(StringUtil.encode(charset, charset));
    row.add(StringUtil.encode(CobarServer.getInstance().isOnline() ? "ON" : "OFF", charset));
    return row;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:19,代码来源:ShowServer.java

示例2: getRow

import com.alibaba.cobar.CobarServer; //导入方法依赖的package包/类
private static RowDataPacket getRow(String charset) {
    CobarServer server = CobarServer.getInstance();
    long startupTime = server.getStartupTime();
    long now = TimeUtil.currentTimeMillis();
    long uptime = now - startupTime;
    Runtime rt = Runtime.getRuntime();
    long total = rt.totalMemory();
    long max = rt.maxMemory();
    long used = (total - rt.freeMemory());
    RowDataPacket row = new RowDataPacket(FIELD_COUNT);
    row.add(StringUtil.encode(FormatUtil.formatTime(uptime, 3), charset));
    row.add(LongUtil.toBytes(used));
    row.add(LongUtil.toBytes(total));
    row.add(LongUtil.toBytes(max));
    row.add(LongUtil.toBytes(server.getConfig().getReloadTime()));
    row.add(LongUtil.toBytes(server.getConfig().getRollbackTime()));
    row.add(StringUtil.encode(charset, charset));
    row.add(StringUtil.encode(CobarServer.getInstance().isOnline() ? "ON" : "OFF", charset));
    return row;
}
 
开发者ID:alibaba,项目名称:cobar,代码行数:21,代码来源:ShowServer.java

示例3: getExecutors

import com.alibaba.cobar.CobarServer; //导入方法依赖的package包/类
private static List<NameableExecutor> getExecutors() {
    List<NameableExecutor> list = new LinkedList<NameableExecutor>();
    CobarServer server = CobarServer.getInstance();
    list.add(server.getTimerExecutor());
    list.add(server.getManagerExecutor());
    list.add(server.getServerExectuor());
    for (NIOProcessor p : server.getProcessors()) {
        list.add(p.getHandler());
    }
    return list;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:12,代码来源:ShowThreadPool.java

示例4: getExecutors

import com.alibaba.cobar.CobarServer; //导入方法依赖的package包/类
private static List<NameableExecutor> getExecutors() {
    List<NameableExecutor> list = new LinkedList<NameableExecutor>();
    CobarServer server = CobarServer.getInstance();
    list.add(server.getInitExecutor());
    list.add(server.getTimerExecutor());
    list.add(server.getManagerExecutor());
    for (NIOProcessor p : server.getProcessors()) {
        list.add(p.getHandler());
        list.add(p.getExecutor());
        list.add(p.getCommitter());
    }
    return list;
}
 
开发者ID:alibaba,项目名称:cobar,代码行数:14,代码来源:ShowThreadPool.java


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