public void eraseBrokerStorage(int brokerId,
                                   FilenameFilter filter,
                                   boolean isStopped) throws IOException {
        BrokerLocalStorage brokerLocalStorage;
        if (isStopped) {
            brokerLocalStorage = TieredStorageTestHarness.localStorages(harness.brokers())
                    .stream()
                    .filter(bls -> bls.getBrokerId() == brokerId)
                    .findFirst()
                    .orElseThrow(() -> new IllegalArgumentException("No local storage found for broker " + brokerId));
        } else {
            brokerLocalStorage = localStorages.get(brokerId);
        }
        brokerLocalStorage.eraseStorage(filter);
    }
Send the given records trying to honor the batch size. This is attempted
with a large producer linger and the use of an explicit flush every time
the number of a "group" of records reaches the batch size.
@param recordsToProduce the records to produce
@param batchSize the batch size
storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestContext.java