Offers the items to the backup map in bulk. If the memory limit
has been achieved the item data will not be kept in-memory.
Executed on the backup replica

@param dataMap the map from item ID to queue item
@see #offerBackup(Data, long)
333775
public void addAllBackup(Map<Long, Data> dataMap) {
        for (Map.Entry<Long, Data> entry : dataMap.entrySet()) {
            QueueItem item = new QueueItem(this, entry.getKey(), null);
            if (!store.isEnabled() || store.getMemoryLimit() > getItemQueue().size()) {
                item.setData(entry.getValue());
            }
            getBackupMap().put(item.getItemId(), item);
        }
    }
529740
private void offer(ResultStream<? super T> resultStream)
  {
    long expires = 600 * 1000L;

    try (OutboxAmp outbox = OutboxAmp.currentOrCreate(_serviceRef.services())) {
      HeadersAmp headers = HeadersNull.NULL;
    
      ResultStream<U> stream = build(resultStream);
    
      StreamCallMessage<U> msg;
      msg = new StreamCallMessage<U>(outbox, outbox.inbox(), headers,
                                     _serviceRef, _method, 
                                     stream,
                                     expires, _args);
      
      long timeout = 10000;

      msg.offer(timeout);
    }
  }
937692
protected final Map<K, V> copyMap(Map<K, Expirable<V>> map) {
    ClassLoader classLoader = cacheManager.getClassLoader();
    return map.entrySet().stream().collect(toMap(
        entry -> copier.copy(entry.getKey(), classLoader),
        entry -> copier.copy(entry.getValue().get(), classLoader)));
  }
1067602
public void add(Map<String, Object> map) throws SQLException {
        if (withinDataSetBatch) {
            if (batchData.size() == 0) {
                batchKeys = map.keySet();
            } else {
                if (!map.keySet().equals(batchKeys)) {
                    throw new IllegalArgumentException("Inconsistent keys found for batch add!");
                }
            }
            batchData.add(map);
            return;
        }
        int answer = executeUpdate(buildListQuery(map), new ArrayList<Object>(map.values()));
        if (answer != 1) {
            LOG.warning("Should have updated 1 row not " + answer + " when trying to add: " + map);
        }
    }
1282906
@Override
    public Data readBackupData(Data key) {
        Record record = getRecord(key);

        if (record == null) {
            return null;
        } else {
            if (partitionService.isPartitionOwner(partitionId)) {
                // set last access time to prevent
                // premature removal of the entry because
                // of idleness based expiry
                record.setLastAccessTime(Clock.currentTimeMillis());
            }
        }

        Object value = record.getValue();
        mapServiceContext.interceptAfterGet(name, value);
        // this serialization step is needed not to expose the object, see issue 1292
        return mapServiceContext.toData(value);
    }
1093205
public void setBackingMap(final Map<String, Map<String, List<Object>>> backingMap) {
        if (backingMap == null) {
            this.backingMap = new HashMap<>();
            this.possibleUserAttributeNames = new HashSet<>();
        } else {
            this.backingMap = new LinkedHashMap<>(backingMap);
            this.initializePossibleAttributeNames();
        }
    }
914312
function saveResource(callback) {
  var self = this;
  self._applyCustomDataUpdatesIfNecessary(function () {
    self.dataStore.saveResource(self, callback);
  });
}
756865
function exportResolverMap(backing: SchemaBacking) {
  backing.validate();
  return reduce(
    backing.types,
    (rmap, config, name) => {
      const fields = reduce(
        config.fields,
        (fmap, field, fieldName) => {
          if (_.isFunction(field.resolve)) {
            fmap[fieldName] = field.resolve;
          }
          return fmap;
        },
        {},
        true,
      );
      return _.keys(fields).length ? _.merge(rmap, { [name]: fields }) : rmap;
    },
    {},
    true,
  );
}
1312001
@SuppressWarnings("all")
    public static Completable save(Map pathDataMap) {
        return SingleRxXian.call("cosService", "batchCosWrite", new JSONObject() {{
            put("files", pathDataMap);
        }}).toCompletable();
    }
583072
public synchronized void putAll(Map<? extends String, ? extends XAttribute> t) {
		try {
			XAttributeMap map = deserialize();
			map.putAll(t);
			serialize(map);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
619864
protected synchronized void serialize(XAttributeMap map) throws IOException {
		storage.seek(0);
		serializer.serialize(map, storage);
		cacheMap = new WeakReference<XAttributeMap>(map);
		this.size = map.size();
		map = null;
	}
341848
public void createOrUpdateData(String indexName, String type, List<NutMap> list) {
        BulkRequestBuilder bulkRequest = getClient().prepareBulk();
        if (list.size() > 0) {
            for (NutMap nutMap : list) {
                bulkRequest.add(getClient().prepareIndex(indexName, type).setId(nutMap.getString("id")).setSource(Lang.obj2map(nutMap.get("obj"))));
            }
            bulkRequest.execute().actionGet();
        }
    }
498046
public void backupAck(long id, Address from, int topologyId) {
      BaseAckTarget ackTarget = collectorMap.get(id);
      if (ackTarget instanceof SingleKeyCollector) {
         ((SingleKeyCollector) ackTarget).backupAck(topologyId, from);
      } else if (ackTarget instanceof MultiTargetCollectorImpl) {
         ((MultiTargetCollectorImpl) ackTarget).backupAck(topologyId, from);
      }
   }
1063391
@Override
  public void offerData(OutputStream stream) {
    byte[] next = null;
    try {
      next = queue.poll(timeoutMillis, TimeUnit.MILLISECONDS);
    } catch (InterruptedException ignored) {
      // If this ever times out (unlikely given our assumption), next stays null.
    }

    try {
      // Only if next is not null nor CLOSED do we write the chunk.
      if (next != null && next != CLOSED) {
        stream.write(next);
        return;
      }
    } catch (IOException ignored) {
      // Any errors in the piped (NS)OutputStream (unlikely) fall through to the next section.
    }

    // Close the piped (NS)OutputStream and ignore any errors.
    try {
      stream.close();
    } catch (IOException ignored) {
      // Ignored.
    }
  }
1233761
public void setBackupSelectionsList(java.util.Collection<BackupSelectionsListMember> backupSelectionsList) {
        if (backupSelectionsList == null) {
            this.backupSelectionsList = null;
            return;
        }

        this.backupSelectionsList = new java.util.ArrayList<BackupSelectionsListMember>(backupSelectionsList);
    }
1056554
public boolean offer(ObjectContainer<T> item)
  {
    final long itemLength = item.getSize();

    if (currentMemory.addAndGet(itemLength) <= memoryBound) {
      if (queue.offer(item)) {
        return true;
      }
    }
    currentMemory.addAndGet(-itemLength);
    return false;
  }
88137
@Override
    public List<DataSet> dataSetBatches(int num) {
        List<List<DataSet>> list = Lists.partition(asList(), num);
        List<DataSet> ret = new ArrayList<>();
        for (List<DataSet> l : list)
            ret.add(DataSet.merge(l));
        return ret;

    }