public static ByteBuffer serializeForSSTable(ColumnFamily cf) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); DeletionInfo.serializer().serializeForSSTable(cf.deletionInfo(), dos); dos.writeInt(cf.getColumnCount()); new ColumnIndex.Builder(cf, ByteBufferUtil.EMPTY_BYTE_BUFFER, dos).build(cf); return ByteBuffer.wrap(baos.toByteArray()); } catch (IOException e) { throw new RuntimeException(e); } }
public static ColumnFamily cloneAndRemoveDeleted(ColumnFamily cf, int gcBefore) { return ColumnFamilyStore.removeDeleted(cf.cloneMe(), gcBefore); }
public static SuperColumn superColumn(ColumnFamily cf, String name, Column... columns) { SuperColumn sc = new SuperColumn(ByteBufferUtil.bytes(name), cf.metadata().comparator); for (Column c : columns) sc.addColumn(c); return sc; }