org.apache.lucene.util.IOUtils.spinsLinux()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.apache.lucene.util.IOUtils.spinsLinux()方法的一些代码示例,展示了IOUtils.spinsLinux()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.spinsLinux()方法的具体详情如下:
包路径:org.apache.lucene.util.IOUtils
类名称:IOUtils
方法名:spinsLinux

IOUtils.spinsLinux介绍

暂无

代码示例

代码示例来源:origin: org.apache.lucene/lucene-core

/** Rough Linux-only heuristics to determine whether the provided
 *  {@code Path} is backed by spinning storage.  For example, this
 *  returns false if the disk is a solid-state disk.
 *
 *  @param path a location to check which must exist. the mount point will be determined from this location.
 *  @return false if the storage is non-rotational (e.g. an SSD), or true if it is spinning or could not be determined
 *  @throws IOException if {@code path} does not exist.
 *
 *  @lucene.internal */
public static boolean spins(Path path) throws IOException {
 // resolve symlinks (this will throw exception if the path does not exist)
 path = path.toRealPath();
 
 // Super cowboy approach, but seems to work!
 if (!Constants.LINUX) {
  return true; // no detection
 }
 try {
  return spinsLinux(path);
 } catch (Exception exc) {
  // our crazy heuristics can easily trigger SecurityException, AIOOBE, etc ...
  return true;
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

/** Rough Linux-only heuristics to determine whether the provided
 *  {@code Path} is backed by spinning storage.  For example, this
 *  returns false if the disk is a solid-state disk.
 *
 *  @param path a location to check which must exist. the mount point will be determined from this location.
 *  @return false if the storage is non-rotational (e.g. an SSD), or true if it is spinning or could not be determined
 *  @throws IOException if {@code path} does not exist.
 *
 *  @lucene.internal */
public static boolean spins(Path path) throws IOException {
 // resolve symlinks (this will throw exception if the path does not exist)
 path = path.toRealPath();
 
 // Super cowboy approach, but seems to work!
 if (!Constants.LINUX) {
  return true; // no detection
 }
 try {
  return spinsLinux(path);
 } catch (Exception exc) {
  // our crazy heuristics can easily trigger SecurityException, AIOOBE, etc ...
  return true;
 }
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

/** Rough Linux-only heuristics to determine whether the provided
 *  {@code Path} is backed by spinning storage.  For example, this
 *  returns false if the disk is a solid-state disk.
 *
 *  @param path a location to check which must exist. the mount point will be determined from this location.
 *  @return false if the storage is non-rotational (e.g. an SSD), or true if it is spinning or could not be determined
 *  @throws IOException if {@code path} does not exist.
 *
 *  @lucene.internal */
public static boolean spins(Path path) throws IOException {
 // resolve symlinks (this will throw exception if the path does not exist)
 path = path.toRealPath();
 
 // Super cowboy approach, but seems to work!
 if (!Constants.LINUX) {
  return true; // no detection
 }
 try {
  return spinsLinux(path);
 } catch (Exception exc) {
  // our crazy heuristics can easily trigger SecurityException, AIOOBE, etc ...
  return true;
 }
}

代码示例来源:origin: harbby/presto-connectors

/** Rough Linux-only heuristics to determine whether the provided
 *  {@code Path} is backed by spinning storage.  For example, this
 *  returns false if the disk is a solid-state disk.
 *
 *  @param path a location to check which must exist. the mount point will be determined from this location.
 *  @return false if the storage is non-rotational (e.g. an SSD), or true if it is spinning or could not be determined
 *  @throws IOException if {@code path} does not exist.
 *
 *  @lucene.internal */
public static boolean spins(Path path) throws IOException {
 // resolve symlinks (this will throw exception if the path does not exist)
 path = path.toRealPath();
 
 // Super cowboy approach, but seems to work!
 if (!Constants.LINUX) {
  return true; // no detection
 }
 try {
  return spinsLinux(path);
 } catch (Exception exc) {
  // our crazy heuristics can easily trigger SecurityException, AIOOBE, etc ...
  return true;
 }
}

相关文章