Skip to content

Commit 7c71345

Browse files
committed
Code reformat
1 parent 152f9c2 commit 7c71345

File tree

9 files changed

+5
-54
lines changed

9 files changed

+5
-54
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsCountersImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.DIRECTORIES_CREATED;
5555
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.DIRECTORIES_DELETED;
5656
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.ERROR_IGNORED;
57-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_COPIED;
5857
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_CREATED;
5958
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_DELETED;
6059
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.GET_RESPONSES;
@@ -135,8 +134,7 @@ public class AbfsCountersImpl implements AbfsCounters {
135134
SERVER_UNAVAILABLE,
136135
RENAME_RECOVERY,
137136
METADATA_INCOMPLETE_RENAME_FAILURES,
138-
RENAME_PATH_ATTEMPTS,
139-
FILES_COPIED
137+
RENAME_PATH_ATTEMPTS
140138
};
141139

142140
private static final AbfsStatistic[] DURATION_TRACKER_LIST = {

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsStatistic.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ public enum AbfsStatistic {
109109
"Number of times rename operation failed due to metadata being "
110110
+ "incomplete"),
111111
RENAME_PATH_ATTEMPTS("rename_path_attempts",
112-
"Number of times we attempt to rename a path internally"),
113-
FILES_COPIED("files_copied",
114-
"Total number of files copied from the object store.");
112+
"Number of times we attempt to rename a path internally");
115113

