use of com.datastax.oss.driver.api.core.cql.PreparedStatement in project zipkin by openzipkin.
the class InternalForTests method writeDependencyLinks.
static void writeDependencyLinks(CassandraStorage storage, List<DependencyLink> links, long midnightUTC) {
CqlSession session = storage.session();
PreparedStatement prepared = session.prepare("INSERT INTO " + Schema.TABLE_DEPENDENCY + " (day,parent,child,calls,errors)" + " VALUES (?,?,?,?,?)");
LocalDate day = Instant.ofEpochMilli(midnightUTC).atZone(ZoneOffset.UTC).toLocalDate();
for (DependencyLink link : links) {
int i = 0;
storage.session().execute(prepared.bind().setLocalDate(i++, day).setString(i++, link.parent()).setString(i++, link.child()).setLong(i++, link.callCount()).setLong(i, link.errorCount()));
}
}
Aggregations