当前位置: 首页>>代码示例>>Java>>正文


Java RangeTombstone类代码示例

本文整理汇总了Java中org.apache.cassandra.db.RangeTombstone的典型用法代码示例。如果您正苦于以下问题:Java RangeTombstone类的具体用法?Java RangeTombstone怎么用?Java RangeTombstone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RangeTombstone类属于org.apache.cassandra.db包,在下文中一共展示了RangeTombstone类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dropFromSchema

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
/**
 * Remove all CF attributes from schema
 *
 * @param timestamp Timestamp to use
 *
 * @return Mutation to use to completely remove cf from schema
 */
public Mutation dropFromSchema(long timestamp)
{
    Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, SystemKeyspace.getSchemaKSKey(ksName));
    ColumnFamily cf = mutation.addOrGet(SchemaColumnFamiliesCf);
    int ldt = (int) (System.currentTimeMillis() / 1000);

    Composite prefix = SchemaColumnFamiliesCf.comparator.make(cfName);
    cf.addAtom(new RangeTombstone(prefix, prefix.end(), timestamp, ldt));

    for (ColumnDefinition cd : allColumns())
        cd.deleteFromSchema(mutation, timestamp);

    for (TriggerDefinition td : triggers.values())
        td.deleteFromSchema(mutation, cfName, timestamp);

    for (String indexName : Keyspace.open(this.ksName).getColumnFamilyStore(this.cfName).getBuiltIndexes())
    {
        ColumnFamily indexCf = mutation.addOrGet(IndexCf);
        indexCf.addTombstone(indexCf.getComparator().makeCellName(indexName), ldt, timestamp);
    }

    return mutation;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:31,代码来源:CFMetaData.java

