Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,8 @@ public static List<Path> createFiles(final FileSystem fs,
final int fileCount,
final int dirCount) throws IOException {
return createDirsAndFiles(fs, destDir, depth, fileCount, dirCount,
new ArrayList<Path>(fileCount),
new ArrayList<Path>(dirCount));
new ArrayList<>(fileCount),
new ArrayList<>(dirCount));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@

package org.apache.hadoop.fs.contract.s3a;

import java.io.FileNotFoundException;
import java.io.IOException;

import static org.apache.hadoop.fs.s3a.Constants.*;
import static org.apache.hadoop.fs.s3a.S3ATestConstants.SCALE_TEST_TIMEOUT_MILLIS;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.maybeEnableS3Guard;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.StorageStatistics;
import org.apache.hadoop.fs.s3a.FailureInjectionPolicy;
import org.apache.hadoop.tools.contract.AbstractContractDistCpTest;

/**
Expand Down Expand Up @@ -60,41 +55,28 @@ protected Configuration createConfiguration() {
}

@Override
protected S3AContract createContract(Configuration conf) {
return new S3AContract(conf);
protected boolean shouldUseDirectWrite() {
return true;
}

/**
* Always inject the delay path in, so if the destination is inconsistent,
* and uses this key, inconsistency triggered.
* @param filepath path string in
* @return path on the remote FS for distcp
* @throws IOException IO failure
*/
@Override
protected Path path(final String filepath) throws IOException {
Path path = super.path(filepath);
return new Path(path, FailureInjectionPolicy.DEFAULT_DELAY_KEY_SUBSTRING);
protected S3AContract createContract(Configuration conf) {
return new S3AContract(conf);
}

@Override
public void testDirectWrite() throws Exception {
public void testDistCpWithIterator() throws Exception {
final long renames = getRenameOperationCount();
super.testDirectWrite();
assertEquals("Expected no renames for a direct write distcp", 0L,
getRenameOperationCount() - renames);
super.testDistCpWithIterator();
assertEquals("Expected no renames for a direct write distcp",
getRenameOperationCount(),
renames);
}

@Override
public void testNonDirectWrite() throws Exception {
final long renames = getRenameOperationCount();
try {
super.testNonDirectWrite();
} catch (FileNotFoundException e) {
// We may get this exception when data is written to a DELAY_LISTING_ME
// directory causing verification of the distcp success to fail if
// S3Guard is not enabled
}
super.testNonDirectWrite();
assertEquals("Expected 2 renames for a non-direct write distcp", 2L,
getRenameOperationCount() - renames);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@
package org.apache.hadoop.fs.azurebfs.contract;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.azure.integration.AzureTestConstants;
import org.apache.hadoop.fs.azurebfs.services.AuthType;
import org.apache.hadoop.tools.contract.AbstractContractDistCpTest;
import org.junit.Assume;

import static org.apache.hadoop.fs.azure.integration.AzureTestUtils.assumeScaleTestsEnabled;

/**
* Contract test for distCp operation.
*/
public class ITestAbfsFileSystemContractDistCp extends AbstractContractDistCpTest {
private final ABFSContractTestBinding binding;

@Override
protected int getTestTimeoutMillis() {
return AzureTestConstants.SCALE_TEST_TIMEOUT_MILLIS;
}

public ITestAbfsFileSystemContractDistCp() throws Exception {
binding = new ABFSContractTestBinding();
Assume.assumeTrue(binding.getAuthType() != AuthType.OAuth);
Expand All @@ -38,6 +46,7 @@ public ITestAbfsFileSystemContractDistCp() throws Exception {
public void setup() throws Exception {
binding.setup();
super.setup();
assumeScaleTestsEnabled(binding.getRawConfiguration());
}

@Override
Expand Down

This file was deleted.

Loading