protected JDBCBaseExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory jef) { this.connection = connection; this.context = context; this.executionFactory = jef; trimString = jef.isTrimStrings(); fetchSize = context.getBatchSize(); this.command = command; }
private void doSelect(String select) throws TranslatorException { this.results = this.connection.query(select, this.context.getBatchSize(), Boolean.FALSE); }
protected String getSQL() { return this.visitor.toString() + " LIMIT " + Math.min(this.executionContext.getBatchSize(), MAX_PAGE_SIZE); //$NON-NLS-1$ }
protected Map<String, List<String>> getDefaultHeaders() { Map<String, List<String>> headers = new HashMap<String, List<String>>(); headers.put("Accept", Arrays.asList(ContentType.JSON.toContentTypeString())); //$NON-NLS-1$ headers.put("Content-Type", Arrays.asList( //$NON-NLS-1$ ContentType.APPLICATION_JSON.toContentTypeString())); if (this.executionContext != null) { headers.put("Prefer", Arrays.asList("odata.maxpagesize="+this.executionContext.getBatchSize())); //$NON-NLS-1$ //$NON-NLS-2$ } return headers; }
private void loadBatch() throws TranslatorException { if(null != resultBatch) { // if we have an old batch, then we have to get new results results = connection.queryMore(results.getQueryLocator(), context.getBatchSize()); } resultBatch = new ArrayList<List<Object>>(); topResultIndex = 0; for(SObject sObject : results.getRecords()) { if (sObject == null) { continue; } List<Object[]> result = getObjectData(sObject); for(Iterator<Object[]> i = result.iterator(); i.hasNext(); ) { resultBatch.add(Arrays.asList(i.next())); } } }
this.rowIterator = this.connection.executeQuery(worksheet, toQuery, offset, limit, executionContext.getBatchSize()).iterator();
if(!result.isDone()) { this.results = this.connection.queryMore(results.getQueryLocator(), context.getBatchSize()); this.currentBatch = loadBatch(this.results);
/** * Set the standard request controls */ private void setRequestControls(byte[] cookie) throws TranslatorException { List<Control> ctrl = new ArrayList<Control>(); SortKey[] keys = searchDetails.getSortKeys(); try { if (keys != null) { ctrl.add(new SortControl(keys, Control.NONCRITICAL)); } if (this.executionFactory.usePagination()) { ctrl.add(new PagedResultsControl(this.executionContext.getBatchSize(), cookie, Control.CRITICAL)); } if (!ctrl.isEmpty()) { this.ldapCtx.setRequestControls(ctrl.toArray(new Control[ctrl.size()])); LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Sort/pagination controls were created successfully."); //$NON-NLS-1$ } } catch (NamingException ne) { final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError") + //$NON-NLS-1$ " : "+ne.getExplanation(); //$NON-NLS-1$ throw new TranslatorException(ne, msg); } catch(IOException e) { throw new TranslatorException(e); } }
this.executionFactory.getOptions(this.executionContext.getBatchSize()));
@Override public void execute() throws TranslatorException { SpreadsheetSQLVisitor visitor = new SpreadsheetSQLVisitor(connection.getSpreadsheetInfo()); visitor.translateSQL(query); rowIterator = connection.executeQuery(visitor.getWorksheetTitle(), visitor.getTranslatedSQL(), visitor.getOffsetValue(),visitor.getLimitValue(), executionContext.getBatchSize()).iterator(); }
this.results = collection.aggregate(ops, this.executionFactory.getOptions(this.executionContext.getBatchSize())); } catch (MongoException e) { throw new TranslatorException(e);
AggregationOptions options = this.executionFactory.getOptions(this.executionContext.getBatchSize());
results = connection.query(finalQuery, this.context.getBatchSize(), visitor.getQueryAll());