當前位置: 首頁>>代碼示例>>Java>>正文


Java ResultSet.fetchMoreResults方法代碼示例

本文整理匯總了Java中com.datastax.driver.core.ResultSet.fetchMoreResults方法的典型用法代碼示例。如果您正苦於以下問題:Java ResultSet.fetchMoreResults方法的具體用法?Java ResultSet.fetchMoreResults怎麽用?Java ResultSet.fetchMoreResults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.datastax.driver.core.ResultSet的用法示例。


在下文中一共展示了ResultSet.fetchMoreResults方法的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.fetchMoreResults方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。