Skip to content

Commit 5b6de5c

Browse files
committed
fixing checkstyle issues
1 parent ebe5d13 commit 5b6de5c

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/BufferedFSInputStream.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.IOException;
2424
import java.nio.ByteBuffer;
2525
import java.util.List;
26-
import java.util.concurrent.CompletableFuture;
2726
import java.util.function.IntFunction;
2827

2928
import org.apache.hadoop.classification.InterfaceAudience;

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ private static class ChecksumFSOutputSummer extends FSOutputSummer {
525525
private static final float CHKSUM_AS_FRACTION = 0.01f;
526526
private boolean isClosed = false;
527527

528-
public ChecksumFSOutputSummer(ChecksumFileSystem fs,
528+
ChecksumFSOutputSummer(ChecksumFileSystem fs,
529529
Path file,
530530
boolean overwrite,
531531
int bufferSize,

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileRange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
public interface FileRange {
2929
/**
30-
* Get the starting offset of the range
30+
* Get the starting offset of the range.
3131
* @return the byte offset of the start
3232
*/
3333
long getOffset();

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/AsyncReaderUtils.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ public static void readAsync(PositionedReadable stream,
7373
* @param allocate the function to allocate ByteBuffers
7474
* @return the CompletableFuture that contains the read data
7575
*/
76-
public static CompletableFuture<ByteBuffer> readRangeFrom(PositionedReadable stream,
77-
FileRange range,
78-
IntFunction<ByteBuffer> allocate) {
76+
public static
77+
CompletableFuture<ByteBuffer> readRangeFrom(PositionedReadable stream,
78+
FileRange range,
79+
IntFunction<ByteBuffer> allocate){
7980
CompletableFuture<ByteBuffer> result = new CompletableFuture<>();
8081
try {
8182
ByteBuffer buffer = allocate.apply(range.getLength());
@@ -104,7 +105,8 @@ public static CompletableFuture<ByteBuffer> readRangeFrom(PositionedReadable str
104105
}
105106

106107
/**
107-
* Is the given input list:
108+
* Is the given input list already in the desired order?
109+
* In particular, does it meet these requirements:
108110
* <ul>
109111
* <li>already sorted by offset</li>
110112
* <li>each range is more than minimumSeek apart</li>
@@ -158,7 +160,8 @@ public static long roundUp(long offset, int chunkSize) {
158160
* <li>Upper layers want to pass down logical file ranges.</li>
159161
* <li>Fewer reads have better performance.</li>
160162
* <li>Applications want callbacks as ranges are read.</li>
161-
* <li>Some file systems want to round ranges to be at checksum boundaries.</li>
163+
* <li>Some file systems want to round ranges to be at checksum boundaries.
164+
* </li>
162165
* </ul>
163166
*
164167
* @param input the list of input ranges
@@ -167,10 +170,11 @@ public static long roundUp(long offset, int chunkSize) {
167170
* @param maxSize the largest combined file range in bytes
168171
* @return the list of sorted CombinedFileRanges that cover the input
169172
*/
170-
public static List<CombinedFileRange> sortAndMergeRanges(List<? extends FileRange> input,
171-
int chunkSize,
172-
int minimumSeek,
173-
int maxSize) {
173+
public static
174+
List<CombinedFileRange> sortAndMergeRanges(List<? extends FileRange> input,
175+
int chunkSize,
176+
int minimumSeek,
177+
int maxSize) {
174178
// sort the ranges by offset
175179
FileRange[] ranges = input.toArray(new FileRange[0]);
176180
Arrays.sort(ranges, Comparator.comparingLong(FileRange::getOffset));
@@ -180,8 +184,10 @@ public static List<CombinedFileRange> sortAndMergeRanges(List<? extends FileRang
180184
// now merge together the ones that merge
181185
for(FileRange range: ranges) {
182186
long start = roundDown(range.getOffset(), chunkSize);
183-
long end = roundUp(range.getOffset() + range.getLength(), chunkSize);
184-
if (current == null || !current.merge(start, end, range, minimumSeek, maxSize)) {
187+
long end = roundUp(range.getOffset() + range.getLength(),
188+
chunkSize);
189+
if (current == null ||
190+
!current.merge(start, end, range, minimumSeek, maxSize)) {
185191
current = new CombinedFileRange(start, end, range);
186192
result.add(current);
187193
}

0 commit comments

Comments
 (0)