Saves an aggregate to the repository, appending events to the corresponding stream.
430383
def save_aggregate(aggregate, concurrency: :none)
      changeset = aggregate.changeset
      events = changeset.events.map { |event| event.with_metadata(namespace: @namespace) }
      revision = aggregate.revision if concurrency == :optimistic
      stream(aggregate.class, changeset.aggregate_id).write_events(events, revision: revision)
      notify_subscribers(changeset.aggregate_id, events)
    end
1267495
@Override
    protected void saveBeans(List<ProxyActionStatus> addedBeans, List<ProxyActionStatus> modifiedBeans,
            List<ProxyActionStatus> removedBeans) {
        // CRUD operations on Target will be done through repository methods
    }
294344
private function appendToEventsForStream(&$eventsForStream, $serializedEvents)
    {
        // TODO: remove support of non array values by upcasters in next major release
        if (!is_array($serializedEvents)) {
            @trigger_error(
                'Upcasters need to return an array collection of upcasted events, ' .
                'non array return values are deprecated and support will be removed in the next major release',
                E_USER_DEPRECATED
            );

            $serializedEvents = [$serializedEvents];
        }

        foreach ($serializedEvents as $serializedEvent) {
            $eventsForStream[] = $this->eventFactory->createFromSerializedEvent($serializedEvent);
        }
    }
1362211
@SuppressWarnings("unchecked")
  @GwtIncompatible("ObjectOutputStream")
  public void saveContents(ObjectOutputStream out) throws IOException {
    out.writeObject(eachRefTypeIndexedByProperty);
    out.writeObject(interfaceToImplementors);
    out.writeObject(typesIndexedByProperty);
  }
968910
public void commit ()
    {
        // first clear our target
        clearTarget();

        // then post this event onto the queue (but only if we actually
        // accumulated some events)
        int size = _events.size();
        switch (size) {
        case 0: // nothing doing
            break;
        case 1: // no point in being compound
            _omgr.postEvent(_events.get(0));
            break;
        default: // now we're talking
            _transport = _events.get(0).getTransport();
            for (int ii = 1; ii < size; ii++) {
                _transport = _events.get(ii).getTransport().combine(_transport);
            }
            _omgr.postEvent(this);
            break;
        }
    }
465990
public function save(AggregateRoot $aggregateRoot) : void
    {
        $this->aggregates[$this->createKey($aggregateRoot->getId())] = $aggregateRoot;
        self::getLogger()->debug('Aggregate identified by [{}] has been persisted', [$aggregateRoot->getId()]);
    }
855210
@Override
  public void aggregate(final ByteBuffer buf, final int position)
  {
    final ArrayOfDoublesSketch update = selector.getObject();
    if (update == null) {
      return;
    }
    // Wrapping memory and ArrayOfDoublesUnion is inexpensive compared to union operations.
    // Maintaining a cache of wrapped objects per buffer position like in Theta sketch aggregator
    // might might be considered, but it would increase complexity including relocate() support.
    final WritableMemory mem = WritableMemory.wrap(buf, ByteOrder.LITTLE_ENDIAN);
    final WritableMemory region = mem.writableRegion(position, maxIntermediateSize);
    final Lock lock = stripedLock.getAt(ArrayOfDoublesSketchBuildBufferAggregator.lockIndex(position)).writeLock();
    lock.lock();
    try {
      final ArrayOfDoublesUnion union = ArrayOfDoublesSketches.wrapUnion(region);
      union.update(update);
    }
    finally {
      lock.unlock();
    }
  }
544326
def addSource(self, source, data):
    """"""
    self._aggregate(source, self._aggregators, data, self._result)
665518
def put_stream(self, bucket, label, stream_object, params={}):
        '''  '''
        self.claim_bucket(bucket) 
        self.connection.put_object(bucket, label, stream_object,
                                   headers=self._convert_to_meta(params))
528637
def put(self, event_type, event_data={}, **kwargs):
        
        event = dict(type=event_type, data=event_data)

        event["time"] = kwargs.get("time", datetime.utcnow().isoformat())

        if kwargs.get("id"):
            event["id"] = kwargs.get("id")

        data = json.dumps([event])

        r = requests.post(self.collector_url + 'event/put',
                          data=data,
                          headers={'content-type': 'application/json'})
        r.raise_for_status()

        return [event]
215922
private void commitAndRun(Substream winningSubstream) {
    Runnable postCommitTask = commit(winningSubstream);

    if (postCommitTask != null) {
      postCommitTask.run();
    }
  }
882970
@Override
	public void onAfterSave(Object source, DBObject dbo) {
		this.persister.onAfterSave(source, dbo);
	}
1305605
public function saveAggregateRoots()
    {
        foreach ($this->aggregateRoots as $aggregateRootHash => $aggregateRoot) {
            $this->aggregateRootSaveCallbacks[$aggregateRootHash]->save($aggregateRoot);
        }
    }
1186397
@Override
	public void saveTo(final OutputStream out) {
		try {
			Util.copy(getInputStream(), out);
		} catch (IOException e) {
			throw new MechanizeException(e);
		}
	}
1157734
def dump_stream(self, iterator, stream):
        
        batches = (self._create_batch(series) for series in iterator)
        super(ArrowStreamPandasSerializer, self).dump_stream(batches, stream)
799837
def _save(self):
        
        collection = JSONClientValidated('assessment',
                                         collection='AssessmentTaken',
                                         runtime=self._runtime)
        collection.save(self._my_map)
702004
public function save()
	{
		if ($this->hasEventHandler('onBeforeSave')) {
			$this->onBeforeSave(new CEvent($this));
		}
		$this->flush();
		if ($this->hasEventHandler('onAfterSave')) {
			$this->onAfterSave(new CEvent($this));
		}
	}