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

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

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

origin: jsevellec/cassandra-unit

public void add(RangeTombstone tombstone, ClusteringComparator comparator)
{
  if (ranges == null)
    ranges = new RangeTombstoneList(comparator, 1);
  ranges.add(tombstone);
}
origin: com.facebook.presto.cassandra/cassandra-server

private void addInternal(int i, Composite start, Composite end, long markedAt, int delTime)
{
  assert i >= 0;
  if (size == capacity())
    growToFree(i);
  else if (i < size)
    moveElements(i);
  setInternal(i, start, end, markedAt, delTime);
  size++;
}
origin: org.apache.cassandra/cassandra-all

private void growToFree(int i)
{
  int newLength = (capacity() * 3) / 2 + 1;
  grow(i, newLength);
}
origin: com.facebook.presto.cassandra/cassandra-server

if (tombstones.isEmpty())
  return;
if (isEmpty())
  copyArrays(tombstones, this);
  return;
    add(tombstones.starts[i], tombstones.ends[i], tombstones.markedAts[i], tombstones.delTimes[i]);
      insertFrom(i, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
      j++;
    addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Adds a new range tombstone.
 *
 * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case),
 * but it doesn't assume it.
 */
public void add(Composite start, Composite end, long markedAt, int delTime)
{
  if (isEmpty())
  {
    addInternal(0, start, end, markedAt, delTime);
    return;
  }
  int c = comparator.compare(ends[size-1], start);
  // Fast path if we add in sorted order
  if (c < 0)
  {
    addInternal(size, start, end, markedAt, delTime);
  }
  else
  {
    // Note: insertFrom expect i to be the insertion point in term of interval ends
    int pos = Arrays.binarySearch(ends, 0, size, start, comparator);
    insertFrom((pos >= 0 ? pos : -pos-1), start, end, markedAt, delTime);
  }
  boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize();
}
origin: com.facebook.presto.cassandra/cassandra-server

private String rangesAsString()
{
  assert !ranges.isEmpty();
  StringBuilder sb = new StringBuilder();
  CType type = (CType)ranges.comparator();
  assert type != null;
  Iterator<RangeTombstone> iter = rangeIterator();
  while (iter.hasNext())
  {
    RangeTombstone i = iter.next();
    sb.append("[");
    sb.append(type.getString(i.min)).append("-");
    sb.append(type.getString(i.max)).append(", ");
    sb.append(i.data);
    sb.append("]");
  }
  return sb.toString();
}
origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Combines another DeletionInfo with this one and returns the result.  Whichever top-level tombstone
 * has the higher markedForDeleteAt timestamp will be kept, along with its localDeletionTime.  The
 * range tombstones will be combined.
 *
 * @return this object.
 */
public DeletionInfo add(DeletionInfo newInfo)
{
  add(newInfo.topLevel);
  if (ranges == null)
    ranges = newInfo.ranges == null ? null : newInfo.ranges.copy();
  else if (newInfo.ranges != null)
    ranges.addAll(newInfo.ranges);
  return this;
}
origin: com.facebook.presto.cassandra/cassandra-server

if (isEmpty())
  return superset;
        diff = new RangeTombstoneList(comparator, superset.size - i);
        diff.add(superset.starts[k], superset.ends[k], superset.markedAts[k], superset.delTimes[k]);
      diff = new RangeTombstoneList(comparator, Math.min(8, superset.size - i));
    diff.add(superset.starts[i], superset.ends[i], superset.markedAts[i], superset.delTimes[i]);
origin: jsevellec/cassandra-unit

        addInternal(i, starts[i], newEnd, markedAts[i], delTimes[i]);
        i++;
        setInternal(i, start, ends[i], markedAts[i], delTimes[i]);
      addInternal(i, start, end, markedAt, delTime);
      return;
        setInternal(i, start, end, markedAt, delTime);
        return;
      setInternal(i, start, starts[i+1].invert(), markedAt, delTime);
      start = starts[i+1];
      i++;
      addInternal(i, start, end, markedAt, delTime);
      i++;
      ClusteringBound newStart = end.invert();
      if (!Slice.isEmpty(comparator, newStart, ends[i]))
        setInternal(i, newStart, ends[i], markedAts[i], delTimes[i]);
        addInternal(i, start, end, markedAt, delTime);
        return;
        addInternal(i, start, newEnd, markedAt, delTime);
        i++;
addInternal(i, start, end, markedAt, delTime);
origin: org.apache.cassandra/cassandra-all

public RangeTombstoneList copy(AbstractAllocator allocator)
{
  RangeTombstoneList copy =  new RangeTombstoneList(comparator,
                           new ClusteringBound[size],
                           new ClusteringBound[size],
                           Arrays.copyOf(markedAts, size),
                           Arrays.copyOf(delTimes, size),
                           boundaryHeapSize, size);
  for (int i = 0; i < size; i++)
  {
    copy.starts[i] = clone(starts[i], allocator);
    copy.ends[i] = clone(ends[i], allocator);
  }
  return copy;
}
origin: jsevellec/cassandra-unit

public MutableDeletionInfo copy(AbstractAllocator allocator)
{
  RangeTombstoneList rangesCopy = null;
  if (ranges != null)
     rangesCopy = ranges.copy(allocator);
  return new MutableDeletionInfo(partitionDeletion, rangesCopy);
}
origin: jsevellec/cassandra-unit

private void grow(int i, int newLength)
{
  starts = grow(starts, size, newLength, i);
  ends = grow(ends, size, newLength, i);
  markedAts = grow(markedAts, size, newLength, i);
  delTimes = grow(delTimes, size, newLength, i);
}
origin: com.facebook.presto.cassandra/cassandra-server

  removeInternal(i);
  continue;
