congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UnfilteredRowIterators
Code IndexAdd Tabnine to your IDE (free)

How to use
UnfilteredRowIterators
in
org.apache.cassandra.db.rows

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

origin: jsevellec/cassandra-unit

public static RowIterator toRowIterator(final CFMetaData metadata,
                    final DecoratedKey key,
                    final Iterator<LegacyCell> cells,
                    final int nowInSec)
{
  SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL);
  return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec);
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

/**
 * Merges the provided updates, yielding a new update that incorporates all those updates.
 *
 * @param updates the collection of updates to merge. This shouldn't be empty.
 *
 * @return a partition update that include (merge) all the updates from {@code updates}.
 */
public static PartitionUpdate merge(List<PartitionUpdate> updates)
{
  assert !updates.isEmpty();
  final int size = updates.size();
  if (size == 1)
    return Iterables.getOnlyElement(updates);
  int nowInSecs = FBUtilities.nowInSeconds();
  List<UnfilteredRowIterator> asIterators = Lists.transform(updates, AbstractBTreePartition::unfilteredIterator);
  return fromIterator(UnfilteredRowIterators.merge(asIterators, nowInSecs), ColumnFilter.all(updates.get(0).metadata()));
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public UnfilteredRowIterator iterator(FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry, Slices slices, ColumnFilter selectedColumns, boolean reversed, boolean isForThrift)
{
  if (indexEntry == null)
    return UnfilteredRowIterators.noRowsIterator(metadata, key, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, reversed);
  return new SSTableIterator(this, file, key, indexEntry, slices, selectedColumns, isForThrift, ifile);
}
origin: jsevellec/cassandra-unit

/**
 * Turns the given iterator into an update.
 *
 * @param iterator the iterator to turn into updates.
 * @param filter the column filter used when querying {@code iterator}. This is used to make
 * sure we don't include data for which the value has been skipped while reading (as we would
 * then be writing something incorrect).
 *
 * Warning: this method does not close the provided iterator, it is up to
 * the caller to close it.
 */
public static PartitionUpdate fromIterator(UnfilteredRowIterator iterator, ColumnFilter filter)
{
  iterator = UnfilteredRowIterators.withOnlyQueriedData(iterator, filter);
  Holder holder = build(iterator, 16);
  MutableDeletionInfo deletionInfo = (MutableDeletionInfo) holder.deletionInfo;
  return new PartitionUpdate(iterator.metadata(), iterator.partitionKey(), holder, deletionInfo, false);
}
origin: org.apache.cassandra/cassandra-all

/**
 * Digests the the provided iterator.
 *
 * @param command the command that has yield {@code iterator}. This can be null if {@code version >= MessagingService.VERSION_30}
 * as this is only used when producing digest to be sent to legacy nodes.
 * @param iterator the iterator to digest.
 * @param digest the {@code MessageDigest} to use for the digest.
 * @param version the messaging protocol to use when producing the digest.
 */
public static void digest(ReadCommand command, UnfilteredPartitionIterator iterator, MessageDigest digest, int version)
{
  try (UnfilteredPartitionIterator iter = iterator)
  {
    while (iter.hasNext())
    {
      try (UnfilteredRowIterator partition = iter.next())
      {
        UnfilteredRowIterators.digest(command, partition, digest, version);
      }
    }
  }
}
origin: jsevellec/cassandra-unit

  protected Unfiltered computeNext()
  {
    if (!iterator.hasNext())
      return endOfData();
    Unfiltered next = iterator.next();
    // If we detect that some rows are out of order we will store and sort the remaining ones to insert them
    // in a separate SSTable.
    if (previous != null && comparator.compare(next, previous) < 0)
    {
      rowsOutOfOrder = ImmutableBTreePartition.create(UnfilteredRowIterators.concat(next, iterator), false);
      return endOfData();
    }
    previous = next;
    return next;
  }
}
origin: org.apache.cassandra/cassandra-all