示例2: addColumn

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
protected void addColumn(OnDiskAtom col)
{
    if (reversed)
    {
        /*
         * We put range tomstone markers at the beginning of the range they delete. But for reversed queries,
         * the caller still need to know about a RangeTombstone before it sees any column that it covers.
         * To make that simple, we keep said tombstones separate and return them all before any column for
         * a given block.
         */
        if (col instanceof RangeTombstone)
            rangeTombstonesReversed.addFirst(col);
        else
            blockColumns.addFirst(col);
    }
    else
    {
        blockColumns.addLast(col);
    }
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:21,代码来源:IndexedSliceReader.java

示例3: finalizeReduce

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
public void finalizeReduce() {
    if (currentColumn != null) {
        columns.add(currentColumn);
    }

    // When cassandra compacts it removes columns that are in deleted rows
    // that are older than the deleted timestamp.
    // we will duplicate this behavior. If the etl needs this data at some
    // point we can change, but it is only available assuming
    // cassandra hasn't discarded it.
    Iterator<OnDiskAtom> columnIterator = columns.iterator();
    while (columnIterator.hasNext()) {
        OnDiskAtom atom = columnIterator.next();
        if (atom instanceof RangeTombstone) {
            columnIterator.remove();
        } else if (atom instanceof Column && ((Column) atom).timestamp() <= this.deletedAt) {
            columnIterator.remove();
        }
    }
}
 
开发者ID:Netflix,项目名称:aegisthus,代码行数:21,代码来源:CassSSTableReducer.java

示例4: AbstractCType

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
protected AbstractCType(boolean isByteOrderComparable)
{
    reverseComparator = new Comparator<Composite>()
    {
        public int compare(Composite c1, Composite c2)
        {
            return AbstractCType.this.compare(c2, c1);
        }
    };
    indexComparator = new Comparator<IndexInfo>()
    {
        public int compare(IndexInfo o1, IndexInfo o2)
        {
            return AbstractCType.this.compare(o1.lastName, o2.lastName);
        }
    };
    indexReverseComparator = new Comparator<IndexInfo>()
    {
        public int compare(IndexInfo o1, IndexInfo o2)
        {
            return AbstractCType.this.compare(o1.firstName, o2.firstName);
        }
    };

    serializer = new Serializer(this);

    indexSerializer = new IndexInfo.Serializer(this);
    sliceSerializer = new ColumnSlice.Serializer(this);
    sliceQueryFilterSerializer = new SliceQueryFilter.Serializer(this);
    deletionInfoSerializer = new DeletionInfo.Serializer(this);
    rangeTombstoneSerializer = new RangeTombstone.Serializer(this);
    rowIndexEntrySerializer = new RowIndexEntry.Serializer(this);
    this.isByteOrderComparable = isByteOrderComparable;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:35,代码来源:AbstractCType.java

示例5: delete

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
public void delete(DeletionInfo target, ColumnFamily source)
{
    target.add(source.deletionInfo().getTopLevelDeletion());
    // source is the CF currently in the memtable, and it can be large compared to what the filter selects,
    // so only consider those range tombstones that the filter do select.
    for (Iterator<RangeTombstone> iter = filter.getRangeTombstoneIterator(source); iter.hasNext(); )
        target.add(iter.next(), source.getComparator());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:QueryFilter.java

示例6: serializeBound

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
private void serializeBound(RangeTombstone.Bound bound, DeletionTime deletionTime) throws IOException
{
    json.writeFieldName(bound.isStart() ? "start" : "end");
    json.writeStartObject();
    json.writeFieldName("type");
    json.writeString(bound.isInclusive() ? "inclusive" : "exclusive");
    serializeClustering(bound.clustering());
    serializeDeletion(deletionTime);
    json.writeEndObject();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:11,代码来源:JsonTransformer.java

示例7: AbstractCType

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
protected AbstractCType()
{
    reverseComparator = new Comparator<Composite>()
    {
        public int compare(Composite c1, Composite c2)
        {
            return AbstractCType.this.compare(c2, c1);
        }
    };
    indexComparator = new Comparator<IndexInfo>()
    {
        public int compare(IndexInfo o1, IndexInfo o2)
        {
            return AbstractCType.this.compare(o1.lastName, o2.lastName);
        }
    };
    indexReverseComparator = new Comparator<IndexInfo>()
    {
        public int compare(IndexInfo o1, IndexInfo o2)
        {
            return AbstractCType.this.compare(o1.firstName, o2.firstName);
        }
    };

    serializer = new Serializer(this);

    indexSerializer = new IndexInfo.Serializer(this);
    sliceSerializer = new ColumnSlice.Serializer(this);
    sliceQueryFilterSerializer = new SliceQueryFilter.Serializer(this);
    deletionInfoSerializer = new DeletionInfo.Serializer(this);
    rangeTombstoneSerializer = new RangeTombstone.Serializer(this);
    rowIndexEntrySerializer = new RowIndexEntry.Serializer(this);
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:34,代码来源:AbstractCType.java

示例8: addAtom

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
@SuppressWarnings("StatementWithEmptyBody")
public void addAtom(AtomWritable writable) {
    OnDiskAtom atom = writable.getAtom();
    if (atom == null) {
        return;
    }

    atomTotalSize += atom.serializedSizeForSSTable();

    this.tombstoneTracker.update(atom);
    // Right now, we will only keep columns. This works because we will
    // have all the columns a range tombstone applies to when we create
    // a snapshot. This will not be true if we go to partial incremental
    // processing
    if (atom instanceof Column) {
        Column column = (Column) atom;
        if (this.tombstoneTracker.isDeleted(column)) {
            // If the column is deleted by the rangeTombstone, just discard
            // it, every other column of the same name will be discarded as
            // well, unless it is later than the range tombstone in which
            // case the column is out of date anyway
        } else if (currentColumn == null) {
            currentColumn = column;
        } else if (currentColumn.name().equals(column.name())) {
            if (column.timestamp() > currentColumn.minTimestamp()) {
                currentColumn = column;
            }
        } else {
            columns.add(currentColumn);
            currentColumn = column;
        }
    } else if (atom instanceof RangeTombstone) {
        // We do not include these columns in the output since they are deleted
    } else {
        String error =
                "Cassandra added a new type " + atom.getClass().getCanonicalName() + " which we do not support";
        throw new IllegalArgumentException(error);
    }
}
 
开发者ID:Netflix,项目名称:aegisthus,代码行数:40,代码来源:CassSSTableReducer.java

示例9: map

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void map(ByteBuffer key, CASS_VALUE atom, Context context) throws IOException,
        InterruptedException {

    // skip deleted atoms if necessary
    if (skipDeletedAtoms && (atom instanceof DeletedCell || atom instanceof RangeTombstone)) {
        return;
    }

    // skip types we don't care about
    if (!cassandraAtomType.isAssignableFrom(atom.getClass())) {
        return;
    }

    K1 mapKey = getMapperKey(key, context);
    if (mapKey == null) {
        return;
    }

    V1 mapValue = getMapperValue(atom, context);
    if (mapValue == null) {
        return;
    }

    this.value = atom;
    this.key = key;
    performMapTask(mapKey, mapValue, context);
}
 
开发者ID:Knewton,项目名称:KassandraMRHelper,代码行数:32,代码来源:AbstractSSTableMapper.java

示例10: rangeTombstone

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
@Override
public void rangeTombstone(RangeTombstone tombstone) {
	// nothing to do here
}
 
开发者ID:jmiddleton,项目名称:cassandra-fhir-index,代码行数:5,代码来源:FhirIndexIndexer.java

示例11: rangeTombstoneSerializer

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
public RangeTombstone.Serializer rangeTombstoneSerializer()
{
    return rangeTombstoneSerializer;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:AbstractCType.java

示例12: RowReducer

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
RowReducer(AbstractType<?> columnComparator) {
    tombstoneTracker = new RangeTombstone.Tracker(columnComparator);
}
 
开发者ID:Netflix,项目名称:aegisthus,代码行数:4,代码来源:CassSSTableReducer.java

示例13: onRangeTombstone

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
void onRangeTombstone(RangeTombstone rangeTombstone); 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:2,代码来源:UpdateTransaction.java

示例14: rangeTombstoneSerializer

import org.apache.cassandra.db.RangeTombstone; //导入依赖的package包/类
public RangeTombstone.Serializer rangeTombstoneSerializer(); 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:2,代码来源:CType.java


注:本文中的org.apache.cassandra.db.RangeTombstone类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。