Class S3_PING

  • All Implemented Interfaces:
    org.jgroups.Lifecycle
    Direct Known Subclasses:
    NATIVE_S3_PING

    public class S3_PING
    extends org.jgroups.protocols.FILE_PING
    This implementation uses the AWS SDK in order to be more solid and to benefit from the built-in security features like getting credentials via IAM instance profiles instead of handling this in the application.
    Author:
    Tobias Sarnowski, Bela Ban
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.jgroups.protocols.FILE_PING

        org.jgroups.protocols.FILE_PING.InfoWriter
      • Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery

        org.jgroups.protocols.Discovery.DiscoveryCacheDisseminationTask
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean acl_grant_bucket_owner_full_control  
      protected String bucket_name  
      protected static com.amazonaws.services.s3.model.AccessControlList BUCKET_OWNER_FULL_CONTROL_ACL  
      protected String bucket_prefix  
      protected boolean check_if_bucket_exists  
      protected String endpoint  
      protected static short JGROUPS_PROTOCOL_DEFAULT_MAGIC_NUMBER  
      protected static String MAGIC_NUMBER_SYSTEM_PROPERTY  
      protected boolean path_style_access_enabled  
      protected String region_name  
      protected com.amazonaws.services.s3.AmazonS3 s3  
      protected static int SERIALIZATION_BUFFER_SIZE  
      protected static String SERIALIZED_CONTENT_TYPE  
      • Fields inherited from class org.jgroups.protocols.FILE_PING

        filter, info_writer, info_writer_max_writes_after_view, info_writer_sleep_time, location, reads, regexp, register_shutdown_hook, remove_all_data_on_view_change, remove_old_coords_on_view_change, root_dir, SUFFIX, update_store_on_view_change, write_data_on_find, writes
      • Fields inherited from class org.jgroups.protocols.Discovery

        async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACE
      • Fields inherited from class org.jgroups.stack.Protocol

        after_creation_hook, down_prot, ergonomics, id, local_addr, log, stack, stats, up_prot
    • Constructor Summary

      Constructors 
      Constructor Description
      S3_PING()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void createRootDir()  
      protected String getClusterPrefix​(String clusterName)  
      void init()  
      protected void readAll​(List<org.jgroups.Address> members, String clustername, org.jgroups.util.Responses responses)  
      protected void remove​(String clustername, org.jgroups.Address addr)  
      protected void removeAll​(String clustername)  
      protected void write​(List<org.jgroups.protocols.PingData> list, String clustername)  
      • Methods inherited from class org.jgroups.protocols.FILE_PING

        addressToFilename, deleteFile, down, findMembers, getInfoWriterMaxWritesAfterView, getInfoWriterSleepTime, getLocation, handleView, isDynamic, isInfoWriterRunning, read, read, registerShutdownHook, registerShutdownHook, removeAllDataOnViewChange, removeAllDataOnViewChange, removeOldCoordsOnViewChange, removeOldCoordsOnViewChange, resetStats, setInfoWriterMaxWritesAfterView, setInfoWriterSleepTime, setLocation, startInfoWriter, stop, stopInfoWriter, updateStoreOnViewChange, updateStoreOnViewChange, write, writeAll, writeAll, writeDataOnFind, writeDataOnFind, writeInfo
      • Methods inherited from class org.jgroups.protocols.Discovery

        addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, providedUpServices, readPingData, returnEntireCache, returnEntireCache, sendCacheInformation, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses
      • Methods inherited from class org.jgroups.stack.Protocol

        accept, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled
    • Field Detail

      • JGROUPS_PROTOCOL_DEFAULT_MAGIC_NUMBER

        protected static final short JGROUPS_PROTOCOL_DEFAULT_MAGIC_NUMBER
        See Also:
        Constant Field Values
      • SERIALIZATION_BUFFER_SIZE

        protected static final int SERIALIZATION_BUFFER_SIZE
        See Also:
        Constant Field Values
      • BUCKET_OWNER_FULL_CONTROL_ACL

        protected static final com.amazonaws.services.s3.model.AccessControlList BUCKET_OWNER_FULL_CONTROL_ACL
      • path_style_access_enabled

        protected boolean path_style_access_enabled
      • endpoint

        protected String endpoint
      • region_name

        protected String region_name
      • bucket_name

        protected String bucket_name
      • bucket_prefix

        protected String bucket_prefix
      • check_if_bucket_exists

        protected boolean check_if_bucket_exists
      • acl_grant_bucket_owner_full_control

        protected boolean acl_grant_bucket_owner_full_control
      • s3

        protected com.amazonaws.services.s3.AmazonS3 s3
    • Constructor Detail

      • S3_PING

        public S3_PING()
    • Method Detail

      • init

        public void init()
                  throws Exception
        Specified by:
        init in interface org.jgroups.Lifecycle
        Overrides:
        init in class org.jgroups.protocols.FILE_PING
        Throws:
        Exception
      • createRootDir

        protected void createRootDir()
        Overrides:
        createRootDir in class org.jgroups.protocols.FILE_PING
      • getClusterPrefix

        protected String getClusterPrefix​(String clusterName)
      • readAll

        protected void readAll​(List<org.jgroups.Address> members,
                               String clustername,
                               org.jgroups.util.Responses responses)
        Overrides:
        readAll in class org.jgroups.protocols.FILE_PING
      • write

        protected void write​(List<org.jgroups.protocols.PingData> list,
                             String clustername)
        Overrides:
        write in class org.jgroups.protocols.FILE_PING
      • remove

        protected void remove​(String clustername,
                              org.jgroups.Address addr)
        Overrides:
        remove in class org.jgroups.protocols.FILE_PING
      • removeAll

        protected void removeAll​(String clustername)
        Overrides:
        removeAll in class org.jgroups.protocols.FILE_PING