class StaticMetastoreLocator implements MetastoreLocator {

    @Override
    public ThriftMetastoreClient createMetastoreClient(Optional<String> delegationToken)
            throws TException
    {
        List<Integer> indices = backoffs.stream()
                .sorted(Comparator.comparingLong(Backoff::getBackoffDuration))
                .map(backoffs::indexOf)
                .collect(toImmutableList());

        TException lastException = null;
        for (int index : indices) {
            try {
                return getClient(addresses.get(index), backoffs.get(index), delegationToken);
            }
            catch (TException e) {
                lastException = e;
            }
        }
        throw new TException("Failed connecting to Hive metastore: " + addresses, lastException);
    }

    @Inject public  StaticMetastoreLocator(StaticMetastoreConfig config, ThriftMetastoreAuthenticationConfig authenticationConfig, ThriftMetastoreClientFactory clientFactory);
    public  StaticMetastoreLocator(List<URI> metastoreUris, @Nullable String metastoreUsername, ThriftMetastoreClientFactory clientFactory);

}