Java 类org.apache.hadoop.hbase.util.JVM 实例源码

项目:ditb    文件:AsyncRpcClient.java   
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);
  }
}
项目:hbase    文件:TestNettyIPC.java   
@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;
}
项目:hbase    文件:TestNettyIPC.java   
@BeforeClass
public static void setUpBeforeClass() {
  NIO = new NioEventLoopGroup();
  if (JVM.isLinux() && JVM.isAmd64()) {
    EPOLL = new EpollEventLoopGroup();
  }
}
项目:hbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) {
    return 0;
  }
  JVM jvm = new JVM();
  return (int) jvm.getOpenFileDescriptorCount();
}
项目:hbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) {
    return 0;
  }
  JVM jvm = new JVM();
  return (int) jvm.getMaxFileDescriptorCount();
}
项目:hbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) {
    return 0;
  }
  return (int) (new JVM().getSystemLoadAverage() * 100);
}
项目:hbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) {
    return 0;
  }
  return new JVM().getNumberOfRunningProcess();
}
项目:hbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) {
    return 0;
  }
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:ditb    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:ditb    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }
项目:ditb    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int)(new JVM().getSystemLoadAverage()*100);
}
项目:ditb    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return new JVM().getNumberOfRunningProcess();
}
项目:ditb    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:pbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:pbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }
项目:pbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int)(new JVM().getSystemLoadAverage()*100);
}
项目:pbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return new JVM().getNumberOfRunningProcess();
}
项目:pbase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:HIndex    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:HIndex    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }
项目:HIndex    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int)(new JVM().getSystemLoadAverage()*100);
}
项目:HIndex    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return new JVM().getNumberOfRunningProcess();
}
项目:HIndex    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:PyroDB    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:PyroDB    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }
项目:PyroDB    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int)(new JVM().getSystemLoadAverage()*100);
}
项目:PyroDB    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return new JVM().getNumberOfRunningProcess();
}
项目:PyroDB    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:c5    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:c5    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }
项目:c5    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int)(new JVM().getSystemLoadAverage()*100);
}
项目:c5    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return new JVM().getNumberOfRunningProcess();
}
项目:c5    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (!JVM.isUnix()) return 0;
  return (int) (new JVM().getFreeMemory() / (1024L * 1024L));
}
项目:DominoHBase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (JVM.isUnix() == false) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getOpenFileDescriptorCount();
}
项目:DominoHBase    文件:ResourceCheckerJUnitListener.java   
@Override
public int getVal(Phase phase) {
  if (JVM.isUnix() == false) return 0;
  JVM jvm = new JVM();
  return (int)jvm.getMaxFileDescriptorCount();
 }