Skip to content

Commit 6416c20

Browse files
committed
HADOOP-19654. yetus feedback on checksum changes
1 parent 8e67003 commit 6416c20

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/ChecksumSupport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public static ChecksumAlgorithm getChecksumAlgorithm(Configuration conf) {
8888
case CRC64NVME:
8989
return ChecksumAlgorithm.CRC64_NVME;
9090
default:
91-
throw new IllegalArgumentException("Checksum algorithm is not supported: " + configValue);
91+
throw new IllegalArgumentException("Checksum algorithm is not supported: "
92+
+ configValue);
9293
}
9394
});
9495
}

hadoop-tools/hadoop-aws/src/site/markdown/tools/hadoop-aws/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ To understand the risks and issues here know that:
17691769
* The most efficient data upload checksum is CRC32C; there are explicit opcodes for this in x86 and ARM CPUs, with the appropriate implementation circuitry.
17701770
* Data download validation checksums are also computationally expensive.
17711771

1772-
| Option | Purpose | Values | Default |
1772+
| Option | Purpose | Values | Default |
17731773
|------------------------------------|------------------------------------------------|---------|----------|
17741774
| `fs.s3a.request.md5.header` | Enable MD5 header | boolean | `true` |
17751775
| `fs.s3a.checksum.generation` | Generate checksums on all requests | boolean | `false` |
@@ -1791,7 +1791,7 @@ This could potentially deal with memory/buffering/bus issues on the servers.
17911791
However this is what ECC RAM is for.
17921792
If you do suspect requests being corrupted during writing or reading, the options may
17931793
be worth considering.
1794-
As it is, they are off by default to avoid compatibility problems.
1794+
As it is, they are off by default to avoid compatibility problems.
17951795

17961796
Note: if you have a real example of where these checksum options have identified memory corruption,
17971797
please let us know.
@@ -1819,19 +1819,19 @@ Set `fs.s3a.checksum.generation` to `false` by default to avoid these problems.
18191819

18201820
Should the checksums of downloaded data be validated?
18211821

1822-
This hurts performance and should be only used if considered important.
1822+
This hurts performance and should be only used if considered important.
18231823

18241824
### Creation checksum `fs.s3a.create.checksum.algorithm`
18251825

18261826

18271827
This is the algorithm to use when checksumming data during file creation and copy.
18281828

1829-
Options: `NONE`, `CRC32`, `CRC32C`, `CRC32_C`, `CRC64NVME` , `CRC64_NVME`, `SHA256`, `SHA1`
1829+
Options: `NONE`, `CRC32`, `CRC32C`, `CRC32_C`, `CRC64NVME` , `CRC64_NVME`, `SHA256`, `SHA1`
18301830

18311831
The option `NONE` is new to Hadoop 3.4.3; previously an empty string was required for the same behavior.
18321832

1833-
The `CRC64NVME`/`CRC64_NVME` option is also new to Hadoop 3.4.3 and requires the `aws-crt` module to be on the classpath, otherwise an error is printed:
1834-
1833+
The `CRC64NVME`/`CRC64_NVME` option is also new to Hadoop 3.4.3 and requires the `aws-crt` module to be on the classpath, otherwise an error is printed:
1834+
18351835
```
18361836
java.lang.RuntimeException: Could not load software.amazon.awssdk.crt.checksums.CRC64NVME.
18371837
Add dependency on 'software.amazon.awssdk.crt:aws-crt' module to enable CRC64NVME feature.

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/TestChecksumSupport.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
public class TestChecksumSupport {
3232

3333
@ParameterizedTest
34-
@EnumSource(value = ChecksumAlgorithm.class, names = {"CRC32", "CRC32_C", "SHA1", "SHA256", "CRC64_NVME"})
34+
@EnumSource(value = ChecksumAlgorithm.class,
35+
names = {"CRC32", "CRC32_C", "SHA1", "SHA256", "CRC64_NVME"})
3536
public void testGetSupportedChecksumAlgorithm(ChecksumAlgorithm checksumAlgorithm) {
3637
assertChecksumAlgorithm(checksumAlgorithm, checksumAlgorithm.toString());
3738
}
@@ -52,14 +53,14 @@ private static void assertChecksumAlgorithm(final ChecksumAlgorithm checksumAlgo
5253

5354
@Test
5455
public void testCRC32C() throws Throwable {
55-
assertChecksumAlgorithm(ChecksumAlgorithm.CRC32_C, "CRC32C" );
56-
assertChecksumAlgorithm(ChecksumAlgorithm.CRC32_C, "CRC32_C" );
56+
assertChecksumAlgorithm(ChecksumAlgorithm.CRC32_C, "CRC32C");
57+
assertChecksumAlgorithm(ChecksumAlgorithm.CRC32_C, "CRC32_C");
5758
}
5859

5960
@Test
6061
public void testCRC64NVME() throws Throwable {
61-
assertChecksumAlgorithm(ChecksumAlgorithm.CRC64_NVME, "CRC64_NVME" );
62-
assertChecksumAlgorithm(ChecksumAlgorithm.CRC64_NVME, "CRC64NVME" );
62+
assertChecksumAlgorithm(ChecksumAlgorithm.CRC64_NVME, "CRC64_NVME");
63+
assertChecksumAlgorithm(ChecksumAlgorithm.CRC64_NVME, "CRC64NVME");
6364
}
6465

6566
@Test

0 commit comments

Comments
 (0)