本文整理汇总了Java中org.apache.hadoop.hbase.util.JVM类的典型用法代码示例。如果您正苦于以下问题:Java JVM类的具体用法?Java JVM怎么用?Java JVM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JVM类属于org.apache.hadoop.hbase.util包,在下文中一共展示了JVM类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createEventLoopGroup
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
private static Pair<EventLoopGroup, Class<? extends Channel>> createEventLoopGroup(
Configuration conf) {
// Max amount of threads to use. 0 lets Netty decide based on amount of cores
int maxThreads = conf.getInt(CLIENT_MAX_THREADS, 0);
// Config to enable native transport. Does not seem to be stable at time of implementation
// although it is not extensively tested.
boolean epollEnabled = conf.getBoolean(USE_NATIVE_TRANSPORT, false);
// Use the faster native epoll transport mechanism on linux if enabled
if (epollEnabled && JVM.isLinux() && JVM.isAmd64()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Create EpollEventLoopGroup with maxThreads = " + maxThreads);
}
return new Pair<EventLoopGroup, Class<? extends Channel>>(new EpollEventLoopGroup(maxThreads,
Threads.newDaemonThreadFactory("AsyncRpcChannel")), EpollSocketChannel.class);
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Create NioEventLoopGroup with maxThreads = " + maxThreads);
}
return new Pair<EventLoopGroup, Class<? extends Channel>>(new NioEventLoopGroup(maxThreads,
Threads.newDaemonThreadFactory("AsyncRpcChannel")), NioSocketChannel.class);
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:AsyncRpcClient.java
示例2: parameters
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
@Parameters(name = "{index}: EventLoop={0}")
public static Collection<Object[]> parameters() {
List<Object[]> params = new ArrayList<>();
params.add(new Object[] { "nio" });
params.add(new Object[] { "perClientNio" });
if (JVM.isLinux() && JVM.isAmd64()) {
params.add(new Object[] { "epoll" });
}
return params;
}
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:TestNettyIPC.java
示例3: setUpBeforeClass
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() {
NIO = new NioEventLoopGroup();
if (JVM.isLinux() && JVM.isAmd64()) {
EPOLL = new EpollEventLoopGroup();
}
}
开发者ID:apache,项目名称:hbase,代码行数:8,代码来源:TestNettyIPC.java
示例4: getVal
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
@Override
public int getVal(Phase phase) {
if (!JVM.isUnix()) {
return 0;
}
JVM jvm = new JVM();
return (int) jvm.getOpenFileDescriptorCount();
}
开发者ID:apache,项目名称:hbase,代码行数:9,代码来源:ResourceCheckerJUnitListener.java
示例5: getVal
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
@Override
public int getVal(Phase phase) {
if (!JVM.isUnix()) return 0;
JVM jvm = new JVM();
return (int)jvm.getOpenFileDescriptorCount();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:ResourceCheckerJUnitListener.java
示例6: getVal
import org.apache.hadoop.hbase.util.JVM; //导入依赖的package包/类
@Override
public int getVal(Phase phase) {
if (JVM.isUnix() == false) return 0;
JVM jvm = new JVM();
return (int)jvm.getOpenFileDescriptorCount();
}
开发者ID:daidong,项目名称:DominoHBase,代码行数:7,代码来源:ResourceCheckerJUnitListener.java
注:本文中的org.apache.hadoop.hbase.util.JVM类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论