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