Care is taken to fit the payload into the MTU of ethernet, which is 1500 bytes. The algorithms in this class are capable of creating payloads for CacheManagers containing approximately 500 cache peers to be replicated.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| public static final int | MTU
The maximum transmission unit. |
| public static final String | URL_DELIMITER
Delmits URLS sent via heartbeats over sockets |
| pack-priv static final String | URL_DELIMITER_REGEXP
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static byte[] | Returns: an uncompressed payload with catenated rmiUrls.Assembles a list of URLs |
| private static List | Returns: A list of compressed urlList's, each compressed entry not exceeding maxSizePerPayloadThe list of CachePeers whose payload needs to be generated list, final int The maximum size each payload can have maxSizePerPayload)Generates a list of compressed urlList's for the input CachePeers list. |
| public static List | Returns: List of compressed entries containing the peers urlListList containing the peers localCachePeers, final int The maximum number of peers that can be present in one compressed entry maximumPeersPerSend)Creates a list of compressed (using gzip) url list. |
| public static byte[] | |
| public static byte[] |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| MTU | back to summary |
|---|---|
| public static final int MTU The maximum transmission unit. This varies by link layer. For ethernet, fast ethernet and gigabit ethernet it is 1500 bytes, the value chosen. Payloads are limited to this so that there is no fragmentation and no necessity for a complex reassembly protocol. | |
| URL_DELIMITER | back to summary |
|---|---|
| public static final String URL_DELIMITER Delmits URLS sent via heartbeats over sockets | |
| URL_DELIMITER_REGEXP | back to summary |
|---|---|
| pack-priv static final String URL_DELIMITER_REGEXP
| |
| PayloadUtil | back to summary |
|---|---|
| private PayloadUtil() Utility class therefore precent construction | |
| assembleUrlList | back to summary |
|---|---|
| public static byte[] assembleUrlList(List<E> localCachePeers) Assembles a list of URLs
| |
| createCompressedPayload | back to summary |
|---|---|
| private static List Generates a list of compressed urlList's for the input CachePeers list. Each compressed payload is limited by size by the maxSizePerPayload parameter and will break up into multiple payloads if necessary to limit the payload size | |
| createCompressedPayloadList | back to summary |
|---|---|
| public static List Creates a list of compressed (using gzip) url list. Breaks up the list of urlList such that size of each compressed entry in the list
does not exceed the | |
| gzip | back to summary |
|---|---|
| public static byte[] gzip(byte[] ungzipped) Gzips a byte[]. For text, approximately 10:1 compression is achieved.
| |
| ungzip | back to summary |
|---|---|
| public static byte[] ungzip(final byte[] gzipped) The fastest Ungzip implementation. See PageInfoTest in ehcache-constructs. A high performance implementation, although not as fast as gunzip3. gunzips 100000 of ungzipped content in 9ms on the reference machine. It does not use a fixed size buffer and is therefore suitable for arbitrary length arrays.
| |