addInternal(i, starts[i], start, markedAts[i], delTimes[i]);
i++;
  setInternal(i, start, end, markedAt, delTime);
else
  addInternal(i, start, end, markedAt, delTime);
return;
  setInternal(i, start, end, markedAt, delTime);
  return;
setInternal(i, start, ends[i], markedAt, delTime);
if (cmp == 0)
  return;
addInternal(i, start, end, markedAt, delTime);
i++;
setInternal(i, end, ends[i], markedAts[i], delTimes[i]);
return;
  addInternal(i, start, end, markedAt, delTime);
  return;
addInternal(i, start, starts[i], markedAt, delTime);
i++;
origin: com.strapdata.cassandra/cassandra-all

public RangeTombstoneList copy()
{
  return new RangeTombstoneList(comparator,
                 Arrays.copyOf(starts, size),
                 Arrays.copyOf(ends, size),
                 Arrays.copyOf(markedAts, size),
                 Arrays.copyOf(delTimes, size),
                 boundaryHeapSize, size);
}
origin: com.facebook.presto.cassandra/cassandra-server

public int dataSize()
{
  int size = TypeSizes.NATIVE.sizeof(topLevel.markedForDeleteAt);
  return size + (ranges == null ? 0 : ranges.dataSize());
}
origin: com.facebook.presto.cassandra/cassandra-server

public void add(RangeTombstone tombstone)
{
  add(tombstone.min, tombstone.max, tombstone.data.markedForDeleteAt, tombstone.data.localDeletionTime);
}
origin: org.apache.cassandra/cassandra-all

if (tombstones.isEmpty())
  return;
if (isEmpty())
  copyArrays(tombstones, this);
  return;
    add(tombstones.starts[i], tombstones.ends[i], tombstones.markedAts[i], tombstones.delTimes[i]);
      insertFrom(i, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
      j++;
    addInternal(size, tombstones.starts[j], tombstones.ends[j], tombstones.markedAts[j], tombstones.delTimes[j]);
origin: jsevellec/cassandra-unit

/**
 * Adds a new range tombstone.
 *
 * This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case),
 * but it doesn't assume it.
 */
public void add(ClusteringBound start, ClusteringBound end, long markedAt, int delTime)
{
  if (isEmpty())
  {
    addInternal(0, start, end, markedAt, delTime);
    return;
  }
  int c = comparator.compare(ends[size-1], start);
  // Fast path if we add in sorted order
  if (c <= 0)
  {
    addInternal(size, start, end, markedAt, delTime);
  }
  else
  {
    // Note: insertFrom expect i to be the insertion point in term of interval ends
    int pos = Arrays.binarySearch(ends, 0, size, start, comparator);
    insertFrom((pos >= 0 ? pos+1 : -pos-1), start, end, markedAt, delTime);
  }
  boundaryHeapSize += start.unsharedHeapSize() + end.unsharedHeapSize();
}
origin: jsevellec/cassandra-unit

private String rangesAsString()
{
  assert !ranges.isEmpty();
  StringBuilder sb = new StringBuilder();
  ClusteringComparator cc = ranges.comparator();
  Iterator<RangeTombstone> iter = rangeIterator(false);
  while (iter.hasNext())
  {
    RangeTombstone i = iter.next();
    sb.append(i.deletedSlice().toString(cc));
    sb.append('@');
    sb.append(i.deletionTime());
  }
  return sb.toString();
}
origin: jsevellec/cassandra-unit

/**
 * Combines another DeletionInfo with this one and returns the result.  Whichever top-level tombstone
 * has the higher markedForDeleteAt timestamp will be kept, along with its localDeletionTime.  The
 * range tombstones will be combined.
 *
 * @return this object.
 */
public DeletionInfo add(DeletionInfo newInfo)
{
  add(newInfo.getPartitionDeletion());
  // We know MutableDeletionInfo is the only impelementation and we're not mutating it, it's just to get access to the
  // RangeTombstoneList directly.
  assert newInfo instanceof MutableDeletionInfo;
  RangeTombstoneList newRanges = ((MutableDeletionInfo)newInfo).ranges;
  if (ranges == null)
    ranges = newRanges == null ? null : newRanges.copy();
  else if (newRanges != null)
    ranges.addAll(newRanges);
  return this;
}
org.apache.cassandra.dbRangeTombstoneList

Javadoc

Data structure holding the range tombstones of a ColumnFamily.

This is essentially a sorted list of non-overlapping (tombstone) ranges.

A range tombstone has 4 elements: the start and end of the range covered, and the deletion infos (markedAt timestamp and local deletion time). The markedAt timestamp is what define the priority of 2 overlapping tombstones. That is, given 2 tombstones [0, 10]@t1 and [5, 15]@t2, then if t2 > t1 (and are the tombstones markedAt values), the 2nd tombstone take precedence over the first one on [5, 10]. If such tombstones are added to a RangeTombstoneList, the range tombstone list will store them as [[0, 5]@t1, [5, 15]@t2].

The only use of the local deletion time is to know when a given tombstone can be purged, which will be done by the purge() method.

Most used methods

  • <init>
  • add
    Adds a new range tombstone. This method will be faster if the new tombstone sort after all the curre
  • addAll
    Adds all the range tombstones of tombstones to this RangeTombstoneList.
  • addInternal
  • capacity
  • comparator
  • copy
  • copyArrays
  • dataSize
  • grow
  • growToFree
  • insertFrom
  • growToFree,
  • insertFrom,
  • isEmpty,
  • iterator,
  • maxMarkedAt,
  • moveElements,
  • rangeTombstone,
  • search,
  • searchInternal,
  • setInternal

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JPanel (javax.swing)
  • CodeWhisperer alternatives
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