private UnfilteredRowIterator withValidation(UnfilteredRowIterator iter, String filename)
{
  return checkData ? UnfilteredRowIterators.withValidation(iter, filename) : iter;
}
origin: org.apache.cassandra/cassandra-all

  RangeTombstoneBoundMarker.inclusiveClose(partition.isReverseOrder(), lastRowClustering.getRawValues(), openMarkerDeletionTime);
return UnfilteredRowIterators.singleton(closingBound,
                    partition.metadata(),
                    partition.partitionKey(),
origin: org.apache.cassandra/cassandra-all

/**
 * Turns the given iterator into an update.
 *
 * @param iterator the iterator to turn into updates.
 * @param filter the column filter used when querying {@code iterator}. This is used to make
 * sure we don't include data for which the value has been skipped while reading (as we would
 * then be writing something incorrect).
 *
 * Warning: this method does not close the provided iterator, it is up to
 * the caller to close it.
 */
public static PartitionUpdate fromIterator(UnfilteredRowIterator iterator, ColumnFilter filter)
{
  iterator = UnfilteredRowIterators.withOnlyQueriedData(iterator, filter);
  Holder holder = build(iterator, 16);
  MutableDeletionInfo deletionInfo = (MutableDeletionInfo) holder.deletionInfo;
  return new PartitionUpdate(iterator.metadata(), iterator.partitionKey(), holder, deletionInfo, false);
}
origin: jsevellec/cassandra-unit

/**
 * Digests the the provided iterator.
 *
 * @param command the command that has yield {@code iterator}. This can be null if {@code version >= MessagingService.VERSION_30}
 * as this is only used when producing digest to be sent to legacy nodes.
 * @param iterator the iterator to digest.
 * @param digest the {@code MessageDigest} to use for the digest.
 * @param version the messaging protocol to use when producing the digest.
 */
public static void digest(ReadCommand command, UnfilteredPartitionIterator iterator, MessageDigest digest, int version)
{
  try (UnfilteredPartitionIterator iter = iterator)
  {
    while (iter.hasNext())
    {
      try (UnfilteredRowIterator partition = iter.next())
      {
        UnfilteredRowIterators.digest(command, partition, digest, version);
      }
    }
  }
}
origin: org.apache.cassandra/cassandra-all

  protected Unfiltered computeNext()
  {
    if (!iterator.hasNext())
      return endOfData();
    Unfiltered next = iterator.next();
    // If we detect that some rows are out of order we will store and sort the remaining ones to insert them
    // in a separate SSTable.
    if (previous != null && comparator.compare(next, previous) < 0)
    {
      rowsOutOfOrder = ImmutableBTreePartition.create(UnfilteredRowIterators.concat(next, iterator), false);
      return endOfData();
    }
    previous = next;
    return next;
  }
}
origin: jsevellec/cassandra-unit

private UnfilteredRowIterator withValidation(UnfilteredRowIterator iter, String filename)
{
  return checkData ? UnfilteredRowIterators.withValidation(iter, filename) : iter;
}
origin: com.strapdata.cassandra/cassandra-all

  RangeTombstoneBoundMarker.inclusiveClose(partition.isReverseOrder(), lastRowClustering.getRawValues(), openMarkerDeletionTime);
return UnfilteredRowIterators.singleton(closingBound,
                    partition.metadata(),
                    partition.partitionKey(),
origin: com.strapdata.cassandra/cassandra-all

public static RowIterator toRowIterator(final CFMetaData metadata,
                    final DecoratedKey key,
                    final Iterator<LegacyCell> cells,
                    final int nowInSec)
{
  SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL);
  return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec);
}
origin: com.strapdata.cassandra/cassandra-all

public UnfilteredRowIterator iterator(FileDataInput file, DecoratedKey key, RowIndexEntry indexEntry, Slices slices, ColumnFilter selectedColumns, boolean reversed, boolean isForThrift)
{
  if (indexEntry == null)
    return UnfilteredRowIterators.noRowsIterator(metadata, key, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, reversed);
  return reversed
     ? new SSTableReversedIterator(this, file, key, indexEntry, slices, selectedColumns, isForThrift, ifile)
     : new SSTableIterator(this, file, key, indexEntry, slices, selectedColumns, isForThrift, ifile);
}
origin: org.apache.cassandra/cassandra-all

