private void updateAccounts(RetainingAsyncWritableChannel channel) throws RestServiceException {
      Collection<Account> accountsToUpdate;
      try {
        accountsToUpdate = AccountCollectionSerde.accountsFromInputStreamInJson(channel.consumeContentAsInputStream());
      } catch (IOException e) {
        throw new RestServiceException("Bad account update request body", e, RestServiceErrorCode.BadRequest);
      }
      try {
        accountService.updateAccounts(accountsToUpdate);
      } catch (AccountServiceException ase) {
        throw new RestServiceException("Account update failed: " + ase.getMessage(),
            RestServiceErrorCode.getRestServiceErrorCode(ase.getErrorCode()));
      }
    }
Process the request json and call {@link AccountService#updateAccounts} to update accounts.
@param channel The {@link RetainingAsyncWritableChannel} to read the bytes out
@throws RestServiceException
ambry-frontend/src/main/java/com/github/ambry/frontend/PostAccountsHandler.java