{@inheritDoc}.

If this mount id is new to this worker, this method will query master to get the
corresponding ufs info.
170245
@Override
  public UfsClient get(long mountId) throws NotFoundException, UnavailableException {
    try {
      return super.get(mountId);
    } catch (NotFoundException e) {
      // Not cached locally, let's query master
    }

    UfsInfo info;
    try {
      info = mMasterClient.getUfsInfo(mountId);
    } catch (IOException e) {
      throw new UnavailableException(
          String.format("Failed to create UFS info for mount point with id %d", mountId), e);
    }
    Preconditions.checkState((info.hasUri() && info.hasProperties()), "unknown mountId");
    super.addMount(mountId, new AlluxioURI(info.getUri()),
        UnderFileSystemConfiguration.defaults(ServerConfiguration.global())
            .setReadOnly(info.getProperties().getReadOnly())
            .setShared(info.getProperties().getShared())
            .createMountSpecificConf(info.getProperties().getPropertiesMap()));
    UfsClient ufsClient = super.get(mountId);
    return ufsClient;
  }
457461
private UfsStatus[] getChildrenInUFS(AlluxioURI alluxioUri)
      throws InvalidPathException, IOException {
    MountTable.Resolution resolution = mMountTable.resolve(alluxioUri);
    AlluxioURI ufsUri = resolution.getUri();
    try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {
      UnderFileSystem ufs = ufsResource.get();
      AlluxioURI curUri = ufsUri;
      while (curUri != null) {
        if (mListedDirectories.containsKey(curUri.toString())) {
          List<UfsStatus> childrenList = new ArrayList<>();
          for (UfsStatus childStatus : mListedDirectories.get(curUri.toString())) {
            String childPath = PathUtils.concatPath(curUri, childStatus.getName());
            String prefix = PathUtils.normalizePath(ufsUri.toString(), AlluxioURI.SEPARATOR);
            if (childPath.startsWith(prefix) && childPath.length() > prefix.length()) {
              UfsStatus newStatus = childStatus.copy();
              newStatus.setName(childPath.substring(prefix.length()));
              childrenList.add(newStatus);
            }
          }
          return trimIndirect(childrenList.toArray(new UfsStatus[childrenList.size()]));
        }
        curUri = curUri.getParent();
      }
      UfsStatus[] children =
          ufs.listStatus(ufsUri.toString(), ListOptions.defaults().setRecursive(true));
      // Assumption: multiple mounted UFSs cannot have the same ufsUri
      if (children == null) {
        return EMPTY_CHILDREN;
      }
      mListedDirectories.put(ufsUri.toString(), children);
      return trimIndirect(children);
    }
  }
841555
private boolean scanHadoopConfigFiles(final ServerInformationCatalog serverInformationCatalog,
            final String selectedServer) {

        final HadoopClusterInformation clusterInformation;
        if (selectedServer != null) {
            clusterInformation = (HadoopClusterInformation) serverInformationCatalog.getServer(selectedServer);
        } else {
            clusterInformation = (HadoopClusterInformation) serverInformationCatalog
                    .getServer(HadoopResource.DEFAULT_CLUSTERREFERENCE);
        }

        if (clusterInformation == null) {
            return false;
        }

        final Configuration configuration = HdfsUtils.getHadoopConfigurationWithTimeout(clusterInformation);

        _currentDirectory = new Path("/");

        try {
            _fileSystem = FileSystem.newInstance(configuration);
        } catch (final IOException e) {
            throw new IllegalArgumentException("Illegal URI when showing HDFS chooser", e);
        }
        final HdfsDirectoryModel model = (HdfsDirectoryModel) _fileList.getModel();
        model.updateFileList();
        return model._files.length > 0;
    }
896546
public int finalizeUpgrade() throws IOException {
    int exitCode = -1;

    DistributedFileSystem dfs = getDFS();
    if (dfs == null) {
      System.out.println("FileSystem is " + getFS().getUri());
      return exitCode;
    }

    dfs.finalizeUpgrade();
    exitCode = 0;
   
    return exitCode;
  }
