org.apache.tinkerpop.gremlin.giraph.process.computer

## Class GiraphMemory

- java.lang.Object
- - MasterCompute
  - - org.apache.tinkerpop.gremlin.giraph.process.computer.GiraphMemory

- All Implemented Interfaces:
    Memory

      public final class GiraphMemory
      extends MasterCompute
      implements Memory

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.computer.Memory

      `Memory.Admin, Memory.Exceptions`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GiraphMemory()`
    `GiraphMemory(GiraphWorkerContext worker, VertexProgram<?> vertexProgram)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(String key, Object value)` Set the value of the provided key.
    `void` | `compute()`
    `boolean` | `exists(String key)` Whether the key exists in the memory.
    `<R> R` | `get(String key)` Get the value associated with the provided key.
    `int` | `getIteration()` Get the current iteration number.
    `long` | `getRuntime()` Get the amount of milliseconds the `GraphComputer` has been executing thus far.
    `void` | `initialize()`
    `Set<String>` | `keys()` The set of keys currently associated with this memory.
    `void` | `readFields(DataInput input)`
    `void` | `set(String key, Object value)`
    `String` | `toString()`
    `void` | `write(DataOutput output)`

    - ### 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.process.computer.Memory

      `asMap, isInitialIteration`

- - ### Constructor Detail

    - #### GiraphMemory

          public GiraphMemory()

    - #### GiraphMemory

          public GiraphMemory(GiraphWorkerContext worker,
                              VertexProgram<?> vertexProgram)

  - ### Method Detail

    - #### initialize

          public void initialize()

    - #### compute

          public void compute()

    - #### getIteration

          public int getIteration()

      Description copied from interface: `Memory`
      Get the current iteration number.
      Specified by:
        `getIteration` in interface `Memory`
      Returns:
        the current iteration

    - #### getRuntime

          public long getRuntime()

      Description copied from interface: `Memory`
      Get the amount of milliseconds the `GraphComputer` has been executing thus far.
      Specified by:
        `getRuntime` in interface `Memory`
      Returns:
        the total time in milliseconds

    - #### keys

          public Set<String> keys()

      Description copied from interface: `Memory`
      The set of keys currently associated with this memory.
      Specified by:
        `keys` in interface `Memory`
      Returns:
        the memory's key set.

    - #### exists

          public boolean exists(String key)

      Description copied from interface: `Memory`
      Whether the key exists in the memory.
      Specified by:
        `exists` in interface `Memory`
      Parameters:
        `key` - key to search the memory for.
      Returns:
        whether the key exists

    - #### get

          public <R> R get(String key)
                    throws IllegalArgumentException

      Description copied from interface: `Memory`
      Get the value associated with the provided key.
      Specified by:
        `get` in interface `Memory`
      Type Parameters:
        `R` - the type of the value
      Parameters:
        `key` - the key of the value
      Returns:
        the value
      Throws:
        `IllegalArgumentException` - is thrown if the key does not exist

    - #### set

          public void set(String key,
                          Object value)

      Specified by:
        `set` in interface `Memory`

    - #### add

          public void add(String key,
                          Object value)

      Description copied from interface: `Memory`
      Set the value of the provided key. This is typically called in setup() and/or terminate() of the `VertexProgram`. If this is called during execute(), there is no guarantee as to the ultimately stored value as call order is indeterminate.
      Specified by:
        `add` in interface `Memory`
      Parameters:
        `key` - they key to set a value for
        `value` - the value to set for the key

    - #### write

          public void write(DataOutput output)

    - #### readFields

          public void readFields(DataInput input)

    - #### toString

          public String toString()

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