public void prepare(int flags, int extendedFlags) throws IOException { if (UnfilteredSerializer.isStatic(extendedFlags)) throw new IOException("Corrupt flags value for clustering prefix (isStatic flag set): " + flags); this.nextIsRow = UnfilteredSerializer.kind(flags) == Unfiltered.Kind.ROW; this.nextKind = nextIsRow ? Kind.CLUSTERING : ClusteringPrefix.Kind.values()[in.readByte()]; this.nextSize = nextIsRow ? comparator.size() : in.readUnsignedShort(); this.deserializedSize = 0; // The point of the deserializer is that some of the clustering prefix won't actually be used (because they are not // within the bounds of the query), and we want to reduce allocation for them. So we only reuse the values array // between elements if 1) we haven't returned the previous element (if we have, nextValues will be null) and 2) // nextValues is of the proper size. Note that the 2nd condition may not hold for range tombstone bounds, but all // rows have a fixed size clustering, so we'll still save in the common case. if (nextValues == null || nextValues.length != nextSize) this.nextValues = new ByteBuffer[nextSize]; }
public void prepare(int flags, int extendedFlags) throws IOException { if (UnfilteredSerializer.isStatic(extendedFlags)) throw new IOException("Corrupt flags value for clustering prefix (isStatic flag set): " + flags); this.nextIsRow = UnfilteredSerializer.kind(flags) == Unfiltered.Kind.ROW; this.nextKind = nextIsRow ? Kind.CLUSTERING : ClusteringPrefix.Kind.values()[in.readByte()]; this.nextSize = nextIsRow ? comparator.size() : in.readUnsignedShort(); this.deserializedSize = 0; // The point of the deserializer is that some of the clustering prefix won't actually be used (because they are not // within the bounds of the query), and we want to reduce allocation for them. So we only reuse the values array // between elements if 1) we haven't returned the previous element (if we have, nextValues will be null) and 2) // nextValues is of the proper size. Note that the 2nd condition may not hold for range tombstone bounds, but all // rows have a fixed size clustering, so we'll still save in the common case. if (nextValues == null || nextValues.length != nextSize) this.nextValues = new ByteBuffer[nextSize]; }
public void prepare(int flags, int extendedFlags) throws IOException { if (UnfilteredSerializer.isStatic(extendedFlags)) throw new IOException("Corrupt flags value for clustering prefix (isStatic flag set): " + flags); this.nextIsRow = UnfilteredSerializer.kind(flags) == Unfiltered.Kind.ROW; this.nextKind = nextIsRow ? Kind.CLUSTERING : ClusteringPrefix.Kind.values()[in.readByte()]; this.nextSize = nextIsRow ? comparator.size() : in.readUnsignedShort(); this.deserializedSize = 0; // The point of the deserializer is that some of the clustering prefix won't actually be used (because they are not // within the bounds of the query), and we want to reduce allocation for them. So we only reuse the values array // between elements if 1) we haven't returned the previous element (if we have, nextValues will be null) and 2) // nextValues is of the proper size. Note that the 2nd condition may not hold for range tombstone bounds, but all // rows have a fixed size clustering, so we'll still save in the common case. if (nextValues == null || nextValues.length != nextSize) this.nextValues = new ByteBuffer[nextSize]; }
public void prepare(int flags, int extendedFlags) throws IOException { if (UnfilteredSerializer.isStatic(extendedFlags)) throw new IOException("Corrupt flags value for clustering prefix (isStatic flag set): " + flags); this.nextIsRow = UnfilteredSerializer.kind(flags) == Unfiltered.Kind.ROW; this.nextKind = nextIsRow ? Kind.CLUSTERING : ClusteringPrefix.Kind.values()[in.readByte()]; this.nextSize = nextIsRow ? comparator.size() : in.readUnsignedShort(); this.deserializedSize = 0; // The point of the deserializer is that some of the clustering prefix won't actually be used (because they are not // within the bounds of the query), and we want to reduce allocation for them. So we only reuse the values array // between elements if 1) we haven't returned the previous element (if we have, nextValues will be null) and 2) // nextValues is of the proper size. Note that the 2nd condition may not hold for range tombstone bounds, but all // rows have a fixed size clustering, so we'll still save in the common case. if (nextValues == null || nextValues.length != nextSize) this.nextValues = new ByteBuffer[nextSize]; }
public void skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : "Flags is " + flags; int extendedFlags = in.readUnsignedByte(); assert isStatic(extendedFlags); skipRowBody(in); }
public void skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : "Flags is " + flags; int extendedFlags = in.readUnsignedByte(); assert isStatic(extendedFlags); skipRowBody(in); }
public void skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : "Flags is " + flags; int extendedFlags = in.readUnsignedByte(); assert isStatic(extendedFlags); skipRowBody(in); }
public void skipStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : "Flags is " + flags; int extendedFlags = in.readUnsignedByte(); assert isStatic(extendedFlags); skipRowBody(in); }
public Unfiltered deserialize(DataInputPlus in, SerializationHeader header, SerializationHelper helper, Row.Builder builder) throws IOException { // It wouldn't be wrong per-se to use an unsorted builder, but it would be inefficient so make sure we don't do it by mistake assert builder.isSorted(); int flags = in.readUnsignedByte(); if (isEndOfPartition(flags)) return null; int extendedFlags = readExtendedFlags(in, flags); if (kind(flags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) { ClusteringBoundOrBoundary bound = ClusteringBoundOrBoundary.serializer.deserialize(in, helper.version, header.clusteringTypes()); return deserializeMarkerBody(in, header, bound); } else { // deserializeStaticRow should be used for that. if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags); builder.newRow(Clustering.serializer.deserialize(in, helper.version, header.clusteringTypes())); Row row = deserializeRowBody(in, header, helper, flags, extendedFlags, builder); // we do not write empty rows because Rows.collectStats(), called by BTW.applyToRow(), asserts that rows are not empty // if we don't throw here, then later the very same assertion in Rows.collectStats() will fail compactions // see BlackListingCompactionsTest and CASSANDRA-9530 for details if (row.isEmpty()) throw new IOException("Corrupt empty row found in unfiltered partition"); return row; } }
if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags);
if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags);
if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags);
boolean isStatic = isStatic(extendedFlags); boolean hasTimestamp = (flags & HAS_TIMESTAMP) != 0; boolean hasTTL = (flags & HAS_TTL) != 0;
boolean isStatic = isStatic(extendedFlags); boolean hasTimestamp = (flags & HAS_TIMESTAMP) != 0; boolean hasTTL = (flags & HAS_TTL) != 0;
boolean isStatic = isStatic(extendedFlags); boolean hasTimestamp = (flags & HAS_TIMESTAMP) != 0; boolean hasTTL = (flags & HAS_TTL) != 0;
boolean isStatic = isStatic(extendedFlags); boolean hasTimestamp = (flags & HAS_TIMESTAMP) != 0; boolean hasTTL = (flags & HAS_TTL) != 0;
assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0)
assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0)
assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0)
assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0)