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


Java Pageable类代码示例

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


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

示例1: execute

import org.apache.cassandra.service.pager.Pageable; //导入依赖的package包/类
@Override
public ResultMessage.Rows execute(QueryState state, QueryOptions options) throws RequestValidationException, RequestExecutionException {
    ConsistencyLevel cl = options.getConsistency();
    if (cl == null)
        throw new InvalidRequestException("Invalid empty consistency level");
    cl.validateForRead(keyspace());

    //@daidong currently, we just ignore the repeat clause because i have not figured out how to map Term to Int yet. :(
    long now = System.currentTimeMillis();
    Pageable command = getPageableCommand(options, now);
    
    /*
    TravelCommand tc = (TravelCommand)command;
    logger.info("@daidong debug: travel comand: " + tc.id + ":" + tc.steps + ":" + tc.readPath.size());
    for (int i = 0; i < tc.readPath.size(); i++){
    	for (int j = 0; j < tc.readPath.get(i).size(); j++){
    		logger.info("@daidong debug: travel command: " + tc.readPath.get(i).get(j));
    	}
    }
    */
    long start = System.nanoTime();
    ResultMessage.Rows rtn = execute(command, options, limit, now);
    logger.info("time: " + ((double)(System.nanoTime() - start)/1000000000.0));
    return rtn;        
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:26,代码来源:TravelStatement.java

示例2: getPageableCommand

import org.apache.cassandra.service.pager.Pageable; //导入依赖的package包/类
private Pageable getPageableCommand(QueryOptions options, long now) throws RequestValidationException
{
	int steps = this.paths.size();
	logger.info("@daidong debug: getPageableCommand: " + steps);
	TravelCommand tc = new TravelCommand();
	for (int i = 0; i < steps; i++){
		List<ReadCommand> commands = getSliceTravelCommands(options, now, i);
		if (commands != null)
			tc.addReadCommands(commands);
	}
	return tc;
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:13,代码来源:TravelStatement.java


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