class CommonBeans {

  @Bean
  public HiveConf hiveConf(@Value("${metastore-uri}") String metastoreUri) {
    HiveConf conf = new HiveConf();
    conf.setVar(HiveConf.ConfVars.METASTOREURIS, metastoreUri);

    // set AWS authentication methods
    conf.set("fs.s3.impl", S3AFileSystem.class.getName());
    conf.set("fs.s3a.impl", S3AFileSystem.class.getName());
    conf.set("fs.s3n.impl", S3AFileSystem.class.getName());
    conf.set("fs.s3.aws.credentials.provider", EC2ContainerCredentialsProviderWrapper.class.getName());
    conf.set("fs.s3a.aws.credentials.provider", EC2ContainerCredentialsProviderWrapper.class.getName());
    conf.set("fs.s3n.aws.credentials.provider", EC2ContainerCredentialsProviderWrapper.class.getName());

    return conf;
  }

}