class SimplePipelineProvider extends PipelineProvider {

  @Override
  public Pipeline create(ReplicationFactor factor) throws IOException {
    List<DatanodeDetails> dns = pickNodesNeverUsed(ReplicationType.STAND_ALONE,
        factor);

    if (dns.size() < factor.getNumber()) {
      String e = String
          .format("Cannot create pipeline of factor %d using %d nodes.",
              factor.getNumber(), dns.size());
      throw new InsufficientDatanodesException(e);
    }

    Collections.shuffle(dns);
    return Pipeline.newBuilder()
        .setId(PipelineID.randomId())
        .setState(PipelineState.OPEN)
        .setType(ReplicationType.STAND_ALONE)
        .setFactor(factor)
        .setNodes(dns.subList(0, factor.getNumber()))
        .build();
  }

  public  SimplePipelineProvider(NodeManager nodeManager,
      PipelineStateManager stateManager);

}