congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FileInfo.getOwner
Code IndexAdd Tabnine to your IDE (free)

How to use
getOwner
method
in
alluxio.wire.FileInfo

Best Java code snippets using alluxio.wire.FileInfo.getOwner (Showing top 12 results out of 315)

origin: Alluxio/alluxio

/**
 * @return the owner of the entity referenced by this uri, mutable
 */
public String getOwner() {
 return mInfo.getOwner();
}
origin: Alluxio/alluxio

OutputStream outputStream = ufs.create(dstPath,
  CreateOptions.defaults(ServerConfiguration.global())
  .setOwner(fileInfo.getOwner()).setGroup(fileInfo.getGroup())
  .setMode(new Mode((short) fileInfo.getMode())));
final WritableByteChannel outputChannel = Channels.newChannel(outputStream);
origin: Alluxio/alluxio

 private void assertFileInfoEqualsFileStatus(FileInfo info, FileStatus status) {
  assertEquals(info.getOwner(), status.getOwner());
  assertEquals(info.getGroup(), status.getGroup());
  assertEquals(info.getMode(), status.getPermission().toShort());
  assertEquals(info.getLastModificationTimeMs(), status.getModificationTime());
  assertEquals(info.isFolder(), status.isDir());
 }
}
origin: Alluxio/alluxio

private void verifyRename(TestUser user, String srcPath, String dstPath)
  throws Exception {
 try (Closeable r = new AuthenticatedUserRule(user.getUser(),
   ServerConfiguration.global()).toResource()) {
  String fileOwner =
    mFileSystemMaster.getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(srcPath)))
      .getOwner();
  mFileSystemMaster.rename(new AlluxioURI(srcPath), new AlluxioURI(dstPath),
    RenameContext.defaults());
  assertEquals(-1, mFileSystemMaster.getFileId(new AlluxioURI(srcPath)));
  FileInfo fileInfo =
    mFileSystemMaster.getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(dstPath)));
  String[] pathComponents = dstPath.split("/");
  assertEquals(pathComponents[pathComponents.length - 1], fileInfo.getName());
  assertEquals(fileOwner, fileInfo.getOwner());
 }
}
origin: Alluxio/alluxio

@Test
public void setOwnerSuccess() throws Exception {
 verifySetAcl(TEST_USER_ADMIN, TEST_FILE_URI, TEST_USER_1.getUser(), null, (short) -1, false);
 verifySetAcl(TEST_USER_SUPERGROUP, TEST_DIR_URI, TEST_USER_2.getUser(), null, (short) -1, true);
 FileInfo fileInfo = mFileSystemMaster
   .getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(TEST_DIR_FILE_URI)));
 assertEquals(TEST_USER_2.getUser(), fileInfo.getOwner());
}
origin: Alluxio/alluxio

private void verifyCreateFile(TestUser user, String path, boolean recursive) throws Exception {
 try (Closeable r = new AuthenticatedUserRule(user.getUser(),
   ServerConfiguration.global()).toResource()) {
  CreateFileContext context = CreateFileContext
    .defaults(
      CreateFilePOptions.newBuilder().setRecursive(recursive))
    .setOwner(SecurityUtils.getOwnerFromGrpcClient(ServerConfiguration.global()))
    .setGroup(SecurityUtils.getGroupFromGrpcClient(ServerConfiguration.global()))
    .setPersisted(true);
  long fileId = mFileSystemMaster.createFile(new AlluxioURI(path), context);
  FileInfo fileInfo = mFileSystemMaster.getFileInfo(fileId);
  String[] pathComponents = path.split("/");
  assertEquals(pathComponents[pathComponents.length - 1], fileInfo.getName());
  assertEquals(user.getUser(), fileInfo.getOwner());
 }
}
origin: Alluxio/alluxio

