// Path: core/src/main/java/org/kududb/ts/core/Datapoint.java
// @InterfaceAudience.Public
// @InterfaceStability.Unstable
// @NotThreadSafe
// public final class Datapoint {
//   private long time;
//   private double value;
// 
//   private Datapoint(long time, double value) {
//     this.time = time;
//     this.value = value;
//   }
// 
//   /**
//    * Creates a new {@code Datapoint} with the provided time and value.
//    * @param microseconds the {@code Datapoint}'s time in microseconds
//    * @param value the {@code Datapoint}'s value
//    * @return a new {@code Datapoint}
//    */
//   public static Datapoint create(long microseconds, double value) {
//     return new Datapoint(microseconds, value);
//   }
// 
//   /**
//    * Returns the {@code Datapoint}'s time in microseconds.
//    * @return the {@code Datapoint}'s time in microseconds
//    */
//   public long getTime() {
//     return time;
//   }
// 
//   /**
//    * Returns the {@code Datapoint}'s value.
//    * @return the {@code Datapoint}'s value
//    */
//   public double getValue() {
//     return value;
//   }
// 
//   /**
//    * Sets the time of the {@code Datapoint}.
//    * @param microseconds the new time in microseconds
//    */
//   public void setTime(long microseconds) {
//     time = microseconds;
//   }
// 
//   /**
//    * Sets the value of the {@code Datapoint}.
//    * @param value the new value
//    */
//   public void setValue(double value) {
//     this.value = value;
//   }
// 
//   /** {@inheritDoc} */
//   @Override
//   public String toString() {
//     return MoreObjects.toStringHelper(this)
//                       .add("time", time)
//                       .add("value", value)
//                       .toString();
//   }
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.util.SortedMap;
import java.util.concurrent.CountDownLatch;
import org.LatencyUtils.LatencyStats;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.kududb.ts.core.Datapoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
  private final String metric;
  private final SortedMap<String, String> tags;
  private final DatapointGenerator datapoints;
  private final LatencyStats stats;
  private final CloseableHttpClient client;
  private final ObjectMapper mapper;
  private final CountDownLatch latch;

  public PutSeries(URI url,
                   String metric,
                   SortedMap<String, String> tags,
                   DatapointGenerator datapoints,
                   LatencyStats stats,
                   CloseableHttpClient client,
                   ObjectMapper mapper,
                   CountDownLatch latch) {
    this.url = url;
    this.metric = metric;
    this.tags = tags;
    this.datapoints = datapoints;
    this.stats = stats;
    this.client = client;
    this.mapper = mapper;
    this.latch = latch;
  }

  @Override
  public void run() {
    try {
      while (datapoints.hasNext()) {
// Path: core/src/main/java/org/kududb/ts/core/Datapoint.java
// @InterfaceAudience.Public
// @InterfaceStability.Unstable
// @NotThreadSafe
// public final class Datapoint {
//   private long time;
//   private double value;
// 
//   private Datapoint(long time, double value) {
//     this.time = time;
//     this.value = value;
//   }
// 
//   /**
//    * Creates a new {@code Datapoint} with the provided time and value.
//    * @param microseconds the {@code Datapoint}'s time in microseconds
//    * @param value the {@code Datapoint}'s value
//    * @return a new {@code Datapoint}
//    */
//   public static Datapoint create(long microseconds, double value) {
//     return new Datapoint(microseconds, value);
//   }
// 
//   /**
//    * Returns the {@code Datapoint}'s time in microseconds.
//    * @return the {@code Datapoint}'s time in microseconds
//    */
//   public long getTime() {
//     return time;
//   }
// 
//   /**
//    * Returns the {@code Datapoint}'s value.
//    * @return the {@code Datapoint}'s value
//    */
//   public double getValue() {
//     return value;
//   }
// 
//   /**
//    * Sets the time of the {@code Datapoint}.
//    * @param microseconds the new time in microseconds
//    */
//   public void setTime(long microseconds) {
//     time = microseconds;
//   }
// 
//   /**
//    * Sets the value of the {@code Datapoint}.
//    * @param value the new value
//    */
//   public void setValue(double value) {
//     this.value = value;
//   }
// 
//   /** {@inheritDoc} */
//   @Override
//   public String toString() {
//     return MoreObjects.toStringHelper(this)
//                       .add("time", time)
//                       .add("value", value)
//                       .toString();
//   }
// }


// Path: ktsd/src/main/java/org/kududb/ts/ktsd/PutSeries.java
import com.fasterxml.jackson.databind.ObjectMapper;
import java.net.URI;
import java.util.SortedMap;
import java.util.concurrent.CountDownLatch;
import org.LatencyUtils.LatencyStats;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.kududb.ts.core.Datapoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

  private final String metric;
  private final SortedMap<String, String> tags;
  private final DatapointGenerator datapoints;
  private final LatencyStats stats;
  private final CloseableHttpClient client;
  private final ObjectMapper mapper;
  private final CountDownLatch latch;

  public PutSeries(URI url,
                   String metric,
                   SortedMap<String, String> tags,
                   DatapointGenerator datapoints,
                   LatencyStats stats,
                   CloseableHttpClient client,
                   ObjectMapper mapper,
                   CountDownLatch latch) {
    this.url = url;
    this.metric = metric;
    this.tags = tags;
    this.datapoints = datapoints;
    this.stats = stats;
    this.client = client;
    this.mapper = mapper;
    this.latch = latch;
  }

  @Override
  public void run() {
    try {
      while (datapoints.hasNext()) {
        Datapoint dp = datapoints.next();