本文整理汇总了Java中org.apache.cassandra.db.marshal.CollectionType类的典型用法代码示例。如果您正苦于以下问题:Java CollectionType类的具体用法?Java CollectionType怎么用?Java CollectionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionType类属于org.apache.cassandra.db.marshal包,在下文中一共展示了CollectionType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepare
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public NonTerminal prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException
{
if (receiver.type.isCollection())
{
switch (((CollectionType) receiver.type).kind)
{
case LIST:
return new Lists.Marker(bindIndex, receiver);
case SET:
return new Sets.Marker(bindIndex, receiver);
case MAP:
return new Maps.Marker(bindIndex, receiver);
default:
throw new AssertionError();
}
}
else if (receiver.type.isUDT())
{
return new UserTypes.Marker(bindIndex, receiver);
}
return new Constants.Marker(bindIndex, receiver);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:24,代码来源:AbstractMarker.java
示例2: toString
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
@Override
public String toString()
{
if (isCounterCell())
return String.format("[%s=%d ts=%d]", column().name, CounterContext.instance().total(value()), timestamp());
AbstractType<?> type = column().type;
if (type instanceof CollectionType && type.isMultiCell())
{
CollectionType ct = (CollectionType)type;
return String.format("[%s[%s]=%s %s]",
column().name,
ct.nameComparator().getString(path().get(0)),
ct.valueComparator().getString(value()),
livenessInfoString());
}
if (isTombstone())
return String.format("[%s=<tombstone> %s]", column().name, livenessInfoString());
else
return String.format("[%s=%s %s]", column().name, type.getString(value()), livenessInfoString());
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:22,代码来源:AbstractCell.java
示例3: prepare
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public Operation prepare(CFDefinition.Name receiver) throws InvalidRequestException
{
Term v = value.prepare(receiver);
if (receiver.type instanceof CounterColumnType)
throw new InvalidRequestException(String.format("Cannot set the value of counter column %s (counters can only be incremented/decremented, not set)", receiver));
if (!(receiver.type instanceof CollectionType))
return new Constants.Setter(receiver.kind == CFDefinition.Name.Kind.VALUE_ALIAS ? null : receiver.name, v);
switch (((CollectionType)receiver.type).kind)
{
case LIST:
return new Lists.Setter(receiver.name, v);
case SET:
return new Sets.Setter(receiver.name, v);
case MAP:
return new Maps.Setter(receiver.name, v);
}
throw new AssertionError();
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:Operation.java
示例4: addValue
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
private static void addValue(Selection.ResultSetBuilder result, ColumnDefinition def, CQL3Row row, QueryOptions options)
{
if (row == null)
{
result.add((ByteBuffer)null);
return;
}
if (def.type.isCollection())
{
List<Cell> collection = row.getCollection(def.name);
ByteBuffer value = collection == null
? null
: ((CollectionType)def.type).serializeForNativeProtocol(collection, options.getProtocolVersion());
result.add(value);
return;
}
result.add(row.getColumn(def.name));
}
开发者ID:daidong,项目名称:GraphTrek,代码行数:21,代码来源:TravelStatement.java
示例5: prepare
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public Operation prepare(String keyspace, ColumnDefinition receiver) throws InvalidRequestException
{
Term v = value.prepare(keyspace, receiver);
if (receiver.type instanceof CounterColumnType)
throw new InvalidRequestException(String.format("Cannot set the value of counter column %s (counters can only be incremented/decremented, not set)", receiver));
if (!(receiver.type instanceof CollectionType))
return new Constants.Setter(receiver, v);
switch (((CollectionType)receiver.type).kind)
{
case LIST:
return new Lists.Setter(receiver, v);
case SET:
return new Sets.Setter(receiver, v);
case MAP:
return new Maps.Setter(receiver, v);
}
throw new AssertionError();
}
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:22,代码来源:Operation.java
示例6: toString
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
@Override
public String toString()
{
// This assert we're dealing with a collection since that's the only thing it's used for so far.
AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator();
return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0)));
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:ColumnSubselection.java
示例7: cellValueType
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
/**
* The type of the cell values for cell belonging to this column.
*
* This is the same than the column type, except for collections where it's the 'valueComparator'
* of the collection.
*/
public AbstractType<?> cellValueType()
{
return type instanceof CollectionType
? ((CollectionType)type).valueComparator()
: type;
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:13,代码来源:ColumnDefinition.java
示例8: hasCollectionColumns
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public boolean hasCollectionColumns()
{
for (ColumnDefinition def : partitionColumns())
if (def.type instanceof CollectionType && def.type.isMultiCell())
return true;
return false;
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:CFMetaData.java
示例9: hasDroppedCollectionColumns
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public boolean hasDroppedCollectionColumns()
{
for (DroppedColumn def : getDroppedColumns().values())
if (def.type instanceof CollectionType && def.type.isMultiCell())
return true;
return false;
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:CFMetaData.java
示例10: prepare
import org.apache.cassandra.db.marshal.CollectionType; //导入依赖的package包/类
public AbstractMarker prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException
{
if (!(receiver.type instanceof CollectionType))
return new Constants.Marker(bindIndex, receiver);
switch (((CollectionType)receiver.type).kind)
{
case LIST: return new Lists.Marker(bindIndex, receiver);
case SET: return new Sets.Marker(bindIndex, receiver);
case MAP: return new Maps.Marker(bindIndex, receiver);
}
throw new AssertionError();
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:AbstractMarker.java
注:本文中的org.apache.cassandra.db.marshal.CollectionType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论