All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazon.redshift.hostchooser.SingleHostChooser Maven / Gradle / Ivy

There is a newer version: 2.1.0.30
Show newest version
/*
 * Copyright (c) 2014, PostgreSQL Global Development Group
 * See the LICENSE file in the project root for more information.
 */

package com.amazon.redshift.hostchooser;

import com.amazon.redshift.util.HostSpec;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

/**
 * Host chooser that returns the single host.
 */
class SingleHostChooser implements HostChooser {
  private final Collection candidateHost;

  SingleHostChooser(HostSpec hostSpec, HostRequirement targetServerType) {
    this.candidateHost = Collections.singletonList(new CandidateHost(hostSpec, targetServerType));
  }

  @Override
  public Iterator iterator() {
    return candidateHost.iterator();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy