org.apache.tinkerpop.gremlin.spark.structure.io

## Class SparkContextStorage

- java.lang.Object
- - org.apache.tinkerpop.gremlin.spark.structure.io.SparkContextStorage

- All Implemented Interfaces:
    Storage

      public final class SparkContextStorage
      extends Object
      implements Storage

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cp(String sourceLocation, String targetLocation)` Recursively copy all the data sources from the source location to the target location.
    `String` | `describe(String location)`
    `boolean` | `exists(String location)` Determine whether the specified location has a data source.
    `Iterator<Vertex>` | `head(String location, Class readerClass, int totalLines)` Get the vertices at the specified graph location.
    `Iterator<String>` | `head(String location, int totalLines)` Get a string representation of the specified number of lines at the data source location.
    `<K,V> Iterator<KeyValue<K,V>>` | `head(String location, String memoryKey, Class readerClass, int totalLines)` Get the `KeyValue` data at the specified memory location.
    `List<String>` | `ls()` List all the data sources in the root directory.
    `List<String>` | `ls(String location)` List all the data sources at the specified location.
    `static SparkContextStorage` | `open()`
    `static SparkContextStorage` | `open(Configuration configuration)`
    `static SparkContextStorage` | `open(SparkContext sparkContext)`
    `static SparkContextStorage` | `open(String master)`
    `boolean` | `rm(String location)` Recursively remove the data source at the specified location.
    `String` | `toString()`

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.io.Storage

      `head, head, head`

- - ### Method Detail

    - #### open

          public static SparkContextStorage open()

    - #### open

          public static SparkContextStorage open(String master)

    - #### open

          public static SparkContextStorage open(Configuration configuration)

    - #### open

          public static SparkContextStorage open(SparkContext sparkContext)

    - #### ls

          public List<String> ls()

      Description copied from interface: `Storage`
      List all the data sources in the root directory.
      Specified by:
        `ls` in interface `Storage`
      Returns:
        the data sources in the root directory

    - #### ls

          public List<String> ls(String location)

      Description copied from interface: `Storage`
      List all the data sources at the specified location.
      Specified by:
        `ls` in interface `Storage`
      Parameters:
        `location` - a location
      Returns:
        the data sources at the specified location

    - #### cp

          public boolean cp(String sourceLocation,
                            String targetLocation)

      Description copied from interface: `Storage`
      Recursively copy all the data sources from the source location to the target location.
      Specified by:
        `cp` in interface `Storage`
      Parameters:
        `sourceLocation` - the source location
        `targetLocation` - the target location
      Returns:
        whether data sources were copied

    - #### exists

          public boolean exists(String location)

      Description copied from interface: `Storage`
      Determine whether the specified location has a data source.
      Specified by:
        `exists` in interface `Storage`
      Parameters:
        `location` - a location to check
      Returns:
        whether that location has a data source.

    - #### rm

          public boolean rm(String location)

      Description copied from interface: `Storage`
      Recursively remove the data source at the specified location.
      Specified by:
        `rm` in interface `Storage`
      Parameters:
        `location` - the location of the data source
      Returns:
        whether a data source was removed.

    - #### head

          public Iterator<Vertex> head(String location,
                                       Class readerClass,
                                       int totalLines)

      Description copied from interface: `Storage`
      Get the vertices at the specified graph location.
      Specified by:
        `head` in interface `Storage`
      Parameters:
        `location` - the location of the graph (or the root location and search will be made)
        `readerClass` - the class of the parser that understands the graph format
        `totalLines` - the total number of lines of the graph to return
      Returns:
        an iterator of vertices.

    - #### head

          public <K,V> Iterator<KeyValue<K,V>> head(String location,
                                                    String memoryKey,
                                                    Class readerClass,
                                                    int totalLines)

      Description copied from interface: `Storage`
      Get the `KeyValue` data at the specified memory location.
      Specified by:
        `head` in interface `Storage`
      Parameters:
        `location` - the root location of the data
        `memoryKey` - the memory key
        `readerClass` - the class of the parser that understands the memory format
        `totalLines` - the total number of key-values to return
      Returns:
        an iterator of key-values.

    - #### head

          public Iterator<String> head(String location,
                                       int totalLines)

      Description copied from interface: `Storage`
      Get a string representation of the specified number of lines at the data source location.
      Specified by:
        `head` in interface `Storage`
      Parameters:
        `location` - the data source location
        `totalLines` - the total number of lines to retrieve
      Returns:
        an iterator of lines.

    - #### describe

          public String describe(String location)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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