908773
public SlaveConnectionInfo slaveConnectionInfo() {
        if (isMaster())
            throw new IllegalStateException("Unable to determine slave connection info. This is a master node");
        return SlaveConnectionInfo.builder().connectionUrl(subscriber.connectionUrl()).masterUrl(publishMasterUrl)
                        .build();

    }
695721
private Optional<UfsStatus> syncPersistDirectory(InodeDirectoryView dir)
      throws FileDoesNotExistException, IOException, InvalidPathException {
    AlluxioURI uri = getPath(dir);
    MountTable.Resolution resolution = mMountTable.resolve(uri);
    String ufsUri = resolution.getUri().toString();
    try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) {
      UnderFileSystem ufs = ufsResource.get();
      MkdirsOptions mkdirsOptions =
          MkdirsOptions.defaults(ServerConfiguration.global()).setCreateParent(false)
          .setOwner(dir.getOwner()).setGroup(dir.getGroup()).setMode(new Mode(dir.getMode()));
      if (!ufs.mkdirs(ufsUri, mkdirsOptions)) {
        // Directory might already exist. Try loading the status from ufs.
        UfsStatus status;
        try {
          status = ufs.getStatus(ufsUri);
        } catch (Exception e) {
          throw new IOException(String.format("Cannot create or load UFS directory %s: %s.",
              ufsUri, e.toString()), e);
        }
        if (status.isFile()) {
          throw new InvalidPathException(String.format(
              "Error persisting directory. A file exists at the UFS location %s.", ufsUri));
        }
        return Optional.of(status);
      }
    }
    return Optional.empty();
  }
620483
public function get($objectId, $useMasterKey = false)
    {
        $this->equalTo('objectId', $objectId);
        $result = $this->first($useMasterKey);
        if (empty($result))
        {
            throw new AVException("Object not found.", 101);
        }

        return $result;
    }
880539
public synchronized int getPrimaryMasterIndex(int timeoutMs)
      throws TimeoutException, InterruptedException {
    final FileSystem fs = getFileSystemClient();
    final MasterInquireClient inquireClient = getMasterInquireClient();
    CommonUtils.waitFor("a primary master to be serving", () -> {
      try {
        // Make sure the leader is serving.
        fs.getStatus(new AlluxioURI("/"));
        return true;
      } catch (UnavailableException e) {
        return false;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }, WaitForOptions.defaults().setTimeoutMs(timeoutMs));
    int primaryRpcPort;
    try {
      primaryRpcPort = inquireClient.getPrimaryRpcAddress().getPort();
    } catch (UnavailableException e) {
      throw new RuntimeException(e);
    }
    // Returns the master whose RPC port matches the primary RPC port.
    for (int i = 0; i < mMasterAddresses.size(); i++) {
      if (mMasterAddresses.get(i).getRpcPort() == primaryRpcPort) {
        return i;
      }
    }
    throw new RuntimeException(
        String.format("No master found with RPC port %d. Master addresses: %s", primaryRpcPort,
            mMasterAddresses));
  }
626296
private Version getClusterOrNodeVersion() {
        if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) {
            return node.getClusterService().getClusterVersion();
        } else {
            String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION);
            return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion()
                    : node.getVersion().asVersion();
        }
    }
1008114
private String getInfoServer() throws IOException {
    URI fsName = FileSystem.getDefaultUri(conf);
    if (!"hdfs".equals(fsName.getScheme())) {
      throw new IOException("This is not a DFS");
    }
    return NetUtils.getServerAddress(conf, "dfs.info.bindAddress", 
                                     "dfs.info.port", "dfs.http.address");
  }
92660
@Override
    public SecurityMetadata getSecurityMetadata() {
        SecurityMetadata sm = super.getSecurityMetadata();
        if (sm == null) {
            return getDefaultAdminSecurityMetadata();
        } else {
            return sm;
        }
    }
