Search in sources :

Example 6 with FileSystemTestWrapper

use of org.apache.hadoop.fs.FileSystemTestWrapper in project hadoop by apache.

the class TestTrashWithEncryptionZones method setup.

@Before
public void setup() throws Exception {
    conf = new HdfsConfiguration();
    fsHelper = new FileSystemTestHelper();
    // Set up java key store
    String testRoot = fsHelper.getTestRootDir();
    testRootDir = new File(testRoot).getAbsoluteFile();
    conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_KEY_PROVIDER_PATH, getKeyProviderURI());
    conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, true);
    // Lower the batch size for testing
    conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES, 2);
    cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
    org.apache.log4j.Logger.getLogger(EncryptionZoneManager.class).setLevel(Level.TRACE);
    fs = cluster.getFileSystem();
    fsWrapper = new FileSystemTestWrapper(fs);
    dfsAdmin = new HdfsAdmin(cluster.getURI(), conf);
    setProvider();
    // Create a test key
    DFSTestUtil.createKey(TEST_KEY, cluster, conf);
    clientConf = new Configuration(conf);
    clientConf.setLong(FS_TRASH_INTERVAL_KEY, 1);
    shell = new FsShell(clientConf);
}
Also used : FileSystemTestHelper(org.apache.hadoop.fs.FileSystemTestHelper) FsShell(org.apache.hadoop.fs.FsShell) Configuration(org.apache.hadoop.conf.Configuration) HdfsAdmin(org.apache.hadoop.hdfs.client.HdfsAdmin) FileSystemTestWrapper(org.apache.hadoop.fs.FileSystemTestWrapper) File(java.io.File) EncryptionZoneManager(org.apache.hadoop.hdfs.server.namenode.EncryptionZoneManager) Before(org.junit.Before)

Aggregations

FileSystemTestWrapper (org.apache.hadoop.fs.FileSystemTestWrapper)6 HdfsAdmin (org.apache.hadoop.hdfs.client.HdfsAdmin)5 File (java.io.File)4 FileSystemTestHelper (org.apache.hadoop.fs.FileSystemTestHelper)4 Before (org.junit.Before)4 EncryptionZoneManager (org.apache.hadoop.hdfs.server.namenode.EncryptionZoneManager)3 Configuration (org.apache.hadoop.conf.Configuration)2 FileContextTestWrapper (org.apache.hadoop.fs.FileContextTestWrapper)2 Path (org.apache.hadoop.fs.Path)2 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)2 RandomAccessFile (java.io.RandomAccessFile)1 FsShell (org.apache.hadoop.fs.FsShell)1 DistributedFileSystem (org.apache.hadoop.hdfs.DistributedFileSystem)1 HdfsConfiguration (org.apache.hadoop.hdfs.HdfsConfiguration)1 INodesInPath (org.apache.hadoop.hdfs.server.namenode.INodesInPath)1 MetricsRecordBuilder (org.apache.hadoop.metrics2.MetricsRecordBuilder)1 BeforeClass (org.junit.BeforeClass)1 Test (org.junit.Test)1 Mockito.anyString (org.mockito.Mockito.anyString)1