예제 #1
0
 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);
   }
 }
예제 #2
0
 public static ColumnFamily cloneAndRemoveDeleted(ColumnFamily cf, int gcBefore) {
   return ColumnFamilyStore.removeDeleted(cf.cloneMe(), gcBefore);
 }
예제 #3
0
 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;
 }