本文整理汇总了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);
}
}