116114
private String statName;
117115
private String statDescription;

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystem.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,8 @@ public Void call() throws Exception {
993993
delete(fs.getPath(), fs.isDirectory());
994994
if (fs.isDirectory()) {
995995
statIncrement(DIRECTORIES_DELETED);
996+
} else {
997+
statIncrement(FILES_DELETED);
996998
}
997999
return null;
9981000
}

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ public void createNonRecursivePreCheck(Path parentPath,
443443
}
444444
getPathStatus(parentPath.toUri().getPath(), false,
445445
tracingContext, null);
446-
incrementAbfsGetPathStatus();
447446
} catch (AbfsRestOperationException ex) {
448447
if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
449448
throw new FileNotFoundException("Cannot create file "
@@ -508,7 +507,6 @@ protected AbfsRestOperation createMarkerAtPath(final String path,
508507
final String eTag,
509508
final ContextEncryptionAdapter contextEncryptionAdapter,
510509
final TracingContext tracingContext) throws AzureBlobFileSystemException {
511-
incrementAbfsCreateFile();
512510
return createPathRestOp(path, false, false, false, eTag,
513511
contextEncryptionAdapter, tracingContext);
514512
}
@@ -1745,7 +1743,6 @@ public void takeGetPathStatusAtomicRenameKeyAction(final Path path,
17451743
pendingJsonFileStatus = getPathStatus(
17461744
pendingJsonPath.toUri().getPath(), tracingContext,
17471745
null, false);
1748-
incrementAbfsGetPathStatus();
17491746
if (checkIsDir(pendingJsonFileStatus.getResult())) {
17501747
return;
17511748
}

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@
9191
import org.apache.hadoop.util.concurrent.HadoopExecutors;
9292

9393
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
94-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.CALL_GET_FILE_STATUS;
95-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_COPIED;
96-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_CREATED;
97-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.FILES_DELETED;
9894
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.RENAME_PATH_ATTEMPTS;
9995
import static org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.extractEtagHeader;
10096
import static org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants.APN_VERSION;
@@ -702,34 +698,6 @@ protected void incrementAbfsRenamePath() {
702698
abfsCounters.incrementCounter(RENAME_PATH_ATTEMPTS, 1);
703699
}
704700

705-
/**
706-
* Increments AbfsCounters for get path status by 1.
707-
*/
708-
protected void incrementAbfsGetPathStatus() {
709-
abfsCounters.incrementCounter(CALL_GET_FILE_STATUS, 1);
710-
}
711-
712-
/**
713-
* Increments AbfsCounters for Delete File by 1.
714-
*/
715-
protected void incrementAbfsDeleteFile() {
716-
abfsCounters.incrementCounter(FILES_DELETED, 1);
717-
}
718-
719-
/**
720-
* Increments AbfsCounters for Create File by 1.
721-
*/
722-
protected void incrementAbfsCreateFile() {
723-
abfsCounters.incrementCounter(FILES_CREATED, 1);
724-
}
725-
726-
/**
727-
* Increments AbfsCounters for Copy Files by 1.
728-
*/
729-
protected void incrementAbfsCopyFile() {
730-
abfsCounters.incrementCounter(FILES_COPIED, 1);
731-
}
732-
733701
/**
734702
* Check if the rename request failure is post a retry and if earlier rename
735703
* request might have succeeded at back-end.

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsDfsClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
import org.apache.hadoop.util.StringUtils;
7171

7272
import static org.apache.commons.lang3.StringUtils.isEmpty;
73-
import static org.apache.hadoop.fs.azurebfs.AbfsStatistic.CALL_GET_FILE_STATUS;
7473
import static org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.extractEtagHeader;
7574
import static org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants.ACQUIRE_LEASE_ACTION;
7675
import static org.apache.hadoop.fs.azurebfs.constants.AbfsHttpConstants.APPEND_ACTION;
@@ -462,8 +461,6 @@ public void createNonRecursivePreCheck(Path parentPath,
462461
+ " because parent folder does not exist.");
463462
}
464463
throw ex;
465-
} finally {
466-
getAbfsCounters().incrementCounter(CALL_GET_FILE_STATUS, 1);
467464
}
468465
}
469466

@@ -1228,8 +1225,6 @@ public AbfsRestOperation deletePath(final String path,
12281225
} else {
12291226
return idempotencyOp;
12301227
}
1231-
} finally {
1232-
incrementAbfsDeleteFile();
12331228
}
12341229

12351230
return op;

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/BlobDeleteHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ int getMaxConsumptionParallelism() {
9090
private boolean deleteInternal(final Path path)
9191
throws AzureBlobFileSystemException {
9292
getAbfsClient().deleteBlobPath(path, null, tracingContext);
93-
getAbfsClient().incrementAbfsDeleteFile();
9493
deleteCount.incrementAndGet();
9594
return true;
9695
}

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/BlobRenameHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ int getMaxConsumptionParallelism() {
120120
* @throws AzureBlobFileSystemException if server call fails
121121
*/
122122
public boolean execute() throws AzureBlobFileSystemException {
123-
getAbfsClient().incrementAbfsRenamePath();
124123
PathInformation pathInformation = getPathInformation(src, tracingContext);
125124
boolean result = false;
126125
if (preCheck(src, dst, pathInformation)) {
@@ -167,6 +166,7 @@ public boolean execute() throws AzureBlobFileSystemException {
167166
result = renameInternal(src, dst);
168167
}
169168
} finally {
169+
getAbfsClient().incrementAbfsRenamePath();
170170
if (srcAbfsLease != null) {
171171
// If the operation is successful, cancel the timer and no need to release
172172
// the lease as rename on the blob-path has taken place.
@@ -417,9 +417,7 @@ private boolean renameInternal(final Path path,
417417
boolean operated = false;
418418
try {
419419
copyPath(path, destinationPathForBlobPartOfRenameSrcDir, leaseId);
420-
getAbfsClient().incrementAbfsCopyFile();
421420
getAbfsClient().deleteBlobPath(path, leaseId, tracingContext);
422-
getAbfsClient().incrementAbfsDeleteFile();
423421
operated = true;
424422
} finally {
425423
if (abfsLease != null) {

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/RenameAtomicity.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ public int preRename() throws AzureBlobFileSystemException {
267267
}
268268
}
269269
throw e;
270-
} finally {
271-
abfsClient.incrementAbfsCreateFile();
272270
}
273271
}
274272

@@ -312,8 +310,6 @@ private void deleteRenamePendingJson() throws AzureBlobFileSystemException {
312310
return;
313311
}
314312
throw e;
315-
} finally {
316-
abfsClient.incrementAbfsDeleteFile();
317313
}
318314
}
319315

0 commit comments

Comments
 (0)