本文整理汇总了Java中org.apache.cassandra.db.ColumnSerializer类的典型用法代码示例。如果您正苦于以下问题:Java ColumnSerializer类的具体用法?Java ColumnSerializer怎么用?Java ColumnSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnSerializer类属于org.apache.cassandra.db包,在下文中一共展示了ColumnSerializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public PrepareResponse deserialize(DataInput in, int version) throws IOException
{
boolean success = in.readBoolean();
ByteBuffer key = ByteBufferUtil.readWithShortLength(in);
return new PrepareResponse(success,
new Commit(key,
UUIDSerializer.serializer.deserialize(in, version),
ColumnFamily.serializer.deserialize(in,
ArrayBackedSortedColumns.factory,
ColumnSerializer.Flag.LOCAL, version)),
new Commit(key,
UUIDSerializer.serializer.deserialize(in, version),
ColumnFamily.serializer.deserialize(in,
ArrayBackedSortedColumns.factory,
ColumnSerializer.Flag.LOCAL, version)));
}
示例2: readFields
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
@Override
public void readFields(DataInput dis) throws IOException {
int length = dis.readInt();
byte[] bytes = new byte[length];
dis.readFully(bytes);
this.key = bytes;
this.deletedAt = dis.readLong();
boolean hasAtom = dis.readBoolean();
if (hasAtom) {
this.atom = serializer.deserializeFromSSTable(
dis, ColumnSerializer.Flag.PRESERVE_SIZE, Integer.MIN_VALUE, version
);
} else {
this.atom = null;
}
}
示例3: deserialize
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public PrepareResponse deserialize(DataInput in, int version) throws IOException
{
boolean success = in.readBoolean();
ByteBuffer key = ByteBufferUtil.readWithShortLength(in);
return new PrepareResponse(success,
new Commit(key,
UUIDSerializer.serializer.deserialize(in, version),
ColumnFamily.serializer.deserialize(in, UnsortedColumns.factory, ColumnSerializer.Flag.LOCAL, version)),
new Commit(key,
UUIDSerializer.serializer.deserialize(in, version),
ColumnFamily.serializer.deserialize(in, UnsortedColumns.factory, ColumnSerializer.Flag.LOCAL, version)));
}
示例4: ColumnSortedMap
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnSortedMap(Comparator<ByteBuffer> comparator, ColumnSerializer serializer, DataInput dis, int length, IColumnSerializer.Flag flag, int expireBefore)
{
this.comparator = comparator;
this.serializer = serializer;
this.dis = dis;
this.length = length;
this.flag = flag;
this.expireBefore = expireBefore;
}
示例5: ColumnSet
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnSet(ColumnSerializer serializer, DataInput dis, int length, IColumnSerializer.Flag flag, int expireBefore)
{
this.serializer = serializer;
this.dis = dis;
this.length = length;
this.flag = flag;
this.expireBefore = expireBefore;
}
示例6: ColumnIterator
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnIterator(ColumnSerializer serializer, DataInput dis, int length, IColumnSerializer.Flag flag, int expireBefore)
{
this.dis = dis;
this.serializer = serializer;
this.length = length;
this.flag = flag;
this.expireBefore = expireBefore;
}
示例7: deserializeColumns
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
long deserializeColumns(Subscriber<? super AtomWritable> subscriber, byte[] rowKey, long deletedAt,
int count,
DataInput columns) throws IOException {
long columnSize = 0;
int actualColumnCount = 0;
for (int i = 0; i < count; i++, actualColumnCount++) {
// serialize columns
OnDiskAtom atom = serializer.deserializeFromSSTable(
columns, ColumnSerializer.Flag.PRESERVE_SIZE, Integer.MIN_VALUE, version
);
if (atom == null) {
// If atom was null that means this was a version that does not have version.hasRowSizeAndColumnCount
// So we have to add the size for the end of row marker also
columnSize += 2;
break;
}
columnSize += atom.serializedSizeForSSTable();
subscriber.onNext(AtomWritable.createWritable(rowKey, deletedAt, atom));
}
// This is a row with no columns, we still create a writable because we want to preserve this information
if (actualColumnCount == 0) {
subscriber.onNext(AtomWritable.createWritable(rowKey, deletedAt, null));
}
return columnSize;
}
示例8: readFields
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
deletedAt = in.readLong();
int columnCount = in.readInt();
columns = Lists.newArrayListWithCapacity(columnCount);
for (int i = 0; i < columnCount; i++) {
OnDiskAtom atom = serializer.deserializeFromSSTable(
in, ColumnSerializer.Flag.PRESERVE_SIZE, Integer.MIN_VALUE, version
);
columns.add(atom);
}
}
示例9: ColumnSortedMap
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnSortedMap(Comparator<ByteBuffer> comparator, ColumnSerializer serializer, DataInput dis, ColumnFamilyStore interner, int length, boolean fromRemote, int expireBefore)
{
this.comparator = comparator;
this.serializer = serializer;
this.interner = interner;
this.dis = dis;
this.length = length;
this.fromRemote = fromRemote;
this.expireBefore = expireBefore;
}
示例10: ColumnSet
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnSet(ColumnSerializer serializer, DataInput dis, ColumnFamilyStore interner, int length, boolean fromRemote, int expireBefore)
{
this.serializer = serializer;
this.dis = dis;
this.interner = interner;
this.length = length;
this.fromRemote = fromRemote;
this.expireBefore = expireBefore;
}
示例11: ColumnIterator
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnIterator(ColumnSerializer serializer, DataInput dis, ColumnFamilyStore interner, int length, boolean fromRemote, int expireBefore)
{
this.dis = dis;
this.serializer = serializer;
this.interner = interner;
this.length = length;
this.fromRemote = fromRemote;
this.expireBefore = expireBefore;
}
示例12: deserialize
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public Commit deserialize(DataInput in, int version) throws IOException
{
return new Commit(ByteBufferUtil.readWithShortLength(in),
UUIDSerializer.serializer.deserialize(in, version),
ColumnFamily.serializer.deserialize(in, UnsortedColumns.factory, ColumnSerializer.Flag.LOCAL, version));
}
示例13: getOnDiskIterator
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public Iterator<OnDiskAtom> getOnDiskIterator(DataInput in, Descriptor.Version version)
{
return getOnDiskIterator(in, ColumnSerializer.Flag.LOCAL, Integer.MIN_VALUE, version);
}
示例14: getOnDiskDeserializer
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public AtomDeserializer getOnDiskDeserializer(DataInput in, Descriptor.Version version)
{
return new AtomDeserializer(comparator, in, ColumnSerializer.Flag.LOCAL, Integer.MIN_VALUE, version);
}
示例15: columnSerializer
import org.apache.cassandra.db.ColumnSerializer; //导入依赖的package包/类
public ColumnSerializer columnSerializer();