Search in sources :

Example 11 with FileSystemShell

use of alluxio.cli.fs.FileSystemShell in project alluxio by Alluxio.

the class CpCommandIntegrationTest method copyAfterWorkersNotAvailableMustCache.

@Test
public void copyAfterWorkersNotAvailableMustCache() throws Exception {
    InstancedConfiguration conf = new InstancedConfiguration(ServerConfiguration.global());
    conf.set(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, "MUST_CACHE");
    try (FileSystemShell fsShell = new FileSystemShell(conf)) {
        File testFile = new File(sLocalAlluxioCluster.getAlluxioHome() + "/testFile");
        testFile.createNewFile();
        FileOutputStream fos = new FileOutputStream(testFile);
        byte[] toWrite = BufferUtils.getIncreasingByteArray(100);
        fos.write(toWrite);
        fos.close();
        fsShell.run("copyFromLocal", testFile.getPath(), "/");
        Assert.assertTrue(sFileSystem.exists(new AlluxioURI("/testFile")));
        sLocalAlluxioCluster.stopWorkers();
        fsShell.run("cp", "/testFile", "/testFile2");
        Assert.assertFalse(sFileSystem.exists(new AlluxioURI("/testFile2")));
    }
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) FileOutputStream(java.io.FileOutputStream) FileSystemShell(alluxio.cli.fs.FileSystemShell) File(java.io.File) AlluxioURI(alluxio.AlluxioURI) AbstractFileSystemShellTest(alluxio.client.cli.fs.AbstractFileSystemShellTest) Test(org.junit.Test) FileSystemShellUtilsTest(alluxio.client.cli.fs.FileSystemShellUtilsTest)

Aggregations

FileSystemShell (alluxio.cli.fs.FileSystemShell)11 AlluxioURI (alluxio.AlluxioURI)9 Test (org.junit.Test)9 InstancedConfiguration (alluxio.conf.InstancedConfiguration)6 AbstractFileSystemShellTest (alluxio.client.cli.fs.AbstractFileSystemShellTest)5 FileSystemShellUtilsTest (alluxio.client.cli.fs.FileSystemShellUtilsTest)5 FileSystem (alluxio.client.file.FileSystem)4 LocalAlluxioJobCluster (alluxio.master.LocalAlluxioJobCluster)4 BeforeClass (org.junit.BeforeClass)4 URIStatus (alluxio.client.file.URIStatus)3 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)3 Constants (alluxio.Constants)2 FileSystemTestUtils (alluxio.client.file.FileSystemTestUtils)2 PropertyKey (alluxio.conf.PropertyKey)2 ServerConfiguration (alluxio.conf.ServerConfiguration)2 AlluxioException (alluxio.exception.AlluxioException)2 WritePType (alluxio.grpc.WritePType)2 Status (alluxio.job.wire.Status)2 AclEntry (alluxio.security.authorization.AclEntry)2 Mode (alluxio.security.authorization.Mode)2