org.apache.hadoop.util.Shell.isJava7OrAbove()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(97)

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

Shell.isJava7OrAbove介绍

[英]query to see if system is Java 7 or later. Now that Hadoop requires Java 7 or later, this always returns true.
[中]查询系统是否为Java 7或更高版本。既然Hadoop需要Java 7或更高版本,它总是返回true。

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm
 * is chosen depending on the platform.
 */
public static Checksum newCrc32() {
 return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm
 * is chosen depending on the platform.
 */
public static Checksum newCrc32() {
 return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

@Override
protected boolean emulatingSymlinksOnWindows() {
 // Java 6 on Windows has very poor symlink support. Specifically
 // Specifically File#length and File#renameTo do not work as expected.
 // (see HADOOP-9061 for additional details)
 // Hence some symlink tests will be skipped.
 //
 return (Shell.WINDOWS && !Shell.isJava7OrAbove());
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

@Override
protected boolean emulatingSymlinksOnWindows() {
 // Java 6 on Windows has very poor symlink support. Specifically
 // Specifically File#length and File#renameTo do not work as expected.
 // (see HADOOP-9061 for additional details)
 // Hence some symlink tests will be skipped.
 //
 return (Shell.WINDOWS && !Shell.isJava7OrAbove());
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Create a Crc32 Checksum object. The implementation of the Crc32 algorithm
 * is chosen depending on the platform.
 */
public static Checksum newCrc32() {
 return Shell.isJava7OrAbove()? new CRC32(): new PureJavaCrc32();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

@Override
protected void link(Path src, Path dst) throws IOException {
 File srcFile = new File(src.toUri().getPath());
 String srcFileStr = srcFile.getPath();
 String dstFileStr = new File(dst.toString()).getPath();
 // If not on Java7+ on Windows, then copy file instead of symlinking.
 // See also FileUtil#symLink for full explanation.
 if (!Shell.isJava7OrAbove() && srcFile.isFile()) {
  lineWithLenCheck(String.format("@copy \"%s\" \"%s\"", srcFileStr, dstFileStr));
  errorCheck();
 } else {
  lineWithLenCheck(String.format("@%s symlink \"%s\" \"%s\"", Shell.WINUTILS,
   dstFileStr, srcFileStr));
  errorCheck();
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

@Override
protected void link(Path src, Path dst) throws IOException {
 File srcFile = new File(src.toUri().getPath());
 String srcFileStr = srcFile.getPath();
 String dstFileStr = new File(dst.toString()).getPath();
 // If not on Java7+ on Windows, then copy file instead of symlinking.
 // See also FileUtil#symLink for full explanation.
 if (!Shell.isJava7OrAbove() && srcFile.isFile()) {
  lineWithLenCheck(String.format("@copy \"%s\" \"%s\"", srcFileStr, dstFileStr));
  errorCheck();
 } else {
  lineWithLenCheck(String.format("@%s symlink \"%s\" \"%s\"", Shell.WINUTILS,
   dstFileStr, srcFileStr));
  errorCheck();
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) {
 try {
  LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) {
 try {
  LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

if (Shell.WINDOWS && !Shell.isJava7OrAbove() && targetFile.isFile()) {
 try {
  LOG.warn("FileUtil#symlink: On Windows+Java6, copying file instead " +

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

Assert.assertFalse(file.exists());
if (Shell.WINDOWS && !Shell.isJava7OrAbove()) {

代码示例来源:origin: ch.cern.hadoop/hadoop-common

Assert.assertFalse(file.exists());
if (Shell.WINDOWS && !Shell.isJava7OrAbove()) {

相关文章

微信公众号

最新文章

更多