Skip to content

Commit 8259a2e

Browse files
committed
undo extra formatting
1 parent 3039f7f commit 8259a2e

File tree

3 files changed

+45
-44
lines changed

3 files changed

+45
-44
lines changed

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

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,17 @@ public void initialize(URI uri, Configuration configuration)
143143
configuration, abfsCounters);
144144
LOG.trace("AzureBlobFileSystemStore init complete");
145145

146-
final AbfsConfiguration abfsConfiguration = abfsStore.getAbfsConfiguration();
146+
final AbfsConfiguration abfsConfiguration = abfsStore
147+
.getAbfsConfiguration();
147148
clientCorrelationId = TracingContext.validateClientCorrelationID(
148149
abfsConfiguration.getClientCorrelationId());
149150
tracingHeaderFormat = abfsConfiguration.getTracingHeaderFormat();
150151
this.setWorkingDirectory(this.getHomeDirectory());
151152

152153
if (abfsConfiguration.getCreateRemoteFileSystemDuringInitialization()) {
153154
TracingContext tracingContext = new TracingContext(clientCorrelationId,
154-
fileSystemId, FSOperationType.CREATE_FILESYSTEM, tracingHeaderFormat,
155-
listener);
156-
if (this.tryGetFileStatus(new Path(AbfsHttpConstants.ROOT_PATH),
157-
tracingContext) == null) {
155+
fileSystemId, FSOperationType.CREATE_FILESYSTEM, tracingHeaderFormat, listener);
156+
if (this.tryGetFileStatus(new Path(AbfsHttpConstants.ROOT_PATH), tracingContext) == null) {
158157
try {
159158
this.createFileSystem(tracingContext);
160159
} catch (AzureBlobFileSystemException ex) {
@@ -182,7 +181,8 @@ public void initialize(URI uri, Configuration configuration)
182181

183182
@Override
184183
public String toString() {
185-
final StringBuilder sb = new StringBuilder("AzureBlobFileSystem{");
184+
final StringBuilder sb = new StringBuilder(
185+
"AzureBlobFileSystem{");
186186
sb.append("uri=").append(uri);
187187
sb.append(", user='").append(abfsStore.getUser()).append('\'');
188188
sb.append(", primaryUserGroup='").append(abfsStore.getPrimaryGroup()).append('\'');
@@ -205,8 +205,7 @@ public void registerListener(Listener listener1) {
205205

206206
@Override
207207
public FSDataInputStream open(final Path path, final int bufferSize) throws IOException {
208-
LOG.debug("AzureBlobFileSystem.open path: {} bufferSize: {}", path,
209-
bufferSize);
208+
LOG.debug("AzureBlobFileSystem.open path: {} bufferSize: {}", path, bufferSize);
210209
// bufferSize is unused.
211210
return open(path, Optional.empty());
212211
}
@@ -219,10 +218,10 @@ private FSDataInputStream open(final Path path,
219218
try {
220219
TracingContext tracingContext = new TracingContext(clientCorrelationId,
221220
fileSystemId, FSOperationType.OPEN, tracingHeaderFormat, listener);
222-
InputStream inputStream = abfsStore.openFileForRead(qualifiedPath,
223-
parameters, statistics, tracingContext);
221+
InputStream inputStream = abfsStore
222+
.openFileForRead(qualifiedPath, parameters, statistics, tracingContext);
224223
return new FSDataInputStream(inputStream);
225-
} catch (AzureBlobFileSystemException ex) {
224+
} catch(AzureBlobFileSystemException ex) {
226225
checkException(path, ex);
227226
return null;
228227
}
@@ -233,18 +232,21 @@ private FSDataInputStream open(final Path path,
233232
* {@link org.apache.hadoop.fs.impl.OpenFileParameters}. Ensure that
234233
* FileStatus entered is up-to-date, as it will be used to create the
235234
* InputStream (with info such as contentLength, eTag)
236-
*
237235
* @param path The location of file to be opened
238236
* @param parameters OpenFileParameters instance; can hold FileStatus,
239237
* Configuration, bufferSize and mandatoryKeys
240238
*/
241239
@Override
242240
protected CompletableFuture<FSDataInputStream> openFileWithOptions(
243-
final Path path, final OpenFileParameters parameters) throws IOException {
241+
final Path path, final OpenFileParameters parameters) {
244242
LOG.debug("AzureBlobFileSystem.openFileWithOptions path: {}", path);
245243
AbstractFSBuilderImpl.rejectUnknownMandatoryKeys(
246-
parameters.getMandatoryKeys(), Collections.emptySet(), "for " + path);
247-
return LambdaUtils.eval(new CompletableFuture<>(), () -> open(path, Optional.of(parameters)));
244+
parameters.getMandatoryKeys(),
245+
Collections.emptySet(),
246+
"for " + path);
247+
return LambdaUtils.eval(
248+
new CompletableFuture<>(), () ->
249+
open(path, Optional.of(parameters)));
248250
}
249251

250252
@Override
@@ -253,7 +255,10 @@ public FSDataOutputStream create(final Path f, final FsPermission permission,
253255
final long blockSize, final Progressable progress) throws IOException {
254256
LOG.debug(
255257
"AzureBlobFileSystem.create path: {} permission: {} overwrite: {} bufferSize: {}",
256-
f, permission, overwrite, blockSize);
258+
f,
259+
permission,
260+
overwrite,
261+
blockSize);
257262

258263
statIncrement(CALL_CREATE);
259264
trailingPeriodCheck(f);
@@ -262,8 +267,7 @@ public FSDataOutputStream create(final Path f, final FsPermission permission,
262267

263268
try {
264269
TracingContext tracingContext = new TracingContext(clientCorrelationId,
265-
fileSystemId, FSOperationType.CREATE, overwrite, tracingHeaderFormat,
266-
listener);
270+
fileSystemId, FSOperationType.CREATE, overwrite, tracingHeaderFormat, listener);
267271
OutputStream outputStream = abfsStore.createFile(qualifiedPath, statistics, overwrite,
268272
permission == null ? FsPermission.getFileDefault() : permission,
269273
FsPermission.getUMask(getConf()), tracingContext);
@@ -289,11 +293,11 @@ public FSDataOutputStream createNonRecursive(final Path f, final FsPermission pe
289293
final FileStatus parentFileStatus = tryGetFileStatus(parent, tracingContext);
290294

291295
if (parentFileStatus == null) {
292-
throw new FileNotFoundException("Cannot create file " + f.getName() + " because parent folder does not exist.");
296+
throw new FileNotFoundException("Cannot create file "
297+
+ f.getName() + " because parent folder does not exist.");
293298
}
294299

295-
return create(f, permission, overwrite, bufferSize, replication, blockSize,
296-
progress);
300+
return create(f, permission, overwrite, bufferSize, replication, blockSize, progress);
297301
}
298302

299303
@Override
@@ -304,38 +308,40 @@ public FSDataOutputStream createNonRecursive(final Path f, final FsPermission pe
304308

305309
// Check if file should be appended or overwritten. Assume that the file
306310
// is overwritten on if the CREATE and OVERWRITE create flags are set.
307-
final EnumSet<CreateFlag> createflags = EnumSet.of(CreateFlag.CREATE,
308-
CreateFlag.OVERWRITE);
311+
final EnumSet<CreateFlag> createflags =
312+
EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE);
309313
final boolean overwrite = flags.containsAll(createflags);
310314

311315
// Delegate the create non-recursive call.
312-
return this.createNonRecursive(f, permission, overwrite, bufferSize,
313-
replication, blockSize, progress);
316+
return this.createNonRecursive(f, permission, overwrite,
317+
bufferSize, replication, blockSize, progress);
314318
}
315319

316320
@Override
317321
@SuppressWarnings("deprecation")
318322
public FSDataOutputStream createNonRecursive(final Path f,
319-
final boolean overwrite, final int bufferSize, final short replication,
320-
final long blockSize, final Progressable progress) throws IOException {
321-
return this.createNonRecursive(f, FsPermission.getFileDefault(), overwrite,
322-
bufferSize, replication, blockSize, progress);
323+
final boolean overwrite, final int bufferSize, final short replication, final long blockSize,
324+
final Progressable progress) throws IOException {
325+
return this.createNonRecursive(f, FsPermission.getFileDefault(),
326+
overwrite, bufferSize, replication, blockSize, progress);
323327
}
324328

325329
@Override
326330
public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException {
327331
LOG.debug("AzureBlobFileSystem.append path: {} bufferSize: {}",
328-
f.toString(), bufferSize);
332+
f.toString(),
333+
bufferSize);
329334
statIncrement(CALL_APPEND);
330335
Path qualifiedPath = makeQualified(f);
331336

332337
try {
333338
TracingContext tracingContext = new TracingContext(clientCorrelationId,
334-
fileSystemId, FSOperationType.APPEND, tracingHeaderFormat, listener);
335-
OutputStream outputStream = abfsStore.openFileForWrite(qualifiedPath,
336-
statistics, false, tracingContext);
339+
fileSystemId, FSOperationType.APPEND, tracingHeaderFormat,
340+
listener);
341+
OutputStream outputStream = abfsStore
342+
.openFileForWrite(qualifiedPath, statistics, false, tracingContext);
337343
return new FSDataOutputStream(outputStream, statistics);
338-
} catch (AzureBlobFileSystemException ex) {
344+
} catch(AzureBlobFileSystemException ex) {
339345
checkException(f, ex);
340346
return null;
341347
}
@@ -395,7 +401,7 @@ public boolean rename(final Path src, final Path dst) throws IOException {
395401

396402
abfsStore.rename(qualifiedSrcPath, qualifiedDstPath, tracingContext);
397403
return true;
398-
} catch (AzureBlobFileSystemException ex) {
404+
} catch(AzureBlobFileSystemException ex) {
399405
LOG.debug("Rename operation failed. ", ex);
400406
checkException(src, ex, AzureServiceErrorCode.PATH_ALREADY_EXISTS,
401407
AzureServiceErrorCode.INVALID_RENAME_SOURCE_PATH,
@@ -409,8 +415,8 @@ public boolean rename(final Path src, final Path dst) throws IOException {
409415

410416
@Override
411417
public boolean delete(final Path f, final boolean recursive) throws IOException {
412-
LOG.debug("AzureBlobFileSystem.delete path: {} recursive: {}", f.toString(),
413-
recursive);
418+
LOG.debug(
419+
"AzureBlobFileSystem.delete path: {} recursive: {}", f.toString(), recursive);
414420
statIncrement(CALL_DELETE);
415421
Path qualifiedPath = makeQualified(f);
416422

@@ -424,7 +430,8 @@ public boolean delete(final Path f, final boolean recursive) throws IOException
424430

425431
try {
426432
TracingContext tracingContext = new TracingContext(clientCorrelationId,
427-
fileSystemId, FSOperationType.DELETE, tracingHeaderFormat, listener);
433+
fileSystemId, FSOperationType.DELETE, tracingHeaderFormat,
434+
listener);
428435
abfsStore.delete(qualifiedPath, recursive, tracingContext);
429436
return true;
430437
} catch (AzureBlobFileSystemException ex) {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
import java.util.WeakHashMap;
5353
import java.util.concurrent.ExecutionException;
5454
import java.util.concurrent.ExecutorService;
55-
import java.util.concurrent.Executors;
56-
import java.util.concurrent.LinkedBlockingQueue;
57-
import java.util.concurrent.RejectedExecutionHandler;
5855
import java.util.concurrent.SynchronousQueue;
5956
import java.util.concurrent.ThreadPoolExecutor;
6057
import java.util.concurrent.TimeUnit;

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestGetContentSummary.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ public void testConcurrentGetContentSummaryCalls()
178178

179179
private void verifyContentSummary(ContentSummary contentSummary,
180180
long expectedDirectoryCount, long expectedFileCount, long expectedByteCount) {
181-
System.out.println(contentSummary);
182-
System.out.println(expectedDirectoryCount + " : " + expectedFileCount +
183-
" : " + expectedByteCount);
184181
Assertions.assertThat(contentSummary.getDirectoryCount())
185182
.describedAs("Incorrect directory count").isEqualTo(expectedDirectoryCount);
186183
Assertions.assertThat(contentSummary.getFileCount())

0 commit comments

Comments
 (0)