Tabnine Logo
RowIndexEntry$Serializer.skipForCache
Code IndexAdd Tabnine to your IDE (free)

How to use
skipForCache
method
in
org.apache.cassandra.db.RowIndexEntry$Serializer

Best Java code snippets using org.apache.cassandra.db.RowIndexEntry$Serializer.skipForCache (Showing top 3 results out of 315)

origin: com.strapdata.cassandra/cassandra-all

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));
}
origin: org.apache.cassandra/cassandra-all

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));
}
origin: jsevellec/cassandra-unit

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));
}
org.apache.cassandra.dbRowIndexEntry$SerializerskipForCache

Popular methods of RowIndexEntry$Serializer

  • <init>
  • skip
  • skipPromotedIndex
  • readPosition
    Reads only the data 'position' of the index entry and returns it. Note that this left 'in' in the mi
  • serializeOffsets
  • deserialize
  • serialize

Popular in Java

  • Making http post requests using okhttp
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now