test_class.file: hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/AbstractHadoopGraphComputerTest.java
test_class.identifier: AbstractHadoopGraphComputerTest
test_case.body: @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());
      }
test_case.class_method_signature: AbstractHadoopGraphComputerTest.shouldCopyDirectoriesCorrectly()
test_case.full_signature: @Test public void shouldCopyDirectoriesCorrectly()
test_case.identifier: shouldCopyDirectoriesCorrectly
test_case.invocations: getSimpleName getClass getSimpleName getClass get exists getProperty assertTrue mkdir getProperty getProperty getProperty assertTrue createNewFile assertTrue createNewFile assertTrue exists assertTrue exists exists assertTrue delete copyFromLocalFile getAbsolutePath copyFromLocalFile getAbsolutePath assertTrue exists assertTrue exists assertTrue exists assertTrue isDirectory assertFalse exists assertFalse exists assertTrue exists getProperty assertTrue delete getProperty assertTrue exists assertTrue exists assertTrue exists assertTrue isDirectory version getProperty getAbsolutePath exists forEach of listFiles assertTrue delete assertFalse exists assertEquals copyDirectoryIfNonExistent assertTrue exists assertTrue isDirectory assertEquals count filter of listFiles endsWith getName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldCopyDirectoriesCorrectly()
focal_class.declarator: PATH_PATTERN =
              Pattern.compile(File.pathSeparator.equals(":") ? "([^:]|://)+" : ("[^" + File.pathSeparator + "]"))
focal_class.modifier: private final static
focal_class.original_string: private final static Pattern PATH_PATTERN =
              Pattern.compile(File.pathSeparator.equals(":") ? "([^:]|://)+" : ("[^" + File.pathSeparator + "]"));
