Tabnine Logo
RowIndexEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
RowIndexEntry
in
org.apache.cassandra.db

Best Java code snippets using org.apache.cassandra.db.RowIndexEntry (Showing top 20 results out of 315)

origin: com.facebook.presto.cassandra/cassandra-server

public static RowIndexEntry create(long position, DeletionTime deletionTime, ColumnIndex index)
{
  assert index != null;
  assert deletionTime != null;
  // we only consider the columns summary when determining whether to create an IndexedEntry,
  // since if there are insufficient columns to be worth indexing we're going to seek to
  // the beginning of the row anyway, so we might as well read the tombstone there as well.
  if (index.columnsIndex.size() > 1)
    return new IndexedEntry(position, deletionTime, index.columnsIndex);
  else
    return new RowIndexEntry(position);
}
origin: com.facebook.presto.cassandra/cassandra-server

public void serialize(RowIndexEntry rie, DataOutputPlus out) throws IOException
{
  out.writeLong(rie.position);
  out.writeInt(rie.promotedSize(type));
  if (rie.isIndexed())
  {
    DeletionTime.serializer.serialize(rie.deletionTime(), out);
    out.writeInt(rie.columnsIndex().size());
    ISerializer<IndexHelper.IndexInfo> idxSerializer = type.indexSerializer();
    for (IndexHelper.IndexInfo info : rie.columnsIndex())
      idxSerializer.serialize(info, out);
  }
}
origin: jsevellec/cassandra-unit

/**
 * @return true if this index entry contains the row-level tombstone and column summary.  Otherwise,
 * caller should fetch these from the row header.
 */
