/** * Deserialize the index into a structure and return it * * @param in input source * @param type the comparator type for the column family * * @return ArrayList<IndexInfo> - list of de-serialized indexes * @throws IOException if an I/O error occurs. */ public static List<IndexInfo> deserializeIndex(FileDataInput in, CType type) throws IOException { int columnIndexSize = in.readInt(); if (columnIndexSize == 0) return Collections.<IndexInfo>emptyList(); ArrayList<IndexInfo> indexList = new ArrayList<IndexInfo>(); FileMark mark = in.mark(); ISerializer<IndexInfo> serializer = type.indexSerializer(); while (in.bytesPastMark(mark) < columnIndexSize) { indexList.add(serializer.deserialize(in)); } assert in.bytesPastMark(mark) == columnIndexSize; return indexList; }
public void setToBlock(int blockIdx) throws IOException { if (blockIdx >= 0 && blockIdx < indexEntry.columnsIndexCount()) { reader.seekToPosition(columnOffset(blockIdx)); reader.deserializer.clearState(); } currentIndexIdx = blockIdx; reader.openMarker = blockIdx > 0 ? index(blockIdx - 1).endOpenMarker : null; mark = reader.file.mark(); }
FileMark mark = file.mark(); while (file.bytesPastMark(mark) < indexInfo.width && nextToFetch != null)
public void setToBlock(int blockIdx) throws IOException { if (blockIdx >= 0 && blockIdx < indexEntry.columnsIndexCount()) { reader.seekToPosition(columnOffset(blockIdx)); reader.deserializer.clearState(); } currentIndexIdx = blockIdx; reader.openMarker = blockIdx > 0 ? index(blockIdx - 1).endOpenMarker : null; mark = reader.file.mark(); // If we're reading an old format file and we move to the first block in the index (i.e. the // head of the partition), we skip the static row as it's already been read when we first opened // the iterator. If we don't do this and a static row is present, we'll re-read it but treat it // as a regular row, causing deserialization to blow up later as that row's flags will be invalid // see CASSANDRA-12088 & CASSANDRA-13236 if (!reader.version.storeRows() && blockIdx == 0 && reader.deserializer.hasNext() && reader.deserializer.nextIsStatic()) { reader.deserializer.skipNext(); } }
public void setToBlock(int blockIdx) throws IOException { if (blockIdx >= 0 && blockIdx < indexEntry.columnsIndexCount()) { reader.seekToPosition(columnOffset(blockIdx)); mark = reader.file.mark(); reader.deserializer.clearState(); } currentIndexIdx = blockIdx; reader.openMarker = blockIdx > 0 ? index(blockIdx - 1).endOpenMarker : null; // If we're reading an old format file and we move to the first block in the index (i.e. the // head of the partition), we skip the static row as it's already been read when we first opened // the iterator. If we don't do this and a static row is present, we'll re-read it but treat it // as a regular row, causing deserialization to blow up later as that row's flags will be invalid // see CASSANDRA-12088 & CASSANDRA-13236 if (!reader.version.storeRows() && blockIdx == 0 && reader.deserializer.hasNext() && reader.deserializer.nextIsStatic()) { reader.deserializer.skipNext(); } }
public void setToBlock(int blockIdx) throws IOException { if (blockIdx >= 0 && blockIdx < indexEntry.columnsIndexCount()) { reader.seekToPosition(columnOffset(blockIdx)); mark = reader.file.mark(); reader.deserializer.clearState(); } currentIndexIdx = blockIdx; reader.openMarker = blockIdx > 0 ? index(blockIdx - 1).endOpenMarker : null; // If we're reading an old format file and we move to the first block in the index (i.e. the // head of the partition), we skip the static row as it's already been read when we first opened // the iterator. If we don't do this and a static row is present, we'll re-read it but treat it // as a regular row, causing deserialization to blow up later as that row's flags will be invalid // see CASSANDRA-12088 & CASSANDRA-13236 if (!reader.version.storeRows() && blockIdx == 0 && reader.deserializer.hasNext() && reader.deserializer.nextIsStatic()) { reader.deserializer.skipNext(); } }
FileMark mark = file.mark();