TouchReplicatedRegionEntriesFunction (Apache Geode 1.4.0)
Date: 2018-01-29

org.apache.geode.modules.util

## Class TouchReplicatedRegionEntriesFunction

- java.lang.Object
- - org.apache.geode.modules.util.TouchReplicatedRegionEntriesFunction

- All Implemented Interfaces:
    java.io.Serializable, Declarable, Function, DataSerializable, Identifiable

      public class TouchReplicatedRegionEntriesFunction
      extends java.lang.Object
      implements Function, Declarable, DataSerializable

  Touches the keys contained in the set of keys by performing a get on the replicated region. This is a non-data-aware function invoked using onMembers or onServers.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.geode.DataSerializable

      `DataSerializable.Replaceable`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TouchReplicatedRegionEntriesFunction()`
    `TouchReplicatedRegionEntriesFunction(Cache cache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(FunctionContext context)` The method which contains the logic to be executed.
    `void` | `fromData(java.io.DataInput in)` Reads the state of this object as primitive data from the given `DataInput`.
    `java.lang.String` | `getId()` Return a unique function identifier, used to register the function with `FunctionService`
    `boolean` | `hasResult()` Specifies whether the function sends results while executing.
    `void` | `init(java.util.Properties properties)` Initializes a user-defined object using the given properties.
    `boolean` | `isHA()` Specifies whether the function is eligible for re-execution (in case of failure).
    `boolean` | `optimizeForWrite()` Return true to indicate to GemFire the method requires optimization for writing the targeted `FunctionService.onRegion(org.apache.geode.cache.Region)` and any associated routing objects.
    `void` | `toData(java.io.DataOutput out)` Writes the state of this object as primitive data to the given `DataOutput`.

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

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

    - ### Methods inherited from interface org.apache.geode.cache.execute.Function

      `getRequiredPermissions`

- - ### Field Detail

    - #### ID

          public static final java.lang.String ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TouchReplicatedRegionEntriesFunction

          public TouchReplicatedRegionEntriesFunction()

    - #### TouchReplicatedRegionEntriesFunction

          public TouchReplicatedRegionEntriesFunction(Cache cache)

  - ### Method Detail

    - #### execute

          public void execute(FunctionContext context)

      Description copied from interface: `Function`
      The method which contains the logic to be executed. This method should be thread safe and may be invoked more than once on a given member for a single `Execution`. The context provided to this function is the one which was built using Execution. The contexts can be data dependent or data-independent so user should check to see if the context provided in parameter is instance of `RegionFunctionContext`.
      Specified by:
        `execute` in interface `Function`
      Parameters:
        `context` - as created by `Execution`

    - #### getId

          public java.lang.String getId()

      Description copied from interface: `Function`
      Return a unique function identifier, used to register the function with `FunctionService`
      Specified by:
        `getId` in interface `Function`
      Specified by:
        `getId` in interface `Identifiable`
      Returns:
        string identifying this function

    - #### optimizeForWrite

          public boolean optimizeForWrite()

      Description copied from interface: `Function`

      Return true to indicate to GemFire the method requires optimization for writing the targeted `FunctionService.onRegion(org.apache.geode.cache.Region)` and any associated routing objects.

      Returning false will optimize for read behavior on the targeted `FunctionService.onRegion(org.apache.geode.cache.Region)` and any associated routing objects.

      This method is only consulted when Region passed to FunctionService#onRegion(org.apache.geode.cache.Region) is a partitioned region

      Specified by:
        `optimizeForWrite` in interface `Function`
      Returns:
        false if the function is read only, otherwise returns true
      See Also:
        `FunctionService`

    - #### isHA

          public boolean isHA()

      Description copied from interface: `Function`
      Specifies whether the function is eligible for re-execution (in case of failure).
      Specified by:
        `isHA` in interface `Function`
      Returns:
        whether the function is eligible for re-execution.
      See Also:
        `FunctionContext.isPossibleDuplicate()`

    - #### hasResult

          public boolean hasResult()

      Description copied from interface: `Function`
      Specifies whether the function sends results while executing. The method returns false if no result is expected.

      If `Function.hasResult()` returns false, `ResultCollector.getResult()` throws `FunctionException`.

      If `Function.hasResult()` returns true, `ResultCollector.getResult()` blocks and waits for the result of function execution

      Specified by:
        `hasResult` in interface `Function`
      Returns:
        whether this function returns a Result back to the caller.

    - #### init

          public void init(java.util.Properties properties)

      Description copied from interface: `Declarable`
      Initializes a user-defined object using the given properties. Note that any uncaught exception thrown by this method will cause the `Cache` initialization to fail.
      Specified by:
        `init` in interface `Declarable`
      Parameters:
        `properties` - Contains the parameters declared in the declarative xml file.

    - #### toData

          public void toData(java.io.DataOutput out)
                      throws java.io.IOException

      Description copied from interface: `DataSerializable`
      Writes the state of this object as primitive data to the given `DataOutput`.

      Since 5.7 it is possible for any method call to the specified `DataOutput` to throw `GemFireRethrowable`. It should not be caught by user code. If it is it must be rethrown.

      Specified by:
        `toData` in interface `DataSerializable`
      Throws:
        `java.io.IOException` - A problem occurs while writing to `out`

    - #### fromData

          public void fromData(java.io.DataInput in)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException

      Description copied from interface: `DataSerializable`
      Reads the state of this object as primitive data from the given `DataInput`.
      Specified by:
        `fromData` in interface `DataSerializable`
      Throws:
        `java.io.IOException` - A problem occurs while reading from `in`
        `java.lang.ClassNotFoundException` - A class could not be loaded while reading from `in`