

package org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair;

import org.apache.hadoop.security.GroupMappingServiceProvider;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
 * Group Mapping class used for test cases. Returns only primary group of the
 * given user
 */
public class PrimaryGroupMapping implements GroupMappingServiceProvider {

  @Override
  public List<String> getGroups(String user) {
    return Arrays.asList(user + "group");
  }

  @Override
  public void cacheGroupsRefresh() throws IOException {
    throw new UnsupportedOperationException();
  }

  @Override
  public void cacheGroupsAdd(List<String> groups) throws IOException {
    throw new UnsupportedOperationException();
  }
}
