public Unfiltered readNext() throws IOException { isReady = false; if (UnfilteredSerializer.kind(nextFlags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) { ClusteringBoundOrBoundary bound = clusteringDeserializer.deserializeNextBound(); return UnfilteredSerializer.serializer.deserializeMarkerBody(in, header, bound); } else { builder.newRow(clusteringDeserializer.deserializeNextClustering()); return UnfilteredSerializer.serializer.deserializeRowBody(in, header, helper, nextFlags, nextExtendedFlags, builder); } }
public Row readStaticRow() throws IOException { return header.hasStatic() ? UnfilteredSerializer.serializer.deserializeStaticRow(in, header, helper) : Rows.EMPTY_STATIC_ROW; }
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 skipNext() throws IOException { isReady = false; clusteringDeserializer.skipNext(); if (UnfilteredSerializer.kind(nextFlags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) { UnfilteredSerializer.serializer.skipMarkerBody(in); } else { UnfilteredSerializer.serializer.skipRowBody(in); } }
public Row deserializeStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : flags; int extendedFlags = in.readUnsignedByte(); Row.Builder builder = BTreeRow.sortedBuilder(); builder.newRow(Clustering.STATIC_CLUSTERING); return deserializeRowBody(in, header, helper, flags, extendedFlags, builder); }
if (isEndOfPartition(flags)) return null; int extendedFlags = readExtendedFlags(in, flags); if (kind(flags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) return deserializeMarkerBody(in, header, bound); if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags); return deserializeRowBody(in, header, helper, flags, extendedFlags, builder);
if (isEndOfPartition(flags)) return null; int extendedFlags = readExtendedFlags(in, flags); if (kind(flags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) return deserializeMarkerBody(in, header, bound); assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0) skipRowBody(in);
boolean isStatic = isStatic(extendedFlags); boolean hasTimestamp = (flags & HAS_TIMESTAMP) != 0; boolean hasTTL = (flags & HAS_TTL) != 0; readSimpleColumn(column, in, header, helper, builder, livenessInfo); else readComplexColumn(column, in, header, helper, hasComplexDeletion, builder, livenessInfo);
private long serializedSize(Row row, SerializationHeader header, long previousUnfilteredSize, int version) { long size = 1; // flags if (hasExtendedFlags(row)) size += 1; // extended flags if (!row.isStatic()) size += Clustering.serializer.serializedSize(row.clustering(), version, header.clusteringTypes()); return size + serializedRowBodySize(row, header, previousUnfilteredSize, version); }
private void prepareNext() throws IOException { if (isDone) return; nextFlags = in.readUnsignedByte(); if (UnfilteredSerializer.isEndOfPartition(nextFlags)) { isDone = true; isReady = false; return; } nextExtendedFlags = UnfilteredSerializer.readExtendedFlags(in, nextFlags); clusteringDeserializer.prepare(nextFlags, nextExtendedFlags); isReady = true; }
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]; }
UnfilteredSerializer.serializer.skipStaticRow(file, sstable.header, helper); return Rows.EMPTY_STATIC_ROW; return UnfilteredSerializer.serializer.deserializeStaticRow(file, sstable.header, helper);
boolean hasComplexDeletion = row.hasComplexDeletion(); boolean hasAllColumns = (row.size() == headerColumns.size()); boolean hasExtendedFlags = hasExtendedFlags(row); serializeRowBody(row, flags, header, dob); serializeRowBody(row, flags, header, out);
protected Unfiltered computeNext() { try { Unfiltered unfiltered = UnfilteredSerializer.serializer.deserialize(in, sHeader, helper, builder); return unfiltered == null ? endOfData() : unfiltered; } catch (IOException e) { throw new IOError(e); } } };
public boolean nextIsRow() throws IOException { if (!isReady) prepareNext(); return UnfilteredSerializer.kind(nextFlags) == Unfiltered.Kind.ROW; }
public static int readExtendedFlags(DataInputPlus in, int flags) throws IOException { return isExtended(flags) ? in.readUnsignedByte() : 0; }
protected Unfiltered computeNext() { try { Unfiltered unfiltered = UnfilteredSerializer.serializer.deserializeTombstonesOnly((FileDataInput) in, header, helper); return unfiltered == null ? endOfData() : unfiltered; } catch (IOException e) { throw new IOError(e); } } }
if (isEndOfPartition(flags)) return null; int extendedFlags = readExtendedFlags(in, flags); if (kind(flags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) return deserializeMarkerBody(in, header, bound); if (isStatic(extendedFlags)) throw new IOException("Corrupt flags value for unfiltered partition (isStatic flag set): " + flags); return deserializeRowBody(in, header, helper, flags, extendedFlags, builder);
if (isEndOfPartition(flags)) return null; int extendedFlags = readExtendedFlags(in, flags); if (kind(flags) == Unfiltered.Kind.RANGE_TOMBSTONE_MARKER) return deserializeMarkerBody(in, header, bound); assert !isStatic(extendedFlags); // deserializeStaticRow should be used for that. if ((flags & HAS_DELETION) != 0) skipRowBody(in);
public Row deserializeStaticRow(DataInputPlus in, SerializationHeader header, SerializationHelper helper) throws IOException { int flags = in.readUnsignedByte(); assert !isEndOfPartition(flags) && kind(flags) == Unfiltered.Kind.ROW && isExtended(flags) : flags; int extendedFlags = in.readUnsignedByte(); Row.Builder builder = BTreeRow.sortedBuilder(); builder.newRow(Clustering.STATIC_CLUSTERING); return deserializeRowBody(in, header, helper, flags, extendedFlags, builder); }