use of alluxio.grpc.CreateFilePOptions in project alluxio by Alluxio.
the class CheckConsistencyIntegrationTest method before.
@Before
public final void before() throws Exception {
mFileSystemMaster = mLocalAlluxioClusterResource.get().getLocalAlluxioMaster().getMasterProcess().getMaster(FileSystemMaster.class);
mFileSystem = FileSystem.Factory.create(ServerConfiguration.global());
CreateDirectoryPOptions dirOptions = CreateDirectoryPOptions.newBuilder().setWriteType(WritePType.CACHE_THROUGH).build();
CreateFilePOptions fileOptions = CreateFilePOptions.newBuilder().setWriteType(WritePType.CACHE_THROUGH).build();
mFileSystem.createDirectory(DIRECTORY, dirOptions);
mFileSystem.createFile(FILE, fileOptions).close();
}
use of alluxio.grpc.CreateFilePOptions in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method setAcl.
@Test
@LocalAlluxioClusterResource.Config(confParams = { PropertyKey.Name.SECURITY_AUTHENTICATION_TYPE, "SIMPLE", PropertyKey.Name.SECURITY_AUTHORIZATION_PERMISSION_ENABLED, "true", PropertyKey.Name.SECURITY_GROUP_MAPPING_CLASS, FakeUserGroupsMapping.FULL_CLASS_NAME })
public void setAcl() throws Exception {
AlluxioURI filePath = new AlluxioURI("/file");
String user = "alluxio";
ServerConfiguration.set(PropertyKey.SECURITY_LOGIN_USERNAME, user);
CreateFilePOptions op = CreateFilePOptions.newBuilder().setBlockSizeBytes(64).build();
mFileSystem.createFile(filePath, op).close();
// TODO(chaomin): also setOwner and setGroup once there's a way to fake the owner/group in UFS.
mFileSystem.setAttribute(filePath, SetAttributePOptions.newBuilder().setMode(new Mode((short) 0400).toProto()).setRecursive(false).build());
URIStatus status = mFileSystem.getStatus(filePath);
mLocalAlluxioCluster.stopFS();
aclTestUtil(status, user);
deleteFsMasterJournalLogs();
aclTestUtil(status, user);
}
use of alluxio.grpc.CreateFilePOptions in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method file.
/**
* Tests file creation.
*/
@Test
public void file() throws Exception {
CreateFilePOptions option = CreateFilePOptions.newBuilder().setBlockSizeBytes(64).build();
AlluxioURI filePath = new AlluxioURI("/xyz");
mFileSystem.createFile(filePath, option).close();
URIStatus status = mFileSystem.getStatus(filePath);
mLocalAlluxioCluster.stopFS();
fileTestUtil(status);
deleteFsMasterJournalLogs();
fileTestUtil(status);
}
use of alluxio.grpc.CreateFilePOptions in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method rename.
/**
* Tests file and directory creation, and rename.
*/
@Test
public void rename() throws Exception {
for (int i = 0; i < 10; i++) {
mFileSystem.createDirectory(new AlluxioURI("/i" + i));
for (int j = 0; j < 10; j++) {
CreateFilePOptions option = CreateFilePOptions.newBuilder().setBlockSizeBytes((i + j + 1) * 64).build();
AlluxioURI path = new AlluxioURI("/i" + i + "/j" + j);
mFileSystem.createFile(path, option).close();
mFileSystem.rename(path, new AlluxioURI("/i" + i + "/jj" + j));
}
mFileSystem.rename(new AlluxioURI("/i" + i), new AlluxioURI("/ii" + i));
}
mLocalAlluxioCluster.stopFS();
renameTestUtil();
deleteFsMasterJournalLogs();
renameTestUtil();
}
use of alluxio.grpc.CreateFilePOptions in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method fileDirectory.
/**
* Tests file and directory creation.
*/
@Test
public void fileDirectory() throws Exception {
for (int i = 0; i < 10; i++) {
mFileSystem.createDirectory(new AlluxioURI("/i" + i));
for (int j = 0; j < 10; j++) {
CreateFilePOptions option = CreateFilePOptions.newBuilder().setBlockSizeBytes((i + j + 1) * 64).build();
mFileSystem.createFile(new AlluxioURI("/i" + i + "/j" + j), option).close();
}
}
mLocalAlluxioCluster.stopFS();
fileDirectoryTestUtil();
deleteFsMasterJournalLogs();
fileDirectoryTestUtil();
}
Aggregations