/** * Close this writer. * <p> * This method should be called, otherwise the produced sstables are not * guaranteed to be complete (and won't be in practice). */ public void close() throws IOException { writer.close(); }
private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt) { int maxGen = getNextGeneration(directory, columnFamily); return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, fmt); }
PartitionUpdate getUpdateFor(ByteBuffer key) throws IOException { return getUpdateFor(metadata.decorateKey(key)); }
if (writer.shouldStartNewRow() || !key.equals(writer.currentKey().getKey())) writer.newRow(key); insert.addUpdateForKey(writer.currentColumnFamily(), key, clusteringPrefix, params, false);
protected SSTableTxnWriter createWriter() { SerializationHeader header = new SerializationHeader(true, metadata, columns, EncodingStats.NO_STATS); if (makeRangeAware) return SSTableTxnWriter.createRangeAware(metadata, 0, ActiveRepairService.UNREPAIRED_SSTABLE, formatType, 0, header); return SSTableTxnWriter.create(metadata, createDescriptor(directory, metadata.ksName, metadata.cfName, formatType), 0, ActiveRepairService.UNREPAIRED_SSTABLE, 0, header, Collections.emptySet()); }
writer.setSSTableFormatType(formatType);
@Override protected void addColumn(Cell cell) throws IOException { super.addColumn(cell); countColumn(cell); }
protected SSTableTxnWriter createWriter() { SerializationHeader header = new SerializationHeader(true, metadata, columns, EncodingStats.NO_STATS); if (makeRangeAware) return SSTableTxnWriter.createRangeAware(metadata, 0, ActiveRepairService.UNREPAIRED_SSTABLE, formatType, 0, header); return SSTableTxnWriter.create(metadata, createDescriptor(directory, metadata.ksName, metadata.cfName, formatType), 0, ActiveRepairService.UNREPAIRED_SSTABLE, 0, header, Collections.emptySet()); }
writer.setSSTableFormatType(formatType);
/** * Insert a new "regular" column to the current row (and super column if applicable). * @param name the column name * @param value the column value * @param timestamp the column timestamp */ public void addColumn(ByteBuffer name, ByteBuffer value, long timestamp) throws IOException { addColumn(new BufferCell(metadata.comparator.cellFromByteBuffer(name), value, timestamp)); }
/** * Close this writer. * <p> * This method should be called, otherwise the produced sstables are not * guaranteed to be complete (and won't be in practice). */ public void close() throws IOException { writer.close(); }
PartitionUpdate getUpdateFor(ByteBuffer key) throws IOException { return getUpdateFor(metadata.decorateKey(key)); }
private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt) { int maxGen = getNextGeneration(directory, columnFamily); return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, fmt); }
protected SSTableTxnWriter createWriter() { SerializationHeader header = new SerializationHeader(true, metadata, columns, EncodingStats.NO_STATS); if (makeRangeAware) return SSTableTxnWriter.createRangeAware(metadata, 0, ActiveRepairService.UNREPAIRED_SSTABLE, formatType, 0, header); return SSTableTxnWriter.create(metadata, createDescriptor(directory, metadata.ksName, metadata.cfName, formatType), 0, ActiveRepairService.UNREPAIRED_SSTABLE, 0, header, Collections.emptySet()); }
writer.setSSTableFormatType(formatType);
/** * Insert a new expiring column to the current row (and super column if applicable). * @param name the column name * @param value the column value * @param timestamp the column timestamp * @param ttl the column time to live in seconds * @param expirationTimestampMS the local expiration timestamp in milliseconds. This is the server time timestamp used for actually * expiring the column, and as a consequence should be synchronized with the cassandra servers time. If {@code timestamp} represents * the insertion time in microseconds (which is not required), this should be {@code (timestamp / 1000) + (ttl * 1000)}. */ public void addExpiringColumn(ByteBuffer name, ByteBuffer value, long timestamp, int ttl, long expirationTimestampMS) throws IOException { addColumn(new BufferExpiringCell(metadata.comparator.cellFromByteBuffer(name), value, timestamp, ttl, (int)(expirationTimestampMS / 1000))); }
/** * Close this writer. * <p> * This method should be called, otherwise the produced sstables are not * guaranteed to be complete (and won't be in practice). */ public void close() throws IOException { writer.close(); }
PartitionUpdate getUpdateFor(ByteBuffer key) throws IOException { return getUpdateFor(metadata.decorateKey(key)); }
private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt) { int maxGen = getNextGeneration(directory, columnFamily); return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, fmt); }
/** * Insert a new counter column to the current row (and super column if applicable). * @param name the column name * @param value the value of the counter */ public void addCounterColumn(ByteBuffer name, long value) throws IOException { addColumn(new BufferCounterCell(metadata.comparator.cellFromByteBuffer(name), CounterContext.instance().createGlobal(counterid, 1L, value), System.currentTimeMillis())); }