Search in sources :

Example 1 with RangeAwareSSTableWriter

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;
}
Also used : RangeAwareSSTableWriter(org.apache.cassandra.io.sstable.format.RangeAwareSSTableWriter)

Example 2 with RangeAwareSSTableWriter

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);
}
Also used : RangeAwareSSTableWriter(org.apache.cassandra.io.sstable.format.RangeAwareSSTableWriter) ColumnFamilyStore(org.apache.cassandra.db.ColumnFamilyStore) LifecycleTransaction(org.apache.cassandra.db.lifecycle.LifecycleTransaction) IOException(java.io.IOException)

Aggregations

RangeAwareSSTableWriter (org.apache.cassandra.io.sstable.format.RangeAwareSSTableWriter)2 IOException (java.io.IOException)1 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)1 LifecycleTransaction (org.apache.cassandra.db.lifecycle.LifecycleTransaction)1