public class TestFSUtils extends Object
FSUtils
.Modifier and Type | Class and Description |
---|---|
(package private) class |
TestFSUtils.AlwaysFailSetStoragePolicyFileSystem |
(package private) static interface |
TestFSUtils.HDFSBlockDistributionFunction |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
blockSize |
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
conf |
private org.apache.hadoop.fs.FileSystem |
fs |
private HBaseTestingUtility |
htu |
(package private) String |
INVALID_STORAGE_POLICY |
private static org.slf4j.Logger |
LOG |
private Random |
rand |
(package private) static long |
seed |
Constructor and Description |
---|
TestFSUtils() |
Modifier and Type | Method and Description |
---|---|
private void |
checkAndEraseData(byte[] actual,
int from,
byte[] expected,
String message) |
void |
checkStreamCapabilitiesOnHdfsDataOutputStream() |
private void |
cleanupFile(org.apache.hadoop.fs.FileSystem fileSys,
org.apache.hadoop.fs.Path name) |
private void |
doPread(org.apache.hadoop.fs.FSDataInputStream stm,
long position,
byte[] buffer,
int offset,
int length) |
private void |
pReadFile(org.apache.hadoop.fs.FileSystem fileSys,
org.apache.hadoop.fs.Path name) |
void |
setUp() |
void |
testComputeHDFSBlockDistribution() |
private void |
testComputeHDFSBlocksDistribution(TestFSUtils.HDFSBlockDistributionFunction fileToBlockDistribution) |
void |
testComputeHDFSBlocksDistributionByInputStream() |
void |
testCopyFilesParallel() |
void |
testDeleteAndExists() |
void |
testDFSHedgedReadMetrics()
Ugly test that ensures we can get at the hedged read counters in dfsclient.
|
void |
testFilteredStatusDoesNotThrowOnNotFound() |
void |
testIsHDFS() |
void |
testIsSameHdfs() |
private void |
testIsSameHdfs(int nnport) |
void |
testPermMask() |
void |
testRenameAndSetModifyTime() |
void |
testSetStoragePolicyDefault() |
void |
testSetStoragePolicyInvalid() |
void |
testSetStoragePolicyValidButMaybeNotPresent() |
void |
testVersion() |
private void |
verifyFileInDirWithStoragePolicy(String policy) |
private void |
verifyNoHDFSApiInvocationForDefaultPolicy()
Note: currently the default policy is set to defer to HDFS and this case is to verify the
logic, will need to remove the check if the default policy is changed
|
private void |
WriteDataToHDFS(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
int dataSize) |
private void |
writeVersionFile(org.apache.hadoop.fs.Path versionFile,
String version) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private HBaseTestingUtility htu
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.conf.Configuration conf
final String INVALID_STORAGE_POLICY
static final int blockSize
static final long seed
public TestFSUtils()
public void setUp() throws IOException
IOException
public void testIsHDFS() throws Exception
Exception
private void WriteDataToHDFS(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, int dataSize) throws Exception
Exception
public void testComputeHDFSBlocksDistributionByInputStream() throws Exception
Exception
public void testComputeHDFSBlockDistribution() throws Exception
Exception
private void testComputeHDFSBlocksDistribution(TestFSUtils.HDFSBlockDistributionFunction fileToBlockDistribution) throws Exception
Exception
private void writeVersionFile(org.apache.hadoop.fs.Path versionFile, String version) throws IOException
IOException
public void testVersion() throws org.apache.hadoop.hbase.exceptions.DeserializationException, IOException
org.apache.hadoop.hbase.exceptions.DeserializationException
IOException
public void testPermMask() throws Exception
Exception
public void testDeleteAndExists() throws Exception
Exception
public void testFilteredStatusDoesNotThrowOnNotFound() throws Exception
Exception
public void testRenameAndSetModifyTime() throws Exception
Exception
public void testSetStoragePolicyDefault() throws Exception
Exception
private void verifyNoHDFSApiInvocationForDefaultPolicy()
public void testSetStoragePolicyValidButMaybeNotPresent() throws Exception
Exception
public void testSetStoragePolicyInvalid() throws Exception
Exception
private void verifyFileInDirWithStoragePolicy(String policy) throws Exception
Exception
public void testDFSHedgedReadMetrics() throws Exception
Exception
public void testCopyFilesParallel() throws Exception
Exception
private void pReadFile(org.apache.hadoop.fs.FileSystem fileSys, org.apache.hadoop.fs.Path name) throws IOException
IOException
private void checkAndEraseData(byte[] actual, int from, byte[] expected, String message)
private void doPread(org.apache.hadoop.fs.FSDataInputStream stm, long position, byte[] buffer, int offset, int length) throws IOException
IOException
private void cleanupFile(org.apache.hadoop.fs.FileSystem fileSys, org.apache.hadoop.fs.Path name) throws IOException
IOException
public void checkStreamCapabilitiesOnHdfsDataOutputStream() throws Exception
Exception
private void testIsSameHdfs(int nnport) throws IOException
IOException
public void testIsSameHdfs() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.