try (ICompactionScanner scanner = s.getScanner();
CompactionController controller = new CompactionController(cfs, compacting, 0))
{
while(scanner.hasNext())
{
rewriter.append(new LazilyCompactedRow(controller, Arrays.asList(scanner.next())));
if (rewriter.currentWriter().getOnDiskFilePointer() > 2500000)
{
assertEquals(1, cfs.getSSTables().size()); // we dont open small files early ...
assertEquals(origFirst, cfs.getSSTables().iterator().next().first); // ... and the first key should stay the same
rewriter.switchWriter(getWriter(cfs, s.descriptor.directory));