80904
public int getMasterSlave()
    {
    	int iMasterSlave = super.getMasterSlave();
    	if (iMasterSlave == RecordOwner.MASTER)
    		if (this.getClass() == org.jbundle.base.remote.db.TableSession.class)
    			return RecordOwner.SLAVE;       // Auto-created session is the Slave session (Unless it was overridden)
        return iMasterSlave;
    }
728744
public int run() throws IOException {
    Map<String, MountPointInfo> mountTable = mFileSystemMasterClient.getMountTable();
    System.out.println("Alluxio under storage system information:");
    printMountInfo(mountTable);
    return 0;
  }
1305711
public boolean[] getSubjectUniqueID() {
        if (info == null)
            return null;
        try {
            UniqueIdentity id = (UniqueIdentity)info.get(
                                 X509CertInfo.SUBJECT_ID);
            if (id == null)
                return null;
            else
                return (id.getId());
        } catch (Exception e) {
            return null;
        }
    }
110721
public JobID getNewJobId() throws IOException {
    JobID id = new JobID(getTrackerIdentifier(), nextJobId.getAndIncrement());

    // get the user group info
    UserGroupInformation ugi = UserGroupInformation.getCurrentUGI();

    // mark the user for this id
    jobToUserMap.put(id, ugi.getUserName());

    LOG.info("Job id " + id + " assigned to user " + ugi.getUserName());

    return id;
  }
524330
public int getMasterSlave()
    {
        int iRecordOwnerMasterSlave = 0;    // None by default
        int iDBMasterSlave = RecordOwner.MASTER | RecordOwner.SLAVE;    // Both by default
        if (this.getRecordOwner() != null)
            iRecordOwnerMasterSlave = this.getRecordOwner().getMasterSlave();
        if (m_table != null)
        {
            if (this.getTable() != null)
                if (this.getTable().getCurrentTable() != null)
                    if (this.getTable().getCurrentTable().getDatabase() != null)
                        iDBMasterSlave = this.getTable().getCurrentTable().getDatabase().getMasterSlave();
            if (iDBMasterSlave == RecordOwner.SLAVE)
                if (this.getRecordOwner() == null)
                    iDBMasterSlave = RecordOwner.MASTER | RecordOwner.SLAVE;    // The only records that don't have an owner in a slave are user-added.
        }
        return iRecordOwnerMasterSlave | iDBMasterSlave;
    }
939770
@Override
  public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException {
    // Get the item from cache.
    GoogleCloudStorageItemInfo item = cache.getItem(resourceId);

    // If it wasn't in the cache, list all the objects in the parent directory and cache them
    // and then retrieve it from the cache.
    if (item == null && resourceId.isStorageObject()) {
      String bucketName = resourceId.getBucketName();
      String objectName = resourceId.getObjectName();
      int lastSlashIndex = objectName.lastIndexOf(PATH_DELIMITER);
      String directoryName =
          lastSlashIndex >= 0 ? objectName.substring(0, lastSlashIndex + 1) : null;
      List<GoogleCloudStorageItemInfo> cachedInDirectory =
          cache.listItems(bucketName, directoryName);
      filter(cachedInDirectory, bucketName, directoryName, PATH_DELIMITER);
      // If there are items already cached in directory, do not prefetch with list requests,
      // because metadata for this directory already could be prefetched
      if (cachedInDirectory.isEmpty()) {
        // make just 1 request to prefetch only 1 page of directory items
        listObjectInfoPage(bucketName, directoryName, PATH_DELIMITER, /* pageToken= */ null);
        item = cache.getItem(resourceId);
      }
    }

    // If it wasn't in the cache and wasn't cached in directory list request
    // then request and cache it directly.
    if (item == null) {
      item = super.getItemInfo(resourceId);
      cache.putItem(item);
    }

    return item;
  }