org.apache.tinkerpop.gremlin

## Class AbstractFileGraphProvider

- java.lang.Object
- - org.apache.tinkerpop.gremlin.AbstractGraphProvider
  - - org.apache.tinkerpop.gremlin.AbstractFileGraphProvider

- All Implemented Interfaces:
    GraphProvider

      public abstract class AbstractFileGraphProvider
      extends AbstractGraphProvider

  A base `GraphProvider` that is typically for use with Hadoop-based graphs as it enables access to the various resource data files that are used in the tests.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.GraphProvider

      `GraphProvider.Descriptor, GraphProvider.TestListener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `graphSONInput`
    `static Map<String,String>` | `PATHS`
    `protected static Random` | `RANDOM`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.GraphProvider

      `CORE_IMPLEMENTATIONS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractFileGraphProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear(Graph graph, Configuration configuration)` Clears a `Graph` of all data and settings.
    `protected String` | `getInputLocation(Graph g, LoadGraphWith.GraphData graphData)`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.AbstractGraphProvider

      `cleanParameters, deleteDirectory, getBaseConfiguration, loadGraphData, makeTestDirectory, newGraphConfiguration, readIntoGraph`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.GraphProvider

      `clear, convertId, convertLabel, getGraphComputer, getImplementations, getStaticFeatures, getTestListener, getWorkingDirectory, newGraphConfiguration, openTestGraph, standardGraphConfiguration, standardTestGraph, traversal, traversal`

- - ### Field Detail

    - #### RANDOM

          protected static final Random RANDOM

    - #### graphSONInput

          protected boolean graphSONInput

    - #### PATHS

          public static Map<String,String> PATHS

  - ### Constructor Detail

    - #### AbstractFileGraphProvider

          public AbstractFileGraphProvider()

  - ### Method Detail

    - #### clear

          public void clear(Graph graph,
                            Configuration configuration)
                     throws Exception

      Description copied from interface: `GraphProvider`
      Clears a `Graph` of all data and settings. Implementations will have different ways of handling this. It is typically expected that `Graph.close()` will be called and open transactions will be closed. For a brute force approach, implementers can simply delete data directories provided in the configuration. Implementers may choose a more elegant approach if it exists.

      Implementations should be able to accept an argument of null for the `Graph`, in which case the only action that can be performed is a clear given the configuration. The method will typically be called this way as clean up task on setup to ensure that a persisted graph has a clear space to create a test graph.

      Implementations should be able to accept an argument of null for the `org.apache.commons.configuration.Configuration` as well, and a proper handling is needed. Otherwise, a NullPointerException may be thrown.

      Calls to this method may occur multiple times for a specific test. Develop this method to be idempotent.
      Throws:
        `Exception`

    - #### getInputLocation

          protected String getInputLocation(Graph g,
                                            LoadGraphWith.GraphData graphData)

Copyright © 2013–2019 Apache Software Foundation. All rights reserved.