private Pair<Short, Short> getAccountAndContainerIdFromName(String accountName, String containerName)
      throws AccountServiceException {
    final Container container = getContainerByName(accountName, containerName);
    if (container == null) {
      throw new AccountServiceException("Can't find the container: " + containerName + " in account: " + accountName,
          AccountServiceErrorCode.BadRequest);
    }
    final short accountId = container.getParentAccountId();
    final short containerId = container.getId();
    return new Pair<>(accountId, containerId);
  }
A helper function to get account and container id from its name.
@param accountName the name of the account.
@param containerName the name of the container.
@return the pair of accountId and containerId.
@throws AccountServiceException
ambry-account/src/main/java/com/github/ambry/account/CachedAccountService.java