code: @Override
    public void setOwner(Path path, final String username, final String groupname)
        throws IOException {
      LOG.debug("setOwner({},{},{})", path, username, groupname);
      AlluxioURI uri = new AlluxioURI(HadoopUtils.getPathWithoutScheme(path));
      SetAttributePOptions.Builder optionsBuilder = SetAttributePOptions.newBuilder();
      boolean ownerOrGroupChanged = false;
      if (username != null && !username.isEmpty()) {
        optionsBuilder.setOwner(username).setRecursive(false);
        ownerOrGroupChanged = true;
      }
      if (groupname != null && !groupname.isEmpty()) {
        optionsBuilder.setGroup(groupname).setRecursive(false);
        ownerOrGroupChanged = true;
      }
      if (ownerOrGroupChanged) {
        try {
          mFileSystem.setAttribute(uri, optionsBuilder.build());
        } catch (AlluxioException e) {
          throw new IOException(e);
        }
      }
    }
docs: Changes owner or group of a path (i.e. a file or a directory). If username is null, the
  original username remains unchanged. Same as groupname. If username and groupname are non-null,
  both of them will be changed.
  
  @param path path to set owner or group
  @param username username to be set
  @param groupname groupname to be set