/** {@inheritDoc} */ @NotNull @Override public Iterator<List<?>> iterator() { return getAll().iterator(); }
BulkLoadContextCursor blCur = (BulkLoadContextCursor)fieldsCur; BulkLoadProcessor blProcessor = blCur.bulkLoadProcessor(); BulkLoadAckClientParameters clientParams = blCur.clientParams();
/** * Process bulk load COPY command. * * @param cmd The command. * @param qryId Query id. * @return The context (which is the result of the first request/response). * @throws IgniteCheckedException If something failed. */ public FieldsQueryCursor<List<?>> processBulkLoadCommand(SqlBulkLoadCommand cmd, Long qryId) throws IgniteCheckedException { if (cmd.packetSize() == null) cmd.packetSize(BulkLoadAckClientParameters.DFLT_PACKET_SIZE); GridH2Table tbl = schemaMgr.dataTable(cmd.schemaName(), cmd.tableName()); if (tbl == null) { throw new IgniteSQLException("Table does not exist: " + cmd.tableName(), IgniteQueryErrorCode.TABLE_NOT_FOUND); } H2Utils.checkAndStartNotStartedCache(ctx, tbl); UpdatePlan plan = UpdatePlanBuilder.planForBulkLoad(cmd, tbl); IgniteClosureX<List<?>, IgniteBiTuple<?, ?>> dataConverter = new BulkLoadDataConverter(plan); IgniteDataStreamer<Object, Object> streamer = ctx.grid().dataStreamer(tbl.cacheName()); BulkLoadCacheWriter outputWriter = new BulkLoadStreamerWriter(streamer); BulkLoadParser inputParser = BulkLoadParser.createParser(cmd.inputFormat()); BulkLoadProcessor processor = new BulkLoadProcessor(inputParser, dataConverter, outputWriter, idx.runningQueryManager(), qryId); BulkLoadAckClientParameters params = new BulkLoadAckClientParameters(cmd.localFileName(), cmd.packetSize()); return new BulkLoadContextCursor(processor, params); }
BulkLoadContextCursor blCur = (BulkLoadContextCursor) fieldsCur; BulkLoadProcessor blProcessor = blCur.bulkLoadProcessor(); BulkLoadAckClientParameters clientParams = blCur.clientParams();
/** * Process bulk load COPY command. * * @param cmd The command. * @return The context (which is the result of the first request/response). * @throws IgniteCheckedException If something failed. */ public FieldsQueryCursor<List<?>> processBulkLoadCommand(SqlBulkLoadCommand cmd) throws IgniteCheckedException { if (cmd.packetSize() == null) cmd.packetSize(BulkLoadAckClientParameters.DFLT_PACKET_SIZE); GridH2Table tbl = idx.dataTable(cmd.schemaName(), cmd.tableName()); if (tbl == null) { idx.kernalContext().cache().createMissingQueryCaches(); tbl = idx.dataTable(cmd.schemaName(), cmd.tableName()); } if (tbl == null) { throw new IgniteSQLException("Table does not exist: " + cmd.tableName(), IgniteQueryErrorCode.TABLE_NOT_FOUND); } UpdatePlan plan = UpdatePlanBuilder.planForBulkLoad(cmd, tbl); IgniteClosureX<List<?>, IgniteBiTuple<?, ?>> dataConverter = new BulkLoadDataConverter(plan); GridCacheContext cache = tbl.cache(); IgniteDataStreamer<Object, Object> streamer = cache.grid().dataStreamer(cache.name()); BulkLoadCacheWriter outputWriter = new BulkLoadStreamerWriter(streamer); BulkLoadParser inputParser = BulkLoadParser.createParser(cmd.inputFormat()); BulkLoadProcessor processor = new BulkLoadProcessor(inputParser, dataConverter, outputWriter); BulkLoadAckClientParameters params = new BulkLoadAckClientParameters(cmd.localFileName(), cmd.packetSize()); return new BulkLoadContextCursor(processor, params); }
/** {@inheritDoc} */ @NotNull @Override public Iterator<List<?>> iterator() { return getAll().iterator(); }