def _write_to_cdc_write_failure(session, insert_stmt):
    prepared = session.prepare(insert_stmt)
    (start, rows_loaded, error_found) = (time.time(), 0, False)
    rate_limited_debug = get_rate_limited_function(logger.debug, 5)
    while (not error_found):
        assert ((time.time() - start) <= 600), "It's taken more than 10 minutes to reach a WriteFailure trying to overrun the space designated for CDC commitlogs. This could be because data isn't being written quickly enough in this environment, or because C* is failing to reject writes when it should."
        rate_limited_debug('  data load step has lasted {s:.2f}s, loaded {r} rows'.format(s=(time.time() - start), r=rows_loaded))
        batch_results = list(execute_concurrent(session, ((prepared, ()) for _ in range(1000)), concurrency=500, raise_on_first_error=False))
        rows_loaded += len([br for br in batch_results if br[0]])
        assert ([] == [result for (success, result) in batch_results if ((not success) and (not isinstance(result, WriteFailure)))])
        if any((isinstance(result, WriteFailure) for (_, result) in batch_results)):
            logger.debug("write failed (presumably because we've overrun designated CDC commitlog space) after loading {r} rows in {s:.2f}s".format(r=rows_loaded, s=(time.time() - start)))
            error_found = True
    return rows_loaded
def _write_to_cdc_write_failure(session, insert_stmt):
    prepared = session.prepare(insert_stmt)
    (start, rows_loaded, error_found) = (time.time(), 0, False)
    rate_limited_debug = get_rate_limited_function(logger.debug, 5)
    while (not error_found):
        assert ((time.time() - start) <= 600), "It's taken more than 10 minutes to reach a WriteFailure trying to overrun the space designated for CDC commitlogs. This could be because data isn't being written quickly enough in this environment, or because C* is failing to reject writes when it should."
        rate_limited_debug('  data load step has lasted {s:.2f}s, loaded {r} rows'.format(s=(time.time() - start), r=rows_loaded))
        batch_results = list(execute_concurrent(session, ((prepared, ()) for _ in range(1000)), concurrency=500, raise_on_first_error=False))
        rows_loaded += len([br for br in batch_results if br[0]])
        assert ([] == [result for (success, result) in batch_results if ((not success) and (not isinstance(result, WriteFailure)))])
        if any((isinstance(result, WriteFailure) for (_, result) in batch_results)):
            logger.debug("write failed (presumably because we've overrun designated CDC commitlog space) after loading {r} rows in {s:.2f}s".format(r=rows_loaded, s=(time.time() - start)))
            error_found = True
    return rows_loaded