org.apache.geode.modules.util

## Class BootstrappingFunction

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

- All Implemented Interfaces:
    java.io.Serializable, Function, org.apache.geode.distributed.internal.MembershipListener, Identifiable

      public class BootstrappingFunction
      extends java.lang.Object
      implements Function, org.apache.geode.distributed.internal.MembershipListener

  See Also:
    Serialized Form

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BootstrappingFunction()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `void` | `execute(FunctionContext context)` The method which contains the logic to be executed.
    `java.lang.String` | `getId()` Return a unique function identifier, used to register the function with `FunctionService`
    `int` | `hashCode()`
    `boolean` | `hasResult()` Specifies whether the function sends results while executing.
    `boolean` | `isHA()` Specifies whether the function is eligible for re-execution (in case of failure).
    `void` | `memberDeparted(org.apache.geode.distributed.internal.membership.InternalDistributedMember id, boolean crashed)`
    `void` | `memberJoined(org.apache.geode.distributed.internal.membership.InternalDistributedMember id)`
    `void` | `memberSuspect(org.apache.geode.distributed.internal.membership.InternalDistributedMember id, org.apache.geode.distributed.internal.membership.InternalDistributedMember whoSuspected, java.lang.String reason)`
    `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` | `quorumLost(java.util.Set<org.apache.geode.distributed.internal.membership.InternalDistributedMember> internalDistributedMembers, java.util.List<org.apache.geode.distributed.internal.membership.InternalDistributedMember> internalDistributedMembers2)`

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

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

- - ### Field Detail

    - #### ID

          public static final java.lang.String ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### BootstrappingFunction

          public BootstrappingFunction()

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

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

    - #### 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()`

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

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### memberDeparted

          public void memberDeparted(org.apache.geode.distributed.internal.membership.InternalDistributedMember id,
                                     boolean crashed)

      Specified by:
        `memberDeparted` in interface `org.apache.geode.distributed.internal.MembershipListener`

    - #### memberJoined

          public void memberJoined(org.apache.geode.distributed.internal.membership.InternalDistributedMember id)

      Specified by:
        `memberJoined` in interface `org.apache.geode.distributed.internal.MembershipListener`

    - #### memberSuspect

          public void memberSuspect(org.apache.geode.distributed.internal.membership.InternalDistributedMember id,
                                    org.apache.geode.distributed.internal.membership.InternalDistributedMember whoSuspected,
                                    java.lang.String reason)

      Specified by:
        `memberSuspect` in interface `org.apache.geode.distributed.internal.MembershipListener`

    - #### quorumLost

          public void quorumLost(java.util.Set<org.apache.geode.distributed.internal.membership.InternalDistributedMember> internalDistributedMembers,
                                 java.util.List<org.apache.geode.distributed.internal.membership.InternalDistributedMember> internalDistributedMembers2)

      Specified by:
        `quorumLost` in interface `org.apache.geode.distributed.internal.MembershipListener`