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


Java ResultSet.isFullyFetched方法代码示例

本文整理汇总了Java中com.datastax.driver.core.ResultSet.isFullyFetched方法的典型用法代码示例。如果您正苦于以下问题:Java ResultSet.isFullyFetched方法的具体用法?Java ResultSet.isFullyFetched怎么用?Java ResultSet.isFullyFetched使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.datastax.driver.core.ResultSet的用法示例。


在下文中一共展示了ResultSet.isFullyFetched方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import com.datastax.driver.core.ResultSet; //导入方法依赖的package包/类
@Override
protected void process(CycleLog cycleLog) throws Exception {
  
  // get cycle's planned start calendar
  Calendar plannedStartCalendar =
    CalendarAndDateOperationsInl.getCalendarFromUnixTime(
      cycleLog.getPlannedStartTime() );
  
  // -1 hour -- this cycle should check for the jobs from the past hour
  plannedStartCalendar.set(Calendar.HOUR_OF_DAY, -1);
  
  // query all jobs within cycle's hour
  ResultSet resultSet =
    HourlyCurrentJobs.i().executeSyncSelect(
      CalendarFormatterInl.concatCalendarFields(
        plannedStartCalendar,
        Calendar.YEAR,
        Calendar.MONTH,
        Calendar.DAY_OF_MONTH,
        Calendar.HOUR_OF_DAY) );
  
  // to to fetch each job
  ResultSet currJobResultSet;
  
  String currSerializedJob;
  Job currJob;
  
  // retry executing every found job (failed to execute job)
  for (Row row : resultSet) {
    
    if (resultSet.getAvailableWithoutFetching() <=
        Constants.kCassandraPrefetchLimit &&
        resultSet.isFullyFetched() == false) {
      
      // this is asynchronous
      resultSet.fetchMoreResults();
    }
    
    // select job
    currJobResultSet =
      CurrentJobs.i().executeSyncSelect(
        row.getUUID(HourlyCurrentJobs.kJobIdColumnName) );
    
    // couldn't get job?
    if (currJobResultSet.isExhausted() == true) {
      
      // may need to log an exception here depending how how this service,
      //   the main service and the dispense work together - in terms of sync
      continue;
    }
    
    // get serialized job
    currSerializedJob =
      EncodingInl.decodeStringFromByteBuffer(
        currJobResultSet.one().getBytes(
          CurrentJobs.kJobColumnName) );
    
    // deserialize
    currJob = SerializationInl.<Job>deserializeObject(currSerializedJob);
    
    // execute job (retry)
    JobsExecutorInl.executeJobsAsync(currJob);
  }
}
 
开发者ID:vangav,项目名称:vos_instagram_jobs,代码行数:65,代码来源:RestJobs.java


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