Skip to content

Commit 115fb77

Browse files
committed
HADOOP-15183 address checkstyle and review comments
Change-Id: I1185b21cb14d9c2238a27dc00f5eac930959f1a4
1 parent 9be8d51 commit 115fb77

File tree

10 files changed

+24
-22
lines changed

10 files changed

+24
-22
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ private long innerRename(Path source, Path dest)
13681368
dstKey = maybeAddTrailingSlash(dstKey);
13691369
srcKey = maybeAddTrailingSlash(srcKey);
13701370

1371-
//Verify dest is not a child of the source directory
1371+
// Verify dest is not a child of the source directory
13721372
if (dstKey.startsWith(srcKey)) {
13731373
throw new RenameFailedException(srcKey, dstKey,
13741374
"cannot rename a directory to a subdirectory of itself ");
@@ -1520,7 +1520,7 @@ private void removeSourceObjects(
15201520
List<Path> undeletedObjects = new ArrayList<>();
15211521
try {
15221522
// remove the keys
1523-
// this does will update the metastore on a failure, but on
1523+
// this will update the metastore on a failure, but on
15241524
// a successful operation leaves the store as is.
15251525
removeKeys(keysToDelete, false, undeletedObjects);
15261526
// and clear the list.

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/MetadataStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void move(
200200
*/
201201
@RetryTranslated
202202
void put(PathMetadata meta,
203-
@Nullable BulkOperationState BulkOperationState) throws IOException;
203+
@Nullable BulkOperationState operationState) throws IOException;
204204

205205
/**
206206
* Saves metadata for any number of paths.
@@ -233,7 +233,7 @@ void put(Collection<PathMetadata> metas,
233233
* @throws IOException if there is an error
234234
*/
235235
void put(final DirListingMetadata meta,
236-
@Nullable final BulkOperationState operationState) throws IOException;
236+
@Nullable BulkOperationState operationState) throws IOException;
237237

238238
/**
239239
* Destroy all resources associated with the metadata store.

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3Guard.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ public static void addMoveAncestors(MetadataStore ms,
511511

512512
/**
513513
* This adds all new ancestors of a path as directories.
514-
* This forwards to {@link MetadataStore#addAncestors(Path, BulkOperationState)}.
514+
* This forwards to
515+
* {@link MetadataStore#addAncestors(Path, BulkOperationState)}.
515516
* <p>
516517
* Originally it implemented the logic to probe for an add ancestors,
517518
* but with the addition of a store-specific bulk operation state

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ private Path maybeGetCsvPath() {
116116
public void testMultiObjectDeleteNoPermissions() throws Throwable {
117117
describe("Delete the landsat CSV file and expect it to fail");
118118
Path csvPath = maybeGetCsvPath();
119-
S3AFileSystem fs = (S3AFileSystem)csvPath.getFileSystem(getConfiguration());
119+
S3AFileSystem fs = (S3AFileSystem) csvPath.getFileSystem(
120+
getConfiguration());
120121
List<DeleteObjectsRequest.KeyVersion> keys
121122
= buildDeleteRequest(
122123
new String[]{

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/commit/ITestCommitOperations.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ public void testBaseRelativePath() throws Throwable {
278278
String child = "subdir/child.txt";
279279
Path pendingChildPath = new Path(pendingBaseDir, child);
280280
Path expectedDestPath = new Path(destDir, child);
281-
assertPathDoesNotExist("dest file was found before upload", expectedDestPath);
281+
assertPathDoesNotExist("dest file was found before upload",
282+
expectedDestPath);
282283

283284
createFile(fs, pendingChildPath, true, DATASET);
284285
commit("child.txt", pendingChildPath, expectedDestPath, 0, 0);

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/commit/magic/ITestMagicCommitMRJob.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626

2727
import org.apache.hadoop.fs.FileStatus;
2828
import org.apache.hadoop.fs.Path;
29-
import org.apache.hadoop.fs.contract.ContractTestUtils;
3029
import org.apache.hadoop.fs.s3a.S3AFileSystem;
31-
import org.apache.hadoop.fs.s3a.S3AUtils;
3230
import org.apache.hadoop.fs.s3a.commit.AbstractITCommitMRJob;
3331
import org.apache.hadoop.fs.s3a.commit.files.SuccessData;
3432
import org.apache.hadoop.mapred.JobConf;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,8 @@ public void testPartialDirDelete() throws Throwable {
695695
.as("ReadOnly directory " + directoryList)
696696
.containsAll(readOnlyFiles);
697697

698-
// do this prune in the test as well as teardown, so that the test reporting includes
699-
// it in the runtime of a successful run.
698+
// do this prune in the test as well as teardown, so that the test
699+
// reporting includes it in the runtime of a successful run.
700700
prune(basePath);
701701
}
702702

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/ITestDynamoDBMetadataStore.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public static void deleteMetadataUnderPath(final DynamoDBMetadataStore ms,
303303
if (meta != null) {
304304
for (DescendantsIterator desc = new DescendantsIterator(ms,
305305
meta);
306-
desc.hasNext(); ) {
306+
desc.hasNext();) {
307307
forgotten++;
308308
ms.forgetMetadata(desc.next().getPath());
309309
}
@@ -1006,7 +1006,8 @@ protected void verifyStoreTags(final Map<String, String> tagMap,
10061006
protected List<Tag> listTagsOfStore(final DynamoDBMetadataStore store) {
10071007
ListTagsOfResourceRequest listTagsOfResourceRequest =
10081008
new ListTagsOfResourceRequest()
1009-
.withResourceArn(store.getTable().getDescription().getTableArn());
1009+
.withResourceArn(store.getTable().getDescription()
1010+
.getTableArn());
10101011
return store.getAmazonDynamoDB()
10111012
.listTagsOfResource(listTagsOfResourceRequest).getTags();
10121013
}

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/ITestDynamoDBMetadataStoreScale.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
* to overload the system and them have them back of until they finally complete.
6969
* <p>
7070
* With DDB on demand, throttling is very unlikely.
71-
* Here the tests simply run to completion, so act as regression tests on parallel
72-
* invocations on the metastore APIs
71+
* Here the tests simply run to completion, so act as regression tests of
72+
* parallel invocations on the metastore APIs
7373
*/
7474
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
7575
public class ITestDynamoDBMetadataStoreScale
@@ -176,7 +176,7 @@ public void teardown() throws Exception {
176176
}
177177

178178
private boolean expectThrottling() {
179-
return !isOverProvisionedForTest && !isOnDemandTable;
179+
return !isOverProvisionedForTest && !isOnDemandTable;
180180
}
181181

182182
/**
@@ -351,14 +351,14 @@ public void test_070_putDirMarker() throws Throwable {
351351
PathMetadata metadata = new PathMetadata(status);
352352
ddbms.put(metadata, null);
353353
DirListingMetadata children = ddbms.listChildren(path.getParent());
354-
try(DynamoDBMetadataStore.AncestorState state = ddbms.initiateBulkWrite(
355-
BulkOperationState.OperationType.Put,
356-
path)) {
354+
try (DynamoDBMetadataStore.AncestorState state =
355+
ddbms.initiateBulkWrite(
356+
BulkOperationState.OperationType.Put,
357+
path)) {
357358
execute("list",
358359
OPERATIONS_PER_THREAD,
359360
expectThrottling(),
360-
() -> ddbms.put(children, state)
361-
);
361+
() -> ddbms.put(children, state));
362362
} finally {
363363
retryingDelete(path);
364364
}

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/ThrottleTracker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ThrottleTracker {
4545

4646
private long batchThrottles;
4747

48-
public ThrottleTracker(final DynamoDBMetadataStore ddbms) {
48+
ThrottleTracker(final DynamoDBMetadataStore ddbms) {
4949
this.ddbms = ddbms;
5050
reset();
5151
}

0 commit comments

Comments
 (0)