private void verifyCreateDirectory(TestUser user, String path, boolean recursive)
  throws Exception {
 try (Closeable r = new AuthenticatedUserRule(user.getUser(),
   ServerConfiguration.global()).toResource()) {
  CreateDirectoryContext context = CreateDirectoryContext
    .defaults(CreateDirectoryPOptions.newBuilder().setRecursive(recursive))
    .setOwner(SecurityUtils.getOwnerFromGrpcClient(ServerConfiguration.global()))
    .setGroup(SecurityUtils.getGroupFromGrpcClient(ServerConfiguration.global()));
  mFileSystemMaster.createDirectory(new AlluxioURI(path), context);
  FileInfo fileInfo =
    mFileSystemMaster.getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(path)));
  String[] pathComponents = path.split("/");
  assertEquals(pathComponents[pathComponents.length - 1], fileInfo.getName());
  assertEquals(true, fileInfo.isFolder());
  assertEquals(user.getUser(), fileInfo.getOwner());
 }
}
origin: Alluxio/alluxio

.addAllBlockIds(fileInfo.getBlockIds())
.setLastModificationTimeMs(fileInfo.getLastModificationTimeMs()).setTtl(fileInfo.getTtl())
.setOwner(fileInfo.getOwner()).setGroup(fileInfo.getGroup()).setMode(fileInfo.getMode())
.setPersistenceState(fileInfo.getPersistenceState()).setMountPoint(fileInfo.isMountPoint())
.addAllFileBlockInfos(fileBlockInfos)
origin: Alluxio/alluxio

private void verifySetAcl(TestUser runUser, String path, String owner, String group,
  short mode, boolean recursive) throws Exception {
 try (Closeable r = new AuthenticatedUserRule(runUser.getUser(),
   ServerConfiguration.global()).toResource()) {
  SetAttributeContext context = SetAttributeContext.defaults(SetAttributePOptions.newBuilder()
    .setMode(new Mode(mode).toProto()).setRecursive(recursive));
  if (owner != null) {
   context.getOptions().setOwner(owner);
  }
  if (group != null) {
   context.getOptions().setGroup(group);
  }
  mFileSystemMaster.setAttribute(new AlluxioURI(path), context);
 }
 try (Closeable r = new AuthenticatedUserRule(TEST_USER_ADMIN.getUser(),
   ServerConfiguration.global()).toResource()) {
  FileInfo fileInfo =
    mFileSystemMaster.getFileInfo(mFileSystemMaster.getFileId(new AlluxioURI(path)));
  if (owner != null) {
   assertEquals(owner, fileInfo.getOwner());
  }
  if (group != null) {
   assertEquals(group, fileInfo.getGroup());
  }
  if (mode != -1) {
   assertEquals(mode, fileInfo.getMode());
  }
 }
}
origin: Alluxio/alluxio

Assert.assertEquals(a.getMode(), b.getMode());
Assert.assertEquals(a.getName(), b.getName());
Assert.assertEquals(a.getOwner(), b.getOwner());
Assert.assertEquals(a.getPath(), b.getPath());
Assert.assertEquals(a.getPersistenceState(), b.getPersistenceState());
origin: org.alluxio/alluxio-core-common

/**
 * @return the owner of the entity referenced by this uri, mutable
 */
public String getOwner() {
 return mInfo.getOwner();
}
origin: Alluxio/alluxio

Assert.assertEquals(uriStatus.getTtlAction(), fileInfo.getTtlAction());
Assert.assertEquals(uriStatus.getUfsPath(), fileInfo.getUfsPath());
Assert.assertEquals(uriStatus.getOwner(), fileInfo.getOwner());
Assert.assertEquals(uriStatus.isCacheable(), fileInfo.isCacheable());
Assert.assertEquals(uriStatus.isCompleted(), fileInfo.isCompleted());
alluxio.wireFileInfogetOwner

Popular methods of FileInfo

  • <init>
    Creates a new instance of FileInfo.
  • getPath
  • isFolder
  • setFileBlockInfos
  • getGroup
  • getLastModificationTimeMs
  • getLength
  • getMode
  • getName
  • getUfsPath
  • isCompleted
  • setBlockIds
  • isCompleted,
  • setBlockIds,
  • setFolder,
  • setLength,
  • setPath,
  • getBlockIds,
  • getBlockSizeBytes,
  • getCreationTimeMs,
  • getFileId

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now