within the given DBObjectBatch.
17509
private void copyObjectIDsToBatch(BatchResult batchResult, DBObjectBatch dbObjBatch) {
        if (batchResult.getResultObjectCount() < dbObjBatch.getObjectCount()) {
            m_logger.warn("Batch result returned fewer objects ({}) than input batch ({})",
                          batchResult.getResultObjectCount(), dbObjBatch.getObjectCount());
        }
        Iterator<ObjectResult> resultIter = batchResult.getResultObjects().iterator();
        Iterator<DBObject> objectIter = dbObjBatch.getObjects().iterator();
        while (resultIter.hasNext()) {
            if (!objectIter.hasNext()) {
                m_logger.warn("Batch result has more objects ({}) than input batch ({})!",
                              batchResult.getResultObjectCount(), dbObjBatch.getObjectCount());
                break;
            }
            ObjectResult objResult = resultIter.next();
            DBObject dbObj = objectIter.next();
            if (Utils.isEmpty(dbObj.getObjectID())) {
                dbObj.setObjectID(objResult.getObjectID());
            } else if (!dbObj.getObjectID().equals(objResult.getObjectID())) {
                m_logger.warn("Batch results out of order: expected ID '{}', got '{}'",
                              dbObj.getObjectID(), objResult.getObjectID());
            }
        }
    }
757036
private void writeObject(ObjectOutputStream out) throws IOException {
		out.writeInt(batchSize);
		this.conf.write(out);
		out.writeUTF(schema.toString());

		out.writeInt(selectedFields.length);
		for (int f : selectedFields) {
			out.writeInt(f);
		}

		out.writeInt(conjunctPredicates.size());
		for (Predicate p : conjunctPredicates) {
			out.writeObject(p);
		}
	}
107498
protected void incrementBatchCount() throws SQLException {
        batchCount++;
        if (batchCount == batchSize /* never true for batchSize of 0 */) {
            int[] result = delegate.executeBatch();
            processResult(result);
            batchCount = 0;
        }
    }
275942
@Override
    public int executeBatch()
    {
        Map<String, BulkWriteOperation> bulkWriteOperationMap = new HashMap<String, BulkWriteOperation>();
        int size = 0;
        for (Node node : nodes)
        {
            if (node.isDirty())
            {
                node.handlePreEvent();
                // delete can not be executed in batch
                if (node.isInState(RemovedState.class))
                {
                    delete(node.getData(), node.getEntityId());
                }
                else
                {
                    List<RelationHolder> relationHolders = getRelationHolders(node);
                    EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                            node.getDataClass());
                    Map<String, DBObject> documents = handler.getDocumentFromEntity(metadata, node.getData(),
                            relationHolders, kunderaMetadata);
                    for (String tableName : documents.keySet())
                    {
                        if (!bulkWriteOperationMap.containsKey(tableName))
                        {
                            DBCollection collection = mongoDb.getCollection(tableName);
                            BulkWriteOperation builder = null;
                            if (isOrderedBulkOperation())
                            {
                                builder = collection.initializeOrderedBulkOperation();
                            }
                            else
                            {
                                builder = collection.initializeUnorderedBulkOperation();
                            }
                            bulkWriteOperationMap.put(tableName, builder);
                        }

                        if (!node.isUpdate())
                        {
                            bulkWriteOperationMap.get(tableName).insert(documents.get(tableName));
                        }

                        else
                        {
                            bulkWriteOperationMap.get(tableName).find(new BasicDBObject("_id", node.getEntityId()))
                                    .upsert().replaceOne(documents.get(tableName));
                        }
                        size++;
                    }
                    indexNode(node, metadata);
                }
                node.handlePostEvent();
            }
        }
        onFlushBatch(bulkWriteOperationMap);
        return size;
    }
431478
public DBObject toDBObject() {
        final BasicDBList list = new BasicDBList();
        for (final Point point : points) {
            list.add(point.toDBObject());
        }

        return new BasicDBObject(geometry, list);
    }
1352410
public void updateBatch(V batch) {

        if (intervalCheck.check()) {
            rolling();
        }
        synchronized (this) {
            unflushed = updater.updateBatch(batch, unflushed);
        }

    }
1105774
@Override
    public void addBatch() throws SQLException
    {
        checkClosed();
        if (this.Query.isOfType(VoltSQL.TYPE_EXEC,VoltSQL.TYPE_SELECT)) {
            throw SQLError.get(SQLError.ILLEGAL_STATEMENT, this.Query.toSqlString());
        }
        this.addBatch(this.Query.getExecutableQuery(this.parameters));
        this.parameters = this.Query.getParameterArray();
    }
155167
public DBObject toDBObject() {
        DBObject dbObject = new BasicDBObject();
        if (granularity != null) {
            dbObject.put("granularity", granularity.getGranulality());
        }

        DBObject output = new BasicDBObject();
        for (Map.Entry<String, Accumulator> entry : accumulators.entrySet()) {
            output.put(entry.getKey(), entry.getValue().toDBObject());
        }
        if (!accumulators.isEmpty()) {
            dbObject.put("output", output);
        }

        return dbObject;
    }
