use of org.apache.cassandra.io.sstable.format.RangeAwareSSTableWriter in project cassandra by apache.
the class StreamReader method createWriter.
protected SSTableMultiWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, UUID pendingRepair, SSTableFormat.Type format) throws IOException {
Directories.DataDirectory localDir = cfs.getDirectories().getWriteableLocation(totalSize);
if (localDir == null)
throw new IOException(String.format("Insufficient disk space to store %s", FBUtilities.prettyPrintMemory(totalSize)));
RangeAwareSSTableWriter writer = new RangeAwareSSTableWriter(cfs, estimatedKeys, repairedAt, pendingRepair, format, sstableLevel, totalSize, session.getTransaction(tableId), getHeader(cfs.metadata()));
StreamHook.instance.reportIncomingFile(cfs, writer, session, fileSeqNum);
return writer;
}
use of org.apache.cassandra.io.sstable.format.RangeAwareSSTableWriter in project cassandra by apache.
the class SSTableTxnWriter method createRangeAware.
// log and writer closed during doPostCleanup
@SuppressWarnings("resource")
public static SSTableTxnWriter createRangeAware(TableMetadataRef metadata, long keyCount, long repairedAt, UUID pendingRepair, SSTableFormat.Type type, int sstableLevel, SerializationHeader header) {
ColumnFamilyStore cfs = Keyspace.open(metadata.keyspace).getColumnFamilyStore(metadata.name);
LifecycleTransaction txn = LifecycleTransaction.offline(OperationType.WRITE);
SSTableMultiWriter writer;
try {
writer = new RangeAwareSSTableWriter(cfs, keyCount, repairedAt, pendingRepair, type, sstableLevel, 0, txn, header);
} catch (IOException e) {
//as we send in 0
throw new RuntimeException(e);
}
return new SSTableTxnWriter(txn, writer);
}
Aggregations