This method enqueues aggregate op for future invocation.
Key value will be used to batch individual ops

@param op
@param key
965232
@Override
    public void aggregate(Aggregate op, long key) {
        int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread();
        if (opCounter.get() == null)
            opCounter.set(new AtomicLong(0));

        // we enqueue op for specific device here
        aggregates.get(deviceId).add(new AggregateDescriptor(op, key, opCounter.get().getAndIncrement()));
    }
595222
public void map(K key, V value,
                  OutputCollector<V, K> output, Reporter reporter)
    throws IOException {
    output.collect(value, key);
  }
699974
public void push(CollectorRegistry registry, String job, Map<String, String> groupingKey) throws IOException {
    doRequest(registry, job, groupingKey, "PUT");
  }
372563
public void store(K key, V object) {
		if (isCachingEnabled()) {
			CachedObject<V> co = new CachedObject<V>(object);
			storeCachedObject(key, co);
		}
	}
456775
private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row)
    {
        Key key = ((TableImpl) schemaTable).createKey(row, false);

        TableOperation ops = tableAPI.getTableOperationFactory().createPut(row, Choice.NONE, true);

        if (operations.containsKey(key))
        {
            operations.get(key).add(ops);

        }
        else
        {
            List<TableOperation> operation = new ArrayList<TableOperation>();
            operation.add(ops);
            operations.put(key, operation);
        }
    }
846371
public void remove(String key) {
        String processedKey = processKey(key);
        String orderKey = null;

        // removing key set for all positions
        for (int i = 0; i < this.order.size(); i++) {
            orderKey = this.order.get(i);

            if (orderKey != null && orderKey.equals(processedKey) == true) {
                this.order.remove(i);
            }
        }

        this.types.remove(processedKey);
        this.direction.remove(processedKey);
        this.values.remove(processedKey);
    }
258154
public void output(K key, V value) throws IOException {
    collector.collect(key, value);
  }
106470
function AggregateByKey(sc, dependencies, reducer, combiner, init, args) {
  Dataset.call(this, sc, dependencies);
  this.combiner = combiner;
  this.reducer = reducer;
  this.init = init;
  this.args = args;
  this.shuffling = true;
  this.executed = false;
  this.buffer = {};
  this.type = 'AggregateByKey';
}
533574
@SuppressWarnings("unchecked")
    public void setOps(final DBObject ops) {
        this.ops = (Map<String, Map<String, Object>>) ops;
    }
927194
public void registerOngoingOperation(
			final K operationKey,
			final CompletableFuture<R> operationResultFuture) {
		final ResultAccessTracker<R> inProgress = ResultAccessTracker.inProgress();
		registeredOperationTriggers.put(operationKey, inProgress);
		operationResultFuture.whenComplete((result, error) -> {
			if (error == null) {
				completedOperations.put(operationKey, inProgress.finishOperation(Either.Right(result)));
			} else {
				completedOperations.put(operationKey, inProgress.finishOperation(Either.Left(error)));
			}
			registeredOperationTriggers.remove(operationKey);
		});
	}
1193397
private void queueUpload(String key, File file) {
        if (mUploadQueue == null)
            mUploadQueue = new ArrayDeque<>();
        mUploadQueue.add(new Pair<>(key, file));
    }
1297353
private List<KeyedMessageWithType> invokeOperation(final Object instance, final Operation op, final KeyedMessage message) {
        if(instance != null) { // possibly passivated ...
            List<KeyedMessageWithType> result;
            try {
                if(traceEnabled)
                    LOGGER.trace("invoking \"{}\" for {}", SafeString.valueOf(instance), message);
                statCollector.messageDispatched(message);
                result = op == Operation.output ? prototype.invokeOutput(instance) : prototype.invoke(instance, message);
                statCollector.messageProcessed(message);
            } catch(final ContainerException e) {
                result = null;
                LOGGER.warn("the container for " + clusterId + " failed to invoke " + op + " on the message processor " +
                    SafeString.valueOf(prototype) + (op == Operation.handle ? (" with " + objectDescription(message)) : ""), e);
                statCollector.messageFailed(false);
            }
            // this is an exception thrown as a result of the reflected call having an illegal argument.
            // This should actually be impossible since the container itself manages the calling.
            catch(final IllegalArgumentException e) {
                result = null;
                LOGGER.error("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) +
                    " due to a declaration problem. Are you sure the method takes the type being routed to it? If this is an output operation are you sure the output method doesn't take any arguments?",
                    e);
                statCollector.messageFailed(true);
            }
            // The app threw an exception.
            catch(final DempsyException e) {
                result = null;
                LOGGER.warn("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) +
                    " because an exception was thrown by the Message Processeor itself.", e);
                statCollector.messageFailed(true);
            }
            // RuntimeExceptions bookeeping
            catch(final RuntimeException e) {
                result = null;
                LOGGER.error("the container for " + clusterId + " failed when trying to invoke " + op + " on " + objectDescription(instance) +
                    " due to an unknown exception.", e);
                statCollector.messageFailed(false);

                if(op == Operation.handle)
                    throw e;
            }
            return result;
        }
        return null;
    }
835484
public PutOperation<K, V> applyOperation(K key, PutOperation<K, V> existing, Operation<K, V> operation) {
    final Result<K, V> newValue = operation.apply(existing);
    if (newValue == null) {
      return null;
    } else {
      return newValue.asOperationExpiringAt(Long.MAX_VALUE);
    }
  }
921755
@Override
    public V cacheObject(final long key, @NotNull final V x) {
        pushedOutValue = null;
        if (firstGenerationQueue.put(key, x) == null) {
            secondGenerationQueue.remove(key);
        }
        return pushedOutValue;
    }
852849
@Override
  public void resetOperation(Operation op)
  {
    LOGGER.debug("Reset Loader");

    if (op.equals(_op))
    {
      //no-op
      return;
    }

    LOGGER.debug("Operation is changing from {} to {}", _op, op);
    _op = op;

    if (_stage != null)
    {
      try
      {
        queuePut(_stage);
      }
      catch (InterruptedException ex)
      {
        LOGGER.error(_stage.getId(), ex);
      }
    }

    _stage = new BufferStage(this, _op, _csvFileBucketSize, _csvFileSize);

  }
644338
public void execute(FeatureOperation op) {
		if (newFeatures != null && newFeatures.length > 0) {
			operationQueue.add(op);
			for (Feature newFeature : newFeatures) {
				op.execute(newFeature);
			}
		}
	}
1348526
public void add(Operation operation) {
		synchronized (operations) {
			operations.addLast(operation);
			if (waiting)
				sp.unblock();
		}
		if (autoStart && operations.size() == 1 && getStatus() == Task.STATUS_NOT_STARTED)
			start();
	}