本文整理汇总了Java中org.apache.cassandra.cql3.Term.MultiItemTerminal类的典型用法代码示例。如果您正苦于以下问题:Java MultiItemTerminal类的具体用法?Java MultiItemTerminal怎么用?Java MultiItemTerminal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MultiItemTerminal类属于org.apache.cassandra.cql3.Term包,在下文中一共展示了MultiItemTerminal类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBuildBoundWithMultiInRestrictions
import org.apache.cassandra.cql3.Term.MultiItemTerminal; //导入依赖的package包/类
/**
* Test '(clustering_0, clustering_1) IN ((1, 2), (2, 3))' with two clustering column
*/
@Test
public void testBuildBoundWithMultiInRestrictions() throws InvalidRequestException
{
ByteBuffer value1 = ByteBufferUtil.bytes(1);
ByteBuffer value2 = ByteBufferUtil.bytes(2);
ByteBuffer value3 = ByteBufferUtil.bytes(3);
List<MultiItemTerminal> terms = asList(toMultiItemTerminal(value1, value2), toMultiItemTerminal(value2, value3));
MultiColumnRestriction.IN in = new MultiColumnRestriction.InWithValues(terms);
Restriction[] restrictions = new Restriction[] { in, in };
List<Composite> bounds = executeBuildBound(restrictions, Bound.START);
assertEquals(2, bounds.size());
assertComposite(bounds.get(0), value1, value2, EOC.START);
assertComposite(bounds.get(1), value2, value3, EOC.START);
bounds = executeBuildBound(restrictions, Bound.END);
assertEquals(2, bounds.size());
assertComposite(bounds.get(0), value1, value2, EOC.END);
assertComposite(bounds.get(1), value2, value3, EOC.END);
}
示例2: toMultiItemTerminal
import org.apache.cassandra.cql3.Term.MultiItemTerminal; //导入依赖的package包/类
/**
* Converts the specified values into a <code>MultiItemTerminal</code>.
*
* @param values the values to convert.
* @return the term corresponding to the specified values.
*/
private static MultiItemTerminal toMultiItemTerminal(ByteBuffer... values)
{
return new Tuples.Value(values);
}