focal_class.type: Pattern
focal_class.var_name: PATH_PATTERN
focal_class.declarator: logger
focal_class.modifier: protected final
focal_class.original_string: protected final Logger logger;
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: hadoopGraph
focal_class.modifier: protected final
focal_class.original_string: protected final HadoopGraph hadoopGraph;
focal_class.type: HadoopGraph
focal_class.var_name: hadoopGraph
focal_class.declarator: executed = false
focal_class.modifier: protected
focal_class.original_string: protected boolean executed = false;
focal_class.type: boolean
focal_class.var_name: executed
focal_class.declarator: mapReducers = new HashSet<>()
focal_class.modifier: protected final
focal_class.original_string: protected final Set<MapReduce> mapReducers = new HashSet<>();
focal_class.type: Set<MapReduce>
focal_class.var_name: mapReducers
focal_class.declarator: vertexProgram
focal_class.modifier: protected
focal_class.original_string: protected VertexProgram<Object> vertexProgram;
focal_class.type: VertexProgram<Object>
focal_class.var_name: vertexProgram
focal_class.declarator: workers = 1
focal_class.modifier: protected
focal_class.original_string: protected int workers = 1;
focal_class.type: int
focal_class.var_name: workers
focal_class.declarator: resultGraph = null
focal_class.modifier: protected
focal_class.original_string: protected ResultGraph resultGraph = null;
focal_class.type: ResultGraph
focal_class.var_name: resultGraph
focal_class.declarator: persist = null
focal_class.modifier: protected
focal_class.original_string: protected Persist persist = null;
focal_class.type: Persist
focal_class.var_name: persist
focal_class.declarator: graphFilter = new GraphFilter()
focal_class.modifier: protected
focal_class.original_string: protected GraphFilter graphFilter = new GraphFilter();
focal_class.type: GraphFilter
focal_class.var_name: graphFilter
focal_class.file: hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/AbstractHadoopGraphComputer.java
focal_class.identifier: AbstractHadoopGraphComputer
focal_class.interfaces: implements GraphComputer
focal_class.class_method_signature: AbstractHadoopGraphComputer.AbstractHadoopGraphComputer(final HadoopGraph hadoopGraph)
focal_class.full_signature: public  AbstractHadoopGraphComputer(final HadoopGraph hadoopGraph)
focal_class.identifier: AbstractHadoopGraphComputer
focal_class.modifiers: public
focal_class.parameters: (final HadoopGraph hadoopGraph)
focal_class.signature:  AbstractHadoopGraphComputer(final HadoopGraph hadoopGraph)
focal_class.class_method_signature: AbstractHadoopGraphComputer.vertices(final Traversal<Vertex, Vertex> vertexFilter)
focal_class.full_signature: @Override public GraphComputer vertices(final Traversal<Vertex, Vertex> vertexFilter)
focal_class.identifier: vertices
focal_class.modifiers: @Override public
focal_class.parameters: (final Traversal<Vertex, Vertex> vertexFilter)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer vertices(final Traversal<Vertex, Vertex> vertexFilter)
focal_class.class_method_signature: AbstractHadoopGraphComputer.edges(final Traversal<Vertex, Edge> edgeFilter)
focal_class.full_signature: @Override public GraphComputer edges(final Traversal<Vertex, Edge> edgeFilter)
focal_class.identifier: edges
focal_class.modifiers: @Override public
focal_class.parameters: (final Traversal<Vertex, Edge> edgeFilter)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer edges(final Traversal<Vertex, Edge> edgeFilter)
focal_class.class_method_signature: AbstractHadoopGraphComputer.result(final ResultGraph resultGraph)
focal_class.full_signature: @Override public GraphComputer result(final ResultGraph resultGraph)
focal_class.identifier: result
focal_class.modifiers: @Override public
focal_class.parameters: (final ResultGraph resultGraph)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer result(final ResultGraph resultGraph)
focal_class.class_method_signature: AbstractHadoopGraphComputer.persist(final Persist persist)
focal_class.full_signature: @Override public GraphComputer persist(final Persist persist)
focal_class.identifier: persist
focal_class.modifiers: @Override public
focal_class.parameters: (final Persist persist)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer persist(final Persist persist)
focal_class.class_method_signature: AbstractHadoopGraphComputer.program(final VertexProgram vertexProgram)
focal_class.full_signature: @Override public GraphComputer program(final VertexProgram vertexProgram)
focal_class.identifier: program
focal_class.modifiers: @Override public
focal_class.parameters: (final VertexProgram vertexProgram)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer program(final VertexProgram vertexProgram)
focal_class.class_method_signature: AbstractHadoopGraphComputer.mapReduce(final MapReduce mapReduce)
focal_class.full_signature: @Override public GraphComputer mapReduce(final MapReduce mapReduce)
focal_class.identifier: mapReduce
focal_class.modifiers: @Override public
focal_class.parameters: (final MapReduce mapReduce)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer mapReduce(final MapReduce mapReduce)
focal_class.class_method_signature: AbstractHadoopGraphComputer.workers(final int workers)
focal_class.full_signature: @Override public GraphComputer workers(final int workers)
focal_class.identifier: workers
focal_class.modifiers: @Override public
focal_class.parameters: (final int workers)
focal_class.return: GraphComputer
focal_class.signature: GraphComputer workers(final int workers)
focal_class.class_method_signature: AbstractHadoopGraphComputer.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: AbstractHadoopGraphComputer.validateStatePriorToExecution()
focal_class.full_signature: protected void validateStatePriorToExecution()
focal_class.identifier: validateStatePriorToExecution
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void validateStatePriorToExecution()
focal_class.class_method_signature: AbstractHadoopGraphComputer.loadJars(final Configuration hadoopConfiguration, final Object... params)
focal_class.full_signature: protected void loadJars(final Configuration hadoopConfiguration, final Object... params)
focal_class.identifier: loadJars
focal_class.modifiers: protected
focal_class.parameters: (final Configuration hadoopConfiguration, final Object... params)
focal_class.return: void
focal_class.signature: void loadJars(final Configuration hadoopConfiguration, final Object... params)
focal_class.class_method_signature: AbstractHadoopGraphComputer.loadJar(final Configuration hadoopConfiguration, final File file, final Object... params)
focal_class.full_signature: protected abstract void loadJar(final Configuration hadoopConfiguration, final File file, final Object... params)
focal_class.identifier: loadJar
focal_class.modifiers: protected abstract
focal_class.parameters: (final Configuration hadoopConfiguration, final File file, final Object... params)
focal_class.return: void
focal_class.signature: void loadJar(final Configuration hadoopConfiguration, final File file, final Object... params)
focal_class.class_method_signature: AbstractHadoopGraphComputer.features()
focal_class.full_signature: @Override public Features features()
focal_class.identifier: features
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Features
focal_class.signature: Features features()
focal_class.class_method_signature: AbstractHadoopGraphComputer.copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)
focal_class.full_signature: public static File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)
focal_class.identifier: copyDirectoryIfNonExistent
focal_class.modifiers: public static
focal_class.parameters: (final FileSystem fileSystem, final String directory)
focal_class.return: File
focal_class.signature: File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)
focal_method.body: public static File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory) {
          try {
              final String hadoopGremlinLibsRemote = "hadoop-gremlin-" + Gremlin.version() + "-libs";
              final Path path = new Path(directory);
              if (Boolean.valueOf(System.getProperty("is.testing", "false")) || (fileSystem.exists(path) && fileSystem.isDirectory(path))) {
                  final File tempDirectory = new File(System.getProperty("java.io.tmpdir") + File.separator + hadoopGremlinLibsRemote);
                  assert tempDirectory.exists() || tempDirectory.mkdirs();
                  final String tempPath = tempDirectory.getAbsolutePath() + File.separator + path.getName();
                  final RemoteIterator<LocatedFileStatus> files = fileSystem.listFiles(path, false);
                  while (files.hasNext()) {
                      final LocatedFileStatus f = files.next();
                      fileSystem.copyToLocalFile(false, f.getPath(), new Path(tempPath + System.getProperty("file.separator") + f.getPath().getName()), true);
                  }
                  return new File(tempPath);
              } else
                  return new File(directory);
          } catch (final IOException e) {
              throw new IllegalStateException(e.getMessage(), e);
          }
      }
focal_method.class_method_signature: AbstractHadoopGraphComputer.copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)
focal_method.full_signature: public static File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)
focal_method.identifier: copyDirectoryIfNonExistent
focal_method.invocations: version valueOf getProperty exists isDirectory getProperty exists mkdirs getAbsolutePath getName listFiles hasNext next copyToLocalFile getPath getProperty getName getPath getMessage
focal_method.modifiers: public static
focal_method.parameters: (final FileSystem fileSystem, final String directory)
focal_method.return: File
focal_method.signature: File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String directory)