本文整理汇总了Java中org.apache.cassandra.service.pager.PagingState类的典型用法代码示例。如果您正苦于以下问题:Java PagingState类的具体用法?Java PagingState怎么用?Java PagingState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PagingState类属于org.apache.cassandra.service.pager包,在下文中一共展示了PagingState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SpecificOptions
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
private SpecificOptions(int pageSize, PagingState state, ConsistencyLevel serialConsistency, long timestamp)
{
this.pageSize = pageSize;
this.state = state;
this.serialConsistency = serialConsistency == null ? ConsistencyLevel.SERIAL : serialConsistency;
this.timestamp = timestamp;
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:8,代码来源:QueryOptions.java
示例2: Metadata
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
private Metadata(EnumSet<Flag> flags, List<ColumnSpecification> names, int columnCount, PagingState pagingState)
{
this.flags = flags;
this.names = names;
this.columnCount = columnCount;
this.pagingState = pagingState;
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ResultSet.java
示例3: setHasMorePages
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public void setHasMorePages(PagingState pagingState)
{
if (pagingState == null)
return;
flags.add(Flag.HAS_MORE_PAGES);
this.pagingState = pagingState;
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:ResultSet.java
示例4: decode
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public Metadata decode(ByteBuf body, int version)
{
// flags & column count
int iflags = body.readInt();
int columnCount = body.readInt();
EnumSet<Flag> flags = Flag.deserialize(iflags);
PagingState state = null;
if (flags.contains(Flag.HAS_MORE_PAGES))
state = PagingState.deserialize(CBUtil.readValue(body));
if (flags.contains(Flag.NO_METADATA))
return new Metadata(flags, null, columnCount, state);
boolean globalTablesSpec = flags.contains(Flag.GLOBAL_TABLES_SPEC);
String globalKsName = null;
String globalCfName = null;
if (globalTablesSpec)
{
globalKsName = CBUtil.readString(body);
globalCfName = CBUtil.readString(body);
}
// metadata (names/types)
List<ColumnSpecification> names = new ArrayList<ColumnSpecification>(columnCount);
for (int i = 0; i < columnCount; i++)
{
String ksName = globalTablesSpec ? globalKsName : CBUtil.readString(body);
String cfName = globalTablesSpec ? globalCfName : CBUtil.readString(body);
ColumnIdentifier colName = new ColumnIdentifier(CBUtil.readString(body), true);
AbstractType type = DataType.toType(DataType.codec.decodeOne(body, version));
names.add(new ColumnSpecification(ksName, cfName, colName, type));
}
return new Metadata(flags, names, names.size(), state);
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:38,代码来源:ResultSet.java
示例5: QueryOptions
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public QueryOptions(ConsistencyLevel consistency,
List<ByteBuffer> values,
boolean skipMetadata,
int pageSize,
PagingState pagingState,
ConsistencyLevel serialConsistency)
{
this(consistency, values, skipMetadata, new SpecificOptions(pageSize, pagingState, serialConsistency));
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:10,代码来源:QueryOptions.java
示例6: setHasMorePages
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public Metadata setHasMorePages(PagingState pagingState)
{
if (pagingState == null)
return this;
flags.add(Flag.HAS_MORE_PAGES);
this.pagingState = pagingState;
return this;
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:10,代码来源:ResultSet.java
示例7: decode
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public Metadata decode(ChannelBuffer body, int version)
{
// flags & column count
int iflags = body.readInt();
int columnCount = body.readInt();
EnumSet<Flag> flags = Flag.deserialize(iflags);
PagingState state = null;
if (flags.contains(Flag.HAS_MORE_PAGES))
state = PagingState.deserialize(CBUtil.readValue(body));
if (flags.contains(Flag.NO_METADATA))
return new Metadata(flags, columnCount).setHasMorePages(state);
boolean globalTablesSpec = flags.contains(Flag.GLOBAL_TABLES_SPEC);
String globalKsName = null;
String globalCfName = null;
if (globalTablesSpec)
{
globalKsName = CBUtil.readString(body);
globalCfName = CBUtil.readString(body);
}
// metadata (names/types)
List<ColumnSpecification> names = new ArrayList<ColumnSpecification>(columnCount);
for (int i = 0; i < columnCount; i++)
{
String ksName = globalTablesSpec ? globalKsName : CBUtil.readString(body);
String cfName = globalTablesSpec ? globalCfName : CBUtil.readString(body);
ColumnIdentifier colName = new ColumnIdentifier(CBUtil.readString(body), true);
AbstractType type = DataType.toType(DataType.codec.decodeOne(body));
names.add(new ColumnSpecification(ksName, cfName, colName, type));
}
return new Metadata(flags, names).setHasMorePages(state);
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:38,代码来源:ResultSet.java
示例8: ResultMetadata
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
private ResultMetadata(EnumSet<Flag> flags, List<ColumnSpecification> names, int columnCount, PagingState pagingState)
{
this.flags = flags;
this.names = names;
this.columnCount = columnCount;
this.pagingState = pagingState;
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:8,代码来源:ResultSet.java
示例9: setHasMorePages
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public void setHasMorePages(PagingState pagingState)
{
this.pagingState = pagingState;
if (pagingState == null)
flags.remove(Flag.HAS_MORE_PAGES);
else
flags.add(Flag.HAS_MORE_PAGES);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:ResultSet.java
示例10: decode
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public ResultMetadata decode(ByteBuf body, int version)
{
// flags & column count
int iflags = body.readInt();
int columnCount = body.readInt();
EnumSet<Flag> flags = Flag.deserialize(iflags);
PagingState state = null;
if (flags.contains(Flag.HAS_MORE_PAGES))
state = PagingState.deserialize(CBUtil.readValue(body), version);
if (flags.contains(Flag.NO_METADATA))
return new ResultMetadata(flags, null, columnCount, state);
boolean globalTablesSpec = flags.contains(Flag.GLOBAL_TABLES_SPEC);
String globalKsName = null;
String globalCfName = null;
if (globalTablesSpec)
{
globalKsName = CBUtil.readString(body);
globalCfName = CBUtil.readString(body);
}
// metadata (names/types)
List<ColumnSpecification> names = new ArrayList<ColumnSpecification>(columnCount);
for (int i = 0; i < columnCount; i++)
{
String ksName = globalTablesSpec ? globalKsName : CBUtil.readString(body);
String cfName = globalTablesSpec ? globalCfName : CBUtil.readString(body);
ColumnIdentifier colName = new ColumnIdentifier(CBUtil.readString(body), true);
AbstractType type = DataType.toType(DataType.codec.decodeOne(body, version));
names.add(new ColumnSpecification(ksName, cfName, colName, type));
}
return new ResultMetadata(flags, names, names.size(), state);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:38,代码来源:ResultSet.java
示例11: maybeRecreate
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
private QueryPager maybeRecreate(QueryPager pager, ReadQuery command, boolean testPagingState, int protocolVersion)
{
if (!testPagingState)
return pager;
PagingState state = PagingState.deserialize(pager.state().serialize(protocolVersion), protocolVersion);
return command.getPager(state, protocolVersion);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:QueryPagerTest.java
示例12: withPagingState
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public ResultSet withPagingState(PagingState state)
{
if (state == null)
return this;
// The metadata is shared by all execution of a given statement. So if there is a paging state
// we need to copy the metadata
return new ResultSet(metadata.withPagingState(state), rows);
}
开发者ID:daidong,项目名称:GraphTrek,代码行数:10,代码来源:ResultSet.java
示例13: QueryOptions
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public QueryOptions(ConsistencyLevel consistency,
List<ByteBuffer> values,
boolean skipMetadata,
int pageSize,
PagingState pagingState,
ConsistencyLevel serialConsistency)
{
this(consistency, values, skipMetadata, new SpecificOptions(pageSize, pagingState, serialConsistency), 0);
}
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:10,代码来源:QueryOptions.java
示例14: decode
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public Metadata decode(ByteBuf body, int version)
{
// flags & column count
int iflags = body.readInt();
int columnCount = body.readInt();
EnumSet<Flag> flags = Flag.deserialize(iflags);
PagingState state = null;
if (flags.contains(Flag.HAS_MORE_PAGES))
state = PagingState.deserialize(CBUtil.readValue(body));
if (flags.contains(Flag.NO_METADATA))
return new Metadata(flags, columnCount).setHasMorePages(state);
boolean globalTablesSpec = flags.contains(Flag.GLOBAL_TABLES_SPEC);
String globalKsName = null;
String globalCfName = null;
if (globalTablesSpec)
{
globalKsName = CBUtil.readString(body);
globalCfName = CBUtil.readString(body);
}
// metadata (names/types)
List<ColumnSpecification> names = new ArrayList<ColumnSpecification>(columnCount);
for (int i = 0; i < columnCount; i++)
{
String ksName = globalTablesSpec ? globalKsName : CBUtil.readString(body);
String cfName = globalTablesSpec ? globalCfName : CBUtil.readString(body);
ColumnIdentifier colName = new ColumnIdentifier(CBUtil.readString(body), true);
AbstractType type = DataType.toType(DataType.codec.decodeOne(body));
names.add(new ColumnSpecification(ksName, cfName, colName, type));
}
return new Metadata(flags, names).setHasMorePages(state);
}
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:38,代码来源:ResultSet.java
示例15: create
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public static QueryOptions create(ConsistencyLevel consistency, List<ByteBuffer> values, boolean skipMetadata, int pageSize, PagingState pagingState, ConsistencyLevel serialConsistency, ProtocolVersion version)
{
return new DefaultQueryOptions(consistency, values, skipMetadata, new SpecificOptions(pageSize, pagingState, serialConsistency, -1L), version);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:QueryOptions.java
示例16: getPagingState
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
/** The paging state for this query, or null if not relevant. */
public PagingState getPagingState()
{
return getSpecificOptions().state;
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:6,代码来源:QueryOptions.java
示例17: decode
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public QueryOptions decode(ByteBuf body, ProtocolVersion version)
{
ConsistencyLevel consistency = CBUtil.readConsistencyLevel(body);
EnumSet<Flag> flags = Flag.deserialize(version.isGreaterOrEqualTo(ProtocolVersion.V5)
? (int)body.readUnsignedInt()
: (int)body.readByte());
List<ByteBuffer> values = Collections.<ByteBuffer>emptyList();
List<String> names = null;
if (flags.contains(Flag.VALUES))
{
if (flags.contains(Flag.NAMES_FOR_VALUES))
{
Pair<List<String>, List<ByteBuffer>> namesAndValues = CBUtil.readNameAndValueList(body, version);
names = namesAndValues.left;
values = namesAndValues.right;
}
else
{
values = CBUtil.readValueList(body, version);
}
}
boolean skipMetadata = flags.contains(Flag.SKIP_METADATA);
flags.remove(Flag.VALUES);
flags.remove(Flag.SKIP_METADATA);
SpecificOptions options = SpecificOptions.DEFAULT;
if (!flags.isEmpty())
{
int pageSize = flags.contains(Flag.PAGE_SIZE) ? body.readInt() : -1;
PagingState pagingState = flags.contains(Flag.PAGING_STATE) ? PagingState.deserialize(CBUtil.readValue(body), version) : null;
ConsistencyLevel serialConsistency = flags.contains(Flag.SERIAL_CONSISTENCY) ? CBUtil.readConsistencyLevel(body) : ConsistencyLevel.SERIAL;
long timestamp = Long.MIN_VALUE;
if (flags.contains(Flag.TIMESTAMP))
{
long ts = body.readLong();
if (ts == Long.MIN_VALUE)
throw new ProtocolException(String.format("Out of bound timestamp, must be in [%d, %d] (got %d)", Long.MIN_VALUE + 1, Long.MAX_VALUE, ts));
timestamp = ts;
}
options = new SpecificOptions(pageSize, pagingState, serialConsistency, timestamp);
}
DefaultQueryOptions opts = new DefaultQueryOptions(consistency, values, skipMetadata, options, version);
return names == null ? opts : new OptionsWithNames(opts, names);
}
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:48,代码来源:QueryOptions.java
示例18: create
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
public static QueryOptions create(ConsistencyLevel consistency, List<ByteBuffer> values, boolean skipMetadata, int pageSize, PagingState pagingState, ConsistencyLevel serialConsistency)
{
return new DefaultQueryOptions(consistency, values, skipMetadata, new SpecificOptions(pageSize, pagingState, serialConsistency, -1L), 0);
}
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:QueryOptions.java
示例19: getPagingState
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
/**
* The paging state for this query, or null if not relevant.
*/
public PagingState getPagingState()
{
return options.state;
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:8,代码来源:QueryOptions.java
示例20: SpecificOptions
import org.apache.cassandra.service.pager.PagingState; //导入依赖的package包/类
private SpecificOptions(int pageSize, PagingState state, ConsistencyLevel serialConsistency)
{
this.pageSize = pageSize;
this.state = state;
this.serialConsistency = serialConsistency == null ? ConsistencyLevel.SERIAL : serialConsistency;
}
开发者ID:pgaref,项目名称:ACaZoo,代码行数:7,代码来源:QueryOptions.java
注:本文中的org.apache.cassandra.service.pager.PagingState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论