org.apache.ignite.spi.discovery.tcp.ipfinder.s3

## Class TcpDiscoveryS3IpFinder

- java.lang.Object
- - org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter
  - - org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder

- All Implemented Interfaces:
    TcpDiscoveryIpFinder

      public class TcpDiscoveryS3IpFinder
      extends TcpDiscoveryIpFinderAdapter

  AWS S3-based IP finder.

  For information about Amazon S3 visit aws.amazon.com.

  # Configuration

  ## Mandatory

  - AWS credentials (see `setAwsCredentials(AWSCredentials)` and `setAwsCredentialsProvider(AWSCredentialsProvider)`
  - Bucket name (see `setBucketName(String)`)

  ## Optional

  - Client configuration (see `setClientConfiguration(ClientConfiguration)`)
  - Shared flag (see `setShared(boolean)`)
  - Bucket endpoint (see `setBucketEndpoint(String)`)
  - Server side encryption algorithm (see `setSSEAlgorithm(String)`)
  - Key prefix for the node addresses (see `setKeyPrefix(String)`)
  - Client side encryption service (see `setEncryptionService(EncryptionService)`)

  The finder will create S3 bucket with configured name. The bucket will contain entries named like the following: `192.168.1.136#1001`.

  Note that storing data in AWS S3 service will result in charges to your AWS account. Choose another implementation of `TcpDiscoveryIpFinder` for local or home network tests.

  Note that this finder is shared by default (see `TcpDiscoveryIpFinder.isShared()`.

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter

      `ignite`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TcpDiscoveryS3IpFinder()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<InetSocketAddress>` | `getRegisteredAddresses()` Gets all addresses registered in this finder.
    `void` | `registerAddresses(Collection<InetSocketAddress> addrs)` Registers new addresses.
    `TcpDiscoveryS3IpFinder` | `setAwsCredentials(com.amazonaws.auth.AWSCredentials cred)` Sets AWS credentials.
    `TcpDiscoveryS3IpFinder` | `setAwsCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider credProvider)` Sets AWS credentials provider.
    `TcpDiscoveryS3IpFinder` | `setBucketEndpoint(String bucketEndpoint)` Sets bucket endpoint for IP finder.
    `TcpDiscoveryS3IpFinder` | `setBucketName(String bucketName)` Sets bucket name for IP finder.
    `TcpDiscoveryS3IpFinder` | `setClientConfiguration(com.amazonaws.ClientConfiguration cfg)` Sets Amazon client configuration.
    `TcpDiscoveryS3IpFinder` | `setEncryptionService(EncryptionService encryptionSvc)` Sets encryption service for client side node address encryption.
    `TcpDiscoveryS3IpFinder` | `setKeyPrefix(String keyPrefix)` This can be thought of as the sub-folder within the bucket that will hold the node addresses.
    `TcpDiscoveryS3IpFinder` | `setShared(boolean shared)` Sets shared flag.
    `TcpDiscoveryS3IpFinder` | `setSSEAlgorithm(String sseAlg)` Sets server-side encryption algorithm for Amazon S3-managed encryption keys.
    `String` | `toString()`
    `void` | `unregisterAddresses(Collection<InetSocketAddress> addrs)` Unregisters provided addresses.

    - ### Methods inherited from class org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAdapter

      `close, discoveryClientMode, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, spiContext`

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

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

- - ### Constructor Detail

    - #### TcpDiscoveryS3IpFinder

          public TcpDiscoveryS3IpFinder()

      Constructor.

  - ### Method Detail

    - #### getRegisteredAddresses

          public Collection<InetSocketAddress> getRegisteredAddresses()
                                                               throws IgniteSpiException

      Gets all addresses registered in this finder.
      Returns:
        All known addresses, potentially empty, but never `null`.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### registerAddresses

          public void registerAddresses(Collection<InetSocketAddress> addrs)
                                 throws IgniteSpiException

      Registers new addresses.

      Implementation should accept duplicates quietly, but should not register address if it is already registered.

      Parameters:
        `addrs` - Addresses to register. Not `null` and not empty.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### unregisterAddresses

          public void unregisterAddresses(Collection<InetSocketAddress> addrs)
                                   throws IgniteSpiException

      Unregisters provided addresses.

      Implementation should accept addresses that are currently not registered quietly (just no-op).

      Parameters:
        `addrs` - Addresses to unregister. Not `null` and not empty.
      Throws:
        `IgniteSpiException` - In case of error.

    - #### setBucketName

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryS3IpFinder setBucketName(String bucketName)

      Sets bucket name for IP finder.
      Parameters:
        `bucketName` - Bucket name.
      Returns:
        `this` for chaining.

    - #### setBucketEndpoint

          @IgniteSpiConfiguration(optional=true)
          public TcpDiscoveryS3IpFinder setBucketEndpoint(String bucketEndpoint)

      Sets bucket endpoint for IP finder. If the endpoint is not set then IP finder will go to each region to find a corresponding bucket. For information about possible endpoint names visit docs.aws.amazon.com.
      Parameters:
        `bucketEndpoint` - Bucket endpoint, for example, s3.us-east-2.amazonaws.com.
      Returns:
        `this` for chaining.

    - #### setSSEAlgorithm

          @IgniteSpiConfiguration(optional=true)
          public TcpDiscoveryS3IpFinder setSSEAlgorithm(String sseAlg)

      Sets server-side encryption algorithm for Amazon S3-managed encryption keys. For information about possible S3-managed encryption keys visit docs.aws.amazon.com.
      Parameters:
        `sseAlg` - Server-side encryption algorithm, for example, AES256 or SSES3.
      Returns:
        `this` for chaining.

    - #### setClientConfiguration

          @IgniteSpiConfiguration(optional=true)
          public TcpDiscoveryS3IpFinder setClientConfiguration(com.amazonaws.ClientConfiguration cfg)

      Sets Amazon client configuration.

      For details refer to Amazon S3 API reference.

      Parameters:
        `cfg` - Amazon client configuration.
      Returns:
        `this` for chaining.

    - #### setEncryptionService

          @IgniteSpiConfiguration(optional=true)
          public TcpDiscoveryS3IpFinder setEncryptionService(EncryptionService encryptionSvc)

      Sets encryption service for client side node address encryption.
      Parameters:
        `encryptionSvc` - Encryption service .
      Returns:
        `this` for chaining.

    - #### setAwsCredentials

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryS3IpFinder setAwsCredentials(com.amazonaws.auth.AWSCredentials cred)

      Sets AWS credentials. Either use `setAwsCredentialsProvider(AWSCredentialsProvider)` or this one.

      For details refer to Amazon S3 API reference.

      Parameters:
        `cred` - AWS credentials.
      Returns:
        `this` for chaining.

    - #### setAwsCredentialsProvider

          @IgniteSpiConfiguration(optional=false)
          public TcpDiscoveryS3IpFinder setAwsCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider credProvider)

      Sets AWS credentials provider. Either use `setAwsCredentials(AWSCredentials)` or this one.

      For details refer to Amazon S3 API reference.

      Parameters:
        `credProvider` - AWS credentials provider.
      Returns:
        `this` for chaining.

    - #### setKeyPrefix

          @IgniteSpiConfiguration(optional=true)
          public TcpDiscoveryS3IpFinder setKeyPrefix(String keyPrefix)

      This can be thought of as the sub-folder within the bucket that will hold the node addresses.

      For details visit

      Parameters:
        `keyPrefix` - AWS credentials provider.
      Returns:
        `this` for chaining.

    - #### setShared

          public TcpDiscoveryS3IpFinder setShared(boolean shared)

      Sets shared flag. If `true` then it is expected that IP addresses registered with IP finder will be seen by IP finders on all other nodes.
      Overrides:
        `setShared` in class `TcpDiscoveryIpFinderAdapter`
      Parameters:
        `shared` - `true` if this IP finder is shared.
      Returns:
        `this` for chaining.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `TcpDiscoveryIpFinderAdapter`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020