public boolean isIndexed()
{
  return columnsIndexCount() > 1;
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public IndexState(Reader reader, ClusteringComparator comparator, RowIndexEntry indexEntry, boolean reversed, FileHandle indexFile)
{
  this.reader = reader;
  this.comparator = comparator;
  this.indexEntry = indexEntry;
  this.indexInfoRetriever = indexEntry.openWithIndex(indexFile);
  this.reversed = reversed;
  this.currentIndexIdx = reversed ? indexEntry.columnsIndexCount() : -1;
}
origin: jsevellec/cassandra-unit

boolean needSeekAtPartitionStart = !indexEntry.isIndexed() || !columns.fetchedColumns().statics.isEmpty();
  this.partitionLevelDeletion = indexEntry.deletionTime();
  this.staticRow = Rows.EMPTY_STATIC_ROW;
  this.reader = needsReader ? createReader(indexEntry, file, shouldCloseFile) : null;
origin: jsevellec/cassandra-unit

if (rowIndexEntry == null || !rowIndexEntry.indexOnHeap())
  return null;
try (RowIndexEntry.IndexInfoRetriever onHeapRetriever = rowIndexEntry.openWithIndex(null))
  IndexInfo column = onHeapRetriever.columnsIndex(filter.isReversed() ? rowIndexEntry.columnsIndexCount() - 1 : 0);
  ClusteringPrefix lowerBoundPrefix = filter.isReversed() ? column.lastName : column.firstName;
  assert lowerBoundPrefix.getRawValues().length <= sstable.metadata.comparator.size() :
origin: com.facebook.presto.cassandra/cassandra-server

if (!indexEntry.isIndexed())
indexList = indexEntry.columnsIndex();
if (!indexEntry.isIndexed())
  cf.delete(indexEntry.deletionTime());
origin: jsevellec/cassandra-unit

protected Reader createReaderInternal(RowIndexEntry indexEntry, FileDataInput file, boolean shouldCloseFile)
{
  return indexEntry.isIndexed()
     ? new ForwardIndexedReader(indexEntry, file, shouldCloseFile)
     : new ForwardReader(file, shouldCloseFile);
}
origin: com.facebook.presto.cassandra/cassandra-server

public static RowIndexEntry rawAppend(ColumnFamily cf, long startPosition, DecoratedKey key, DataOutputPlus out) throws IOException
{
  assert cf.hasColumns() || cf.isMarkedForDelete();
  ColumnIndex.Builder builder = new ColumnIndex.Builder(cf, key.getKey(), out);
  ColumnIndex index = builder.build(cf);
  out.writeShort(END_OF_ROW);
  return RowIndexEntry.create(startPosition, cf.deletionInfo().getTopLevelDeletion(), index);
}
origin: org.apache.cassandra/cassandra-all

public void serializeForCache(RowIndexEntry<IndexInfo> rie, DataOutputPlus out) throws IOException
{
  assert version.storeRows();
  rie.serializeForCache(out);
}
origin: jsevellec/cassandra-unit

public void serialize(RowIndexEntry<IndexInfo> rie, DataOutputPlus out, ByteBuffer indexInfo) throws IOException
{
  assert version.storeRows() : "We read old index files but we should never write them";
  rie.serialize(out, idxInfoSerializer, indexInfo);
}
origin: com.facebook.presto.cassandra/cassandra-server

this.indexes = indexEntry.columnsIndex();
emptyColumnFamily = ArrayBackedSortedColumns.factory.create(sstable.metadata);
if (indexes.isEmpty())
  emptyColumnFamily.delete(indexEntry.deletionTime());
  fetcher = new IndexedBlockFetcher(indexEntry.position);
origin: org.apache.cassandra/cassandra-all

boolean needSeekAtPartitionStart = !indexEntry.isIndexed() || !columns.fetchedColumns().statics.isEmpty();
  this.partitionLevelDeletion = indexEntry.deletionTime();
  this.staticRow = Rows.EMPTY_STATIC_ROW;
  this.reader = needsReader ? createReader(indexEntry, file, shouldCloseFile) : null;
origin: org.apache.cassandra/cassandra-all

if (rowIndexEntry == null || !rowIndexEntry.indexOnHeap())
  return null;
try (RowIndexEntry.IndexInfoRetriever onHeapRetriever = rowIndexEntry.openWithIndex(null))
  IndexInfo column = onHeapRetriever.columnsIndex(filter.isReversed() ? rowIndexEntry.columnsIndexCount() - 1 : 0);
  ClusteringPrefix lowerBoundPrefix = filter.isReversed() ? column.lastName : column.firstName;
  assert lowerBoundPrefix.getRawValues().length <= sstable.metadata.comparator.size() :
origin: org.apache.cassandra/cassandra-all

public IndexState(Reader reader, ClusteringComparator comparator, RowIndexEntry indexEntry, boolean reversed, FileHandle indexFile)
{
  this.reader = reader;
  this.comparator = comparator;
  this.indexEntry = indexEntry;
  this.indexInfoRetriever = indexEntry.openWithIndex(indexFile);
  this.reversed = reversed;
  this.currentIndexIdx = reversed ? indexEntry.columnsIndexCount() : -1;
}
origin: org.apache.cassandra/cassandra-all

protected Reader createReaderInternal(RowIndexEntry indexEntry, FileDataInput file, boolean shouldCloseFile)
{
  return indexEntry.isIndexed()
     ? new ReverseIndexedReader(indexEntry, file, shouldCloseFile)
     : new ReverseReader(file, shouldCloseFile);
}
origin: com.facebook.presto.cassandra/cassandra-server

return RowIndexEntry.create(currentPosition, emptyColumnFamily.deletionInfo().getTopLevelDeletion(), columnsIndex);
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public void serializeForCache(RowIndexEntry<IndexInfo> rie, DataOutputPlus out) throws IOException
{
  assert version.storeRows();
  rie.serializeForCache(out);
}
origin: com.strapdata.cassandra/cassandra-all

public void serialize(RowIndexEntry<IndexInfo> rie, DataOutputPlus out, ByteBuffer indexInfo) throws IOException
{
  assert version.storeRows() : "We read old index files but we should never write them";
  rie.serialize(out, idxInfoSerializer, indexInfo);
}
origin: org.apache.cassandra/cassandra-all

/**
 * @return true if this index entry contains the row-level tombstone and column summary.  Otherwise,
 * caller should fetch these from the row header.
 */
public boolean isIndexed()
{
  return columnsIndexCount() > 1;
}
org.apache.cassandra.dbRowIndexEntry

Javadoc

Binary format of RowIndexEntry is defined as follows: (long) position (64 bit long, vint encoded)

See IndexInfo for a description of the serialized format.

For each partition, the layout of the index file looks like this:

  1. partition key - prefixed with short length
  2. serialized RowIndexEntry objects

Generally, we distinguish between index entries that have index samples (list of IndexInfo objects) and those who don't. For each portion of data for a single partition in the data file, an index sample is created. The size of that portion is defined by org.apache.cassandra.config.Config#column_index_size_in_kb.

Index entries with less than 2 index samples, will just store the position in the data file.

Note: legacy sstables for index entries are those sstable formats that do not have an offsets table to index samples ( IndexInfoobjects). These are those sstables created on Cassandra versions earlier than 3.0.

For index entries with index samples we store the index samples ( IndexInfo objects). The bigger the partition, the more index samples are created. Since a huge amount of index samples will "pollute" the heap and cause huge GC pressure, Cassandra 3.6 (CASSANDRA-11206) distinguishes between index entries with an "acceptable" amount of index samples per partition and those with an "enormous" amount of index samples. The barrier is controlled by the configuration parameter org.apache.cassandra.config.Config#column_index_cache_size_in_kb. Index entries with a total serialized size of index samples up to column_index_cache_size_in_kb will be held in an array. Index entries exceeding that value will always be accessed from disk.

This results in these classes:

  • RowIndexEntry just stores the offset in the data file.
  • IndexedEntry is for index entries with index samples and used for both current and legacy sstables, which do not exceed org.apache.cassandra.config.Config#column_index_cache_size_in_kb.
  • ShallowIndexedEntry is for index entries with index samples that exceed org.apache.cassandra.config.Config#column_index_cache_size_in_kbfor sstables with an offset table to the index samples.
  • LegacyShallowIndexedEntry is for index entries with index samples that exceed org.apache.cassandra.config.Config#column_index_cache_size_in_kbbut for legacy sstables.

Since access to index samples on disk (obviously) requires some file reader, that functionality is encapsulated in implementations of IndexInfoRetriever. There is an implementation to access index samples of legacy sstables (without the offsets table), an implementation of access sstables with an offsets table.

Until now (Cassandra 3.x), we still support reading from legacy sstables - i.e. sstables created by Cassandra < 3.0 (see org.apache.cassandra.io.sstable.format.big.BigFormat.

Most used methods

  • <init>
  • create
  • deletionTime
  • isIndexed
  • columnsIndexCount
  • openWithIndex
  • serialize
  • serializeForCache
  • indexOnHeap
  • columnsIndex
  • promotedSize
  • promotedSize

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JTextField (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Top plugins for WebStorm
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