RowIndexEntry.Serializer.skip(in, descriptor.version);
public static void skip(DataInput in) throws IOException { in.readLong(); skipPromotedIndex(in); }
public Future<Pair<KeyCacheKey, RowIndexEntry>> deserialize(DataInputPlus input, ColumnFamilyStore cfs) throws IOException { //Keyspace and CF name are deserialized by AutoSaving cache and used to fetch the CFS provided as a //parameter so they aren't deserialized here, even though they are serialized by this serializer int keyLength = input.readInt(); if (keyLength > FBUtilities.MAX_UNSIGNED_SHORT) { throw new IOException(String.format("Corrupted key cache. Key length of %d is longer than maximum of %d", keyLength, FBUtilities.MAX_UNSIGNED_SHORT)); } ByteBuffer key = ByteBufferUtil.read(input, keyLength); int generation = input.readInt(); input.readBoolean(); // backwards compatibility for "promoted indexes" boolean SSTableReader reader; if (cfs == null || !cfs.isKeyCacheEnabled() || (reader = findDesc(generation, cfs.getSSTables(SSTableSet.CANONICAL))) == null) { // The sstable doesn't exist anymore, so we can't be sure of the exact version and assume its the current version. The only case where we'll be // wrong is during upgrade, in which case we fail at deserialization. This is not a huge deal however since 1) this is unlikely enough that // this won't affect many users (if any) and only once, 2) this doesn't prevent the node from starting and 3) CASSANDRA-10219 shows that this // part of the code has been broken for a while without anyone noticing (it is, btw, still broken until CASSANDRA-10219 is fixed). RowIndexEntry.Serializer.skipForCache(input, BigFormat.instance.getLatestVersion()); return null; } RowIndexEntry.IndexSerializer<?> indexSerializer = reader.descriptor.getFormat().getIndexSerializer(reader.metadata, reader.descriptor.version, reader.header); RowIndexEntry<?> entry = indexSerializer.deserializeForCache(input); return Futures.immediateFuture(Pair.create(new KeyCacheKey(cfs.metadata.ksAndCFName, reader.descriptor, key), entry)); }
RowIndexEntry.Serializer.skip(in, descriptor.version);
RowIndexEntry.Serializer.skip(in, descriptor.version);
RowIndexEntry indexEntry = metadata.comparator.rowIndexEntrySerializer().deserialize(in, descriptor.version); if (exactMatch && updateCacheAndStats) RowIndexEntry.Serializer.skip(in);
RowIndexEntry.Serializer.skip(in, descriptor.version);
return true; RowIndexEntry.Serializer.skip(in); i++;
RowIndexEntry.Serializer.skip(primaryIndex, descriptor.version); DecoratedKey decoratedKey = decorateKey(key); if (first == null)
RowIndexEntry.Serializer.skip(primaryIndex, descriptor.version); DecoratedKey decoratedKey = decorateKey(key); if (first == null)
RowIndexEntry.Serializer.skip(primaryIndex, descriptor.version); DecoratedKey decoratedKey = decorateKey(key); if (first == null)
RowIndexEntry.Serializer.skip(primaryIndex, descriptor.version); DecoratedKey decoratedKey = decorateKey(key); if (first == null)
return indexDecoratedKey; RowIndexEntry.Serializer.skip(in);
/** * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists. */ public DecoratedKey firstKeyBeyond(PartitionPosition token) { if (token.compareTo(first) < 0) return first; long sampledPosition = getIndexScanPosition(token); if (ifile == null) return null; String path = null; try (FileDataInput in = ifile.createReader(sampledPosition)) { path = in.getPath(); while (!in.isEOF()) { ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in); DecoratedKey indexDecoratedKey = decorateKey(indexKey); if (indexDecoratedKey.compareTo(token) > 0) return indexDecoratedKey; RowIndexEntry.Serializer.skip(in, descriptor.version); } } catch (IOException e) { markSuspect(); throw new CorruptSSTableException(e, path); } return null; }
/** * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists. */ public DecoratedKey firstKeyBeyond(PartitionPosition token) { if (token.compareTo(first) < 0) return first; long sampledPosition = getIndexScanPosition(token); if (ifile == null) return null; String path = null; try (FileDataInput in = ifile.createReader(sampledPosition)) { path = in.getPath(); while (!in.isEOF()) { ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in); DecoratedKey indexDecoratedKey = decorateKey(indexKey); if (indexDecoratedKey.compareTo(token) > 0) return indexDecoratedKey; RowIndexEntry.Serializer.skip(in, descriptor.version); } } catch (IOException e) { markSuspect(); throw new CorruptSSTableException(e, path); } return null; }
private void seekToCurrentRangeStart() { long indexPosition = sstable.getIndexScanPosition(currentRange.left); ifile.seek(indexPosition); try { while (!ifile.isEOF()) { indexPosition = ifile.getFilePointer(); DecoratedKey indexDecoratedKey = sstable.decorateKey(ByteBufferUtil.readWithShortLength(ifile)); if (indexDecoratedKey.compareTo(currentRange.left) > 0 || currentRange.contains(indexDecoratedKey)) { // Found, just read the dataPosition and seek into index and data files long dataPosition = RowIndexEntry.Serializer.readPosition(ifile, sstable.descriptor.version); ifile.seek(indexPosition); dfile.seek(dataPosition); break; } else { RowIndexEntry.Serializer.skip(ifile, sstable.descriptor.version); } } } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }
deletionInfoSerializer = new DeletionInfo.Serializer(this); rangeTombstoneSerializer = new RangeTombstone.Serializer(this); rowIndexEntrySerializer = new RowIndexEntry.Serializer(this); this.isByteOrderComparable = isByteOrderComparable;
/** * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists. */ public DecoratedKey firstKeyBeyond(PartitionPosition token) { if (token.compareTo(first) < 0) return first; long sampledPosition = getIndexScanPosition(token); if (ifile == null) return null; String path = null; try (FileDataInput in = ifile.createReader(sampledPosition)) { path = in.getPath(); while (!in.isEOF()) { ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in); DecoratedKey indexDecoratedKey = decorateKey(indexKey); if (indexDecoratedKey.compareTo(token) > 0) return indexDecoratedKey; RowIndexEntry.Serializer.skip(in, descriptor.version); } } catch (IOException e) { markSuspect(); throw new CorruptSSTableException(e, path); } return null; }
/** * Finds and returns the first key beyond a given token in this SSTable or null if no such key exists. */ public DecoratedKey firstKeyBeyond(PartitionPosition token) { if (token.compareTo(first) < 0) return first; long sampledPosition = getIndexScanPosition(token); if (ifile == null) return null; String path = null; try (FileDataInput in = ifile.createReader(sampledPosition)) { path = in.getPath(); while (!in.isEOF()) { ByteBuffer indexKey = ByteBufferUtil.readWithShortLength(in); DecoratedKey indexDecoratedKey = decorateKey(indexKey); if (indexDecoratedKey.compareTo(token) > 0) return indexDecoratedKey; RowIndexEntry.Serializer.skip(in, descriptor.version); } } catch (IOException e) { markSuspect(); throw new CorruptSSTableException(e, path); } return null; }
private void seekToCurrentRangeStart() { long indexPosition = sstable.getIndexScanPosition(currentRange.left); ifile.seek(indexPosition); try { while (!ifile.isEOF()) { indexPosition = ifile.getFilePointer(); DecoratedKey indexDecoratedKey = sstable.partitioner.decorateKey(ByteBufferUtil.readWithShortLength(ifile)); if (indexDecoratedKey.compareTo(currentRange.left) > 0 || currentRange.contains(indexDecoratedKey)) { // Found, just read the dataPosition and seek into index and data files long dataPosition = ifile.readLong(); ifile.seek(indexPosition); dfile.seek(dataPosition); break; } else { RowIndexEntry.Serializer.skip(ifile); } } } catch (IOException e) { sstable.markSuspect(); throw new CorruptSSTableException(e, sstable.getFilename()); } }