/**
 * Merges the provided updates, yielding a new update that incorporates all those updates.
 *
 * @param updates the collection of updates to merge. This shouldn't be empty.
 *
 * @return a partition update that include (merge) all the updates from {@code updates}.
 */
public static PartitionUpdate merge(List<PartitionUpdate> updates)
{
  assert !updates.isEmpty();
  final int size = updates.size();
  if (size == 1)
    return Iterables.getOnlyElement(updates);
  int nowInSecs = FBUtilities.nowInSeconds();
  List<UnfilteredRowIterator> asIterators = Lists.transform(updates, AbstractBTreePartition::unfilteredIterator);
  return fromIterator(UnfilteredRowIterators.merge(asIterators, nowInSecs), ColumnFilter.all(updates.get(0).metadata()));
}
origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

/**
 * Turns the given iterator into an update.
 *
 * @param iterator the iterator to turn into updates.
 * @param filter the column filter used when querying {@code iterator}. This is used to make
 * sure we don't include data for which the value has been skipped while reading (as we would
 * then be writing something incorrect).
 *
 * Warning: this method does not close the provided iterator, it is up to
 * the caller to close it.
 */
public static PartitionUpdate fromIterator(UnfilteredRowIterator iterator, ColumnFilter filter)
{
  iterator = UnfilteredRowIterators.withOnlyQueriedData(iterator, filter);
  Holder holder = build(iterator, 16);
  MutableDeletionInfo deletionInfo = (MutableDeletionInfo) holder.deletionInfo;
  return new PartitionUpdate(iterator.metadata(), iterator.partitionKey(), holder, deletionInfo, false);
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * Digests the the provided iterator.
 *
 * @param command the command that has yield {@code iterator}. This can be null if {@code version >= MessagingService.VERSION_30}
 * as this is only used when producing digest to be sent to legacy nodes.
 * @param iterator the iterator to digest.
 * @param digest the {@code MessageDigest} to use for the digest.
 * @param version the messaging protocol to use when producing the digest.
 */
public static void digest(ReadCommand command, UnfilteredPartitionIterator iterator, MessageDigest digest, int version)
{
  try (UnfilteredPartitionIterator iter = iterator)
  {
    while (iter.hasNext())
    {
      try (UnfilteredRowIterator partition = iter.next())
      {
        UnfilteredRowIterators.digest(command, partition, digest, version);
      }
    }
  }
}
origin: com.strapdata.cassandra/cassandra-all

  protected Unfiltered computeNext()
  {
    if (!iterator.hasNext())
      return endOfData();
    Unfiltered next = iterator.next();
    // If we detect that some rows are out of order we will store and sort the remaining ones to insert them
    // in a separate SSTable.
    if (previous != null && comparator.compare(next, previous) < 0)
    {
      rowsOutOfOrder = ImmutableBTreePartition.create(UnfilteredRowIterators.concat(next, iterator), false);
      return endOfData();
    }
    previous = next;
    return next;
  }
}
origin: com.strapdata.cassandra/cassandra-all

private UnfilteredRowIterator withValidation(UnfilteredRowIterator iter, String filename)
{
  return checkData ? UnfilteredRowIterators.withValidation(iter, filename) : iter;
}
org.apache.cassandra.db.rowsUnfilteredRowIterators

Javadoc

Static methods to work with atom iterators.

Most used methods

  • filter
    Returns a iterator that only returns rows with only live content. This is mainly used in the CQL lay
  • merge
    Returns an iterator that is the result of merging other iterators, and (optionally) using specific M
  • noRowsIterator
    Returns an empty unfiltered iterator for a given partition.
  • withOnlyQueriedData
    Filter the provided iterator to exclude cells that have been fetched but are not queried by the user
  • concat
    Returns an iterator that concatenate two atom iterators. This method assumes that both iterator are
  • digest
    Digests the partition represented by the provided iterator.
  • withValidation
    Validate that the data of the provided iterator is valid, that is that the values it contains are va
  • singleton

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Top PhpStorm 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