152382
@Override
    public DBCursor cursor(DBCollection dbCollection) {
        logger.debug("Executing {} for {} cursor", delegate, dbCollection.getFullName());

        DBCursor dbCursor = delegate.cursor(dbCollection);

        if (logger.isDebugEnabled()) {
            StringBuilder sb = new StringBuilder();
            DBObject plan = dbCursor.explain();

            sb.append("MongoDB query plan:\n");
            sb.append("\tcursor = \"").append(plan.get("cursor")).append("\"\n");
            sb.append("\tnscanned = \"").append(plan.get("nscanned")).append("\"\n");
            sb.append("\tn = \"").append(plan.get("n")).append("\"\n");
            sb.append("\tmillis = \"").append(plan.get("millis")).append("\"\n");

            logger.debug(sb.toString());
        }

        return dbCursor;
    }
1172028
public void toDBObject(final Object containingObject, final MappedField mf, final DBObject dbObj, final MapperOptions opts) {
        final Object fieldValue = mf.getFieldValue(containingObject);
        final TypeConverter enc = getEncoder(fieldValue, mf);

        final Object encoded = enc.encode(fieldValue, mf);
        if (encoded != null || opts.isStoreNulls()) {
            dbObj.put(mf.getNameToStore(), encoded);
        }
    }
570331
public static int[] executeBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
		PreparedStatement ps = null;
		try {
			ps = StatementUtil.prepareStatementForBatch(conn, sql, paramsBatch);
			return ps.executeBatch();
		} finally {
			DbUtil.close(ps);
		}
	}
1262369
private void initBatch(
      MemoryMode memMode,
      StructType partitionColumns,
      InternalRow partitionValues) {
    StructType batchSchema = new StructType();
    for (StructField f: sparkSchema.fields()) {
      batchSchema = batchSchema.add(f);
    }
    if (partitionColumns != null) {
      for (StructField f : partitionColumns.fields()) {
        batchSchema = batchSchema.add(f);
      }
    }

    if (memMode == MemoryMode.OFF_HEAP) {
      columnVectors = OffHeapColumnVector.allocateColumns(capacity, batchSchema);
    } else {
      columnVectors = OnHeapColumnVector.allocateColumns(capacity, batchSchema);
    }
    columnarBatch = new ColumnarBatch(columnVectors);
    if (partitionColumns != null) {
      int partitionIdx = sparkSchema.fields().length;
      for (int i = 0; i < partitionColumns.fields().length; i++) {
        ColumnVectorUtils.populate(columnVectors[i + partitionIdx], partitionValues, i);
        columnVectors[i + partitionIdx].setIsConstant();
      }
    }

    // Initialize missing columns with nulls.
    for (int i = 0; i < missingColumns.length; i++) {
      if (missingColumns[i]) {
        columnVectors[i].putNulls(0, capacity);
        columnVectors[i].setIsConstant();
      }
    }
  }
863016
public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException {
		if (connectionSource.isSingleConnection(tableInfo.getTableName())) {
			synchronized (this) {
				return doCallBatchTasks(connectionSource, callable);
			}
		} else {
			return doCallBatchTasks(connectionSource, callable);
		}
	}
552151
private LocalVariable getJDBCSupport(CodeBuilder b) {
        pushJDBCSupport(b);
        LocalVariable supportVar =
            b.createLocalVariable("support", TypeDesc.forClass(JDBCSupport.class));
        b.storeLocal(supportVar);
        return supportVar;
    }
1222502
@Override
    public synchronized void addBatch(final String name, final EntityEntry entry) throws DatabaseEngineException {

        try {

            final MappedEntity me = entities.get(name);

            if (me == null) {
                throw new DatabaseEngineException(String.format("Unknown entity '%s'", name));
            }

            PreparedStatement ps = me.getInsert();
            entityToPreparedStatement(me.getEntity(), ps, entry, true);

            ps.addBatch();
        } catch (final Exception ex) {
            throw new DatabaseEngineException("Error adding to batch", ex);
        }

    }
526314
private Set<String> getLinkTargetObjIDs(FieldDefinition linkDef, DBObjectBatch dbObjBatch) {
        Set<String> targObjIDs = new HashSet<>();
        for (DBObject dbObj : dbObjBatch.getObjects()) {
            List<String> objIDs = dbObj.getFieldValues(linkDef.getName());
            if (objIDs != null) {
                targObjIDs.addAll(objIDs);
            }
            Set<String> removeIDs = dbObj.getRemoveValues(linkDef.getName());
            if (removeIDs != null) {
                targObjIDs.addAll(removeIDs);
            }
        }
        return targObjIDs;
    }
1951
private void batchImport() {
        m_jdbcTemplate.batchUpdate(createInsertQuery(),
                                   new BatchPreparedStatementSetter() {
                                       public void setValues(
                                               PreparedStatement ps, int i)
                                               throws SQLException {
                                           int j = 1;
                                           for (String property : m_propertyNames) {
                                               Map params = (Map) m_batch.get(
                                                       i);
                                               ps.setObject(j++, params.get(
                                                       property));
                                           }
                                       }

                                       public int getBatchSize() {
                                           return m_batch.size();
                                       }
                                   });
    }