Collection<PendingFile> pendingFiles = Lists.newArrayList();
for (SSTableReader sstable : loader.openSSTables())
{
Descriptor desc = sstable.descriptor;
List<Pair<Long, Long>> sections = Lists.newArrayList(Pair.create(0L, sstable.onDiskLength()));
PendingFile pending = new PendingFile(sstable, desc, SSTable.COMPONENT_DATA, sections, OperationType.BULK_LOAD);
StreamHeader header = new StreamHeader(directory.getName(), UUID.randomUUID(), pending, Collections.singleton(pending));
logger.info("Streaming to {}", InetAddress.getLocalHost());
new FileStreamTask(header, InetAddress.getLocalHost()).run();
logger.info("Done Streaming: " + pending.toString());
sstable.releaseReference();
pendingFiles.add(pending);
}
return pendingFiles;
}