本文整理汇总了Java中org.apache.cassandra.utils.btree.BTree.empty方法的典型用法代码示例。如果您正苦于以下问题:Java BTree.empty方法的具体用法?Java BTree.empty怎么用?Java BTree.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.utils.btree.BTree
的用法示例。
在下文中一共展示了BTree.empty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSlicingAllSmallTrees
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
@Test
public void testSlicingAllSmallTrees() throws ExecutionException, InterruptedException
{
Object[] cur = BTree.empty();
TreeSet<Integer> canon = new TreeSet<>();
// we set FAN_FACTOR to 4, so 128 items is four levels deep, three fully populated
for (int i = 0 ; i < 128 ; i++)
{
String id = String.format("[0..%d)", canon.size());
System.out.println("Testing " + id);
Futures.allAsList(testAllSlices(id, cur, canon)).get();
Object[] next = null;
while (next == null)
next = BTree.update(cur, ICMP, Arrays.asList(i), true, SPORADIC_ABORT);
cur = next;
canon.add(i);
}
}
示例2: PartitionUpdate
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
private PartitionUpdate(CFMetaData metadata,
DecoratedKey key,
PartitionColumns columns,
MutableDeletionInfo deletionInfo,
int initialRowCapacity,
boolean canHaveShadowedData)
{
super(metadata, key);
this.deletionInfo = deletionInfo;
this.holder = new Holder(columns, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
this.canHaveShadowedData = canHaveShadowedData;
rowBuilder = builder(initialRowCapacity);
}
示例3: testSlicingAllSmallTrees
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
@Test
public void testSlicingAllSmallTrees() throws ExecutionException, InterruptedException
{
Object[] cur = BTree.empty();
TreeSet<Integer> canon = new TreeSet<>();
// we set FAN_FACTOR to 4, so 128 items is four levels deep, three fully populated
for (int i = 0 ; i < 128 ; i++)
{
String id = String.format("[0..%d)", canon.size());
System.out.println("Testing " + id);
Futures.allAsList(testAllSlices(id, cur, canon)).get();
cur = BTree.update(cur, ICMP, Arrays.asList(i), true, null, null);
canon.add(i);
}
}
示例4: emptyRow
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
public static BTreeRow emptyRow(Clustering clustering)
{
return new BTreeRow(clustering, BTree.empty(), Integer.MAX_VALUE);
}
示例5: emptyUpdate
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
/**
* Creates a empty immutable partition update.
*
* @param metadata the metadata for the created update.
* @param key the partition key for the created update.
*
* @return the newly created empty (and immutable) update.
*/
public static PartitionUpdate emptyUpdate(CFMetaData metadata, DecoratedKey key)
{
MutableDeletionInfo deletionInfo = MutableDeletionInfo.live();
Holder holder = new Holder(PartitionColumns.NONE, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
return new PartitionUpdate(metadata, key, holder, deletionInfo, false);
}
示例6: fullPartitionDelete
import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
/**
* Creates an immutable partition update that entirely deletes a given partition.
*
* @param metadata the metadata for the created update.
* @param key the partition key for the partition that the created update should delete.
* @param timestamp the timestamp for the deletion.
* @param nowInSec the current time in seconds to use as local deletion time for the partition deletion.
*
* @return the newly created partition deletion update.
*/
public static PartitionUpdate fullPartitionDelete(CFMetaData metadata, DecoratedKey key, long timestamp, int nowInSec)
{
MutableDeletionInfo deletionInfo = new MutableDeletionInfo(timestamp, nowInSec);
Holder holder = new Holder(PartitionColumns.NONE, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
return new PartitionUpdate(metadata, key, holder, deletionInfo, false);
}