org.apache.tinkerpop.gremlin.hadoop.structure.io

## Class FileSystemStorage

- java.lang.Object
- - org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorage

- All Implemented Interfaces:
    Storage

      public final class FileSystemStorage
      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
    --- | ---
    `void` | `copyFromLocal(String fromLocation, String toLocation)`
    `void` | `copyToLocal(String fromLocation, String toLocation)`
    `boolean` | `cp(String sourceLocation, String targetLocation)` Recursively copy all the data sources from the source location to the target 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.
    `void` | `mergeToLocal(String fromLocation, String toLocation)`
    `boolean` | `mkdir(String location)`
    `static FileSystemStorage` | `open()`
    `static FileSystemStorage` | `open(Configuration configuration)`
    `static FileSystemStorage` | `open(FileSystem fileSystem)`
    `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 FileSystemStorage open()

    - #### open

          public static FileSystemStorage open(Configuration configuration)

    - #### open

          public static FileSystemStorage open(FileSystem fileSystem)

    - #### 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

    - #### mkdir

          public boolean mkdir(String 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<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.

    - #### 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.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### copyToLocal

          public void copyToLocal(String fromLocation,
                                  String toLocation)

    - #### copyFromLocal

          public void copyFromLocal(String fromLocation,
                                    String toLocation)

    - #### mergeToLocal

          public void mergeToLocal(String fromLocation,
                                   String toLocation)

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