本文整理汇总了Java中org.apache.tinkerpop.gremlin.util.Gremlin.version方法的典型用法代码示例。如果您正苦于以下问题:Java Gremlin.version方法的具体用法?Java Gremlin.version怎么用?Java Gremlin.version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tinkerpop.gremlin.util.Gremlin
的用法示例。
在下文中一共展示了Gremlin.version方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldCopyDirectoriesCorrectly
import org.apache.tinkerpop.gremlin.util.Gremlin; //导入方法依赖的package包/类
@Test
public void shouldCopyDirectoriesCorrectly() throws Exception {
final String hdfsName = this.getClass().getSimpleName() + "-hdfs";
final String localName = this.getClass().getSimpleName() + "-local";
final FileSystem fs = FileSystem.get(new Configuration());
if (!new File(System.getProperty("java.io.tmpdir") + "/" + localName).exists())
assertTrue(new File(System.getProperty("java.io.tmpdir") + "/" + localName).mkdir());
File tempFile1 = new File(System.getProperty("java.io.tmpdir") + "/" + localName + "/test1.txt");
File tempFile2 = new File(System.getProperty("java.io.tmpdir") + "/" + localName + "/test2.txt");
assertTrue(tempFile1.createNewFile());
assertTrue(tempFile2.createNewFile());
assertTrue(tempFile1.exists());
assertTrue(tempFile2.exists());
if (fs.exists(new Path("target/" + hdfsName)))
assertTrue(fs.delete(new Path("target/" + hdfsName), true));
fs.copyFromLocalFile(true, new Path(tempFile1.getAbsolutePath()), new Path("target/" + hdfsName + "/test1.dat"));
fs.copyFromLocalFile(true, new Path(tempFile2.getAbsolutePath()), new Path("target/" + hdfsName + "/test2.dat"));
assertTrue(fs.exists(new Path("target/" + hdfsName + "/test1.dat")));
assertTrue(fs.exists(new Path("target/" + hdfsName + "/test2.dat")));
assertTrue(fs.exists(new Path("target/" + hdfsName)));
assertTrue(fs.isDirectory(new Path("target/" + hdfsName)));
assertFalse(tempFile1.exists());
assertFalse(tempFile2.exists());
assertTrue(new File(System.getProperty("java.io.tmpdir") + "/" + localName).exists());
assertTrue(new File(System.getProperty("java.io.tmpdir") + "/" + localName).delete());
assertTrue(fs.exists(new Path("target/" + hdfsName + "/test1.dat")));
assertTrue(fs.exists(new Path("target/" + hdfsName + "/test2.dat")));
assertTrue(fs.exists(new Path("target/" + hdfsName)));
assertTrue(fs.isDirectory(new Path("target/" + hdfsName)));
/////
final String hadoopGremlinLibsRemote = "hadoop-gremlin-" + Gremlin.version() + "-libs";
final File localDirectory = new File(System.getProperty("java.io.tmpdir") + "/" + hadoopGremlinLibsRemote);
final File localLibDirectory = new File(localDirectory.getAbsolutePath() + "/" + hdfsName);
if (localLibDirectory.exists()) {
Stream.of(localLibDirectory.listFiles()).forEach(File::delete);
assertTrue(localLibDirectory.delete());
}
assertFalse(localLibDirectory.exists());
assertEquals(localLibDirectory, AbstractHadoopGraphComputer.copyDirectoryIfNonExistent(fs, "target/" + hdfsName));
assertTrue(localLibDirectory.exists());
assertTrue(localLibDirectory.isDirectory());
assertEquals(2, Stream.of(localLibDirectory.listFiles()).filter(file -> file.getName().endsWith(".dat")).count());
}
示例2: getEngineVersion
import org.apache.tinkerpop.gremlin.util.Gremlin; //导入方法依赖的package包/类
@Override
public String getEngineVersion() {
return Gremlin.version();
}
示例3: getLanguageVersion
import org.apache.tinkerpop.gremlin.util.Gremlin; //导入方法依赖的package包/类
@Override
public String getLanguageVersion() {
return Gremlin.version();
}