Make a new storage, to associate the given ids with an object of class
dataclass.

@param ids DBIDs to store data for
@param hints Hints for the storage manager
@return new data store
765264
public static WritableDBIDDataStore makeDBIDStorage(DBIDs ids, int hints) {
    return DataStoreFactory.FACTORY.makeDBIDStorage(ids, hints);
  }
630462
public void collectIds(List<String> ids) {
    ids.add(attribute("id"));
    for (Element child : elements) {
      child.collectIds(ids);
    }
  }
131103
public static ArrayDBIDs ensureArray(DBIDs ids) {
    return ids instanceof ArrayDBIDs ? (ArrayDBIDs) ids : newArray(ids);
  }
253006
public final function setIds(array $ids): void
    {
        foreach ($ids as $id) {
            $this->ids[] = (int) $id;
        }
    }
845891
private static String generateUniqueId(Set<String> ids, String idBase) {
		String id = idBase;
		int counter = 1;
		while (ids.contains(id)) {
			id = idBase + String.valueOf(counter++);
		}
		
		// put the newly generated one into the set
		ids.add(id);
		return id;
	}
728260
public static ArrayModifiableDBIDs[] partitionsFromIntegerLabels(DBIDs ids, IntegerDataStore assignment, int k) {
    int[] sizes = new int[k];
    for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
      sizes[assignment.intValue(iter)] += 1;
    }
    ArrayModifiableDBIDs[] clusters = new ArrayModifiableDBIDs[k];
    for(int i = 0; i < k; i++) {
      clusters[i] = DBIDUtil.newArray(sizes[i]);
    }
    for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
      clusters[assignment.intValue(iter)].add(iter);
    }
    return clusters;
  }
1099990
public static void add(Id id, Map<String, Object> data){
        DDSCluster.call(new MessageBean(MongoDBDDS.class,
                id.getDatabase(),id.getCollection(),id.getEntity(),
                "add",data));
    }
736679
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation, DBIDs ids) {
    ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation));
    for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
      c.put(relation.get(iter));
    }
    return c;
  }
5422
public void setConfigurationIds(java.util.Collection<String> configurationIds) {
        if (configurationIds == null) {
            this.configurationIds = null;
            return;
        }

        this.configurationIds = new java.util.ArrayList<String>(configurationIds);
    }
612077
public static ArrayDBIDs[] randomSplit(DBIDs ids, int p, RandomFactory rnd) {
    return randomSplit(ids, p, rnd.getSingleThreadedRandom());
  }
93893
public static DBIDVar randomSample(DBIDs ids, Random random) {
    return DBIDUtil.ensureArray(ids).assignVar(random.nextInt(ids.size()), DBIDUtil.newVar());
  }
1050212
public List<T> list(List<Long> ids)
    {
        List<T> ret = new ArrayList<T>();

        if(ids != null)
        {
            for(Long id : ids)
            {
                T resource = get(id);
                if(resource != null)
                    ret.add(resource);
            }
        }

        return ret;
    }
368256
public void addIdHasContainer(HasContainer hasContainer) {
        Preconditions.checkState(BaseStrategy.SUPPORTED_ID_BI_PREDICATE.contains(hasContainer.getBiPredicate()), "Only " + BaseStrategy.SUPPORTED_ID_BI_PREDICATE.toString() + " is supported, found " + hasContainer.getBiPredicate().getClass().toString());
        Object rawId = hasContainer.getValue();
        if (rawId instanceof Collection) {
            @SuppressWarnings("unchecked")
            Collection<Object> ids = (Collection<Object>) rawId;
            Set<String> idLabels = new HashSet<>();
            for (Object id : ids) {
                if (id instanceof RecordId) {
                    RecordId recordId = (RecordId) id;
                    idLabels.add(recordId.getSchemaTable().toString());
                } else if (id instanceof Element) {
                    SqlgElement sqlgElement = (SqlgElement) id;
                    RecordId recordId = (RecordId) sqlgElement.id();
                    idLabels.add(recordId.getSchemaTable().toString());
                } else if (id instanceof String) {
                    RecordId recordId = RecordId.from(id);
                    idLabels.add(recordId.getSchemaTable().toString());
                } else {
                    throw new IllegalStateException("id must be an Element or a RecordId, found " + id.getClass().toString());
                }
            }
            if (hasContainer.getBiPredicate() == Contains.without) {
                //The id's label needs to be added to previous labelHasContainers labels.
                //without indicates that the label needs to be queried along with the rest, 'or' logic rather than 'and'.
                if (!this.labelHasContainers.isEmpty()) {
                    Object previousHasContainerLabels = this.labelHasContainers.get(this.labelHasContainers.size() - 1).getValue();
                    List<String> mergedLabels;
                    if (previousHasContainerLabels instanceof Collection) {
                        @SuppressWarnings("unchecked") Collection<String> labels = (Collection<String>) previousHasContainerLabels;
                        mergedLabels = new ArrayList<>(labels);
                    } else {
                        String label = (String) previousHasContainerLabels;
                        mergedLabels = new ArrayList<>();
                        mergedLabels.add(label);
                    }
                    mergedLabels.addAll(idLabels);
                    this.labelHasContainers.set(this.labelHasContainers.size() - 1, new HasContainer(T.label.getAccessor(), P.within(mergedLabels)));
                }
            } else {
                this.labelHasContainers.add(new HasContainer(T.label.getAccessor(), P.within(idLabels)));
            }
        } else {
            RecordId recordId;
            if (rawId instanceof RecordId) {
                recordId = (RecordId) rawId;
            } else if (rawId instanceof Element) {
                SqlgElement sqlgElement = (SqlgElement) rawId;
                recordId = (RecordId) sqlgElement.id();
            } else if (rawId instanceof String) {
                recordId = RecordId.from(rawId);
            } else {
                throw new IllegalStateException("id must be an Element or a RecordId, found " + id.getClass().toString());
            }
            if (hasContainer.getBiPredicate() == Compare.neq) {
                if (!this.labelHasContainers.isEmpty()) {
                    Object previousHasContainerLabels = this.labelHasContainers.get(this.labelHasContainers.size() - 1).getValue();
                    List<String> mergedLabels;
                    if (previousHasContainerLabels instanceof Collection) {
                        @SuppressWarnings("unchecked") Collection<String> labels = (Collection<String>) previousHasContainerLabels;
                        mergedLabels = new ArrayList<>(labels);
                    } else {
                        String label = (String) previousHasContainerLabels;
                        mergedLabels = new ArrayList<>();
                        mergedLabels.add(label);
                    }
                    mergedLabels.add(recordId.getSchemaTable().toString());
                    this.labelHasContainers.set(this.labelHasContainers.size() - 1, new HasContainer(T.label.getAccessor(), P.within(mergedLabels)));
                }
            } else {
                this.labelHasContainers.add(new HasContainer(T.label.getAccessor(), P.eq(recordId.getSchemaTable().toString())));
            }
        }
        this.idHasContainers.add(hasContainer);
    }
236409
public void setId3Insertions(java.util.Collection<Id3Insertion> id3Insertions) {
        if (id3Insertions == null) {
            this.id3Insertions = null;
            return;
        }

        this.id3Insertions = new java.util.ArrayList<Id3Insertion>(id3Insertions);
    }
1061475
public void setDatastoreSummaries(java.util.Collection<DatastoreSummary> datastoreSummaries) {
        if (datastoreSummaries == null) {
            this.datastoreSummaries = null;
            return;
        }

        this.datastoreSummaries = new java.util.ArrayList<DatastoreSummary>(datastoreSummaries);
    }
68281
public void setAllocationIds(java.util.Collection<String> allocationIds) {
        if (allocationIds == null) {
            this.allocationIds = null;
            return;
        }

        this.allocationIds = new com.amazonaws.internal.SdkInternalList<String>(allocationIds);
    }
192642
private ArrayDBIDs updateKNNsAndRkNNs(DBIDs ids) {
    ArrayModifiableDBIDs rkNN_ids = DBIDUtil.newArray();
    DBIDs oldids = DBIDUtil.difference(relation.getDBIDs(), ids);
    for(DBIDIter id = oldids.iter(); id.valid(); id.advance()) {
      KNNList oldkNNs = storage.get(id);
      double knnDist = oldkNNs.getKNNDistance();
      // look for new kNNs
      KNNHeap heap = null;
      for(DBIDIter newid = ids.iter(); newid.valid(); newid.advance()) {
        double dist = distanceQuery.distance(id, newid);
        if(dist <= knnDist) {
          // New id changes the kNNs of oldid.
          heap = heap != null ? heap : DBIDUtil.newHeap(oldkNNs);
          heap.insert(dist, newid);
        }
      }
      // kNNs for oldid have changed:
      if(heap != null) {
        KNNList newkNNs = heap.toKNNList();
        storage.put(id, newkNNs);

        // get the difference
        ModifiableDoubleDBIDList added = DBIDUtil.newDistanceDBIDList(),
            removed = DBIDUtil.newDistanceDBIDList();
        DoubleDBIDListIter olditer = oldkNNs.iter(), newiter = newkNNs.iter();
        while(olditer.valid() && newiter.valid()) {
          if(DBIDUtil.equal(olditer, newiter)) {
            olditer.advance();
            newiter.advance();
            continue;
          }
          double newd = newiter.doubleValue(), oldd = olditer.doubleValue();
          if(newd < oldd || (newd == oldd && !oldkNNs.contains(newiter))) {
            added.add(newiter.doubleValue(), newiter);
            newiter.advance();
          }
          else if(oldd < newd || (oldd == newd && !newkNNs.contains(olditer))) {
            removed.add(olditer.doubleValue(), olditer);
            olditer.advance();
          }
          else {
            throw new IllegalStateException("Unexpected third case, needs debug!");
          }
        }
        for(; olditer.valid(); olditer.advance()) {
          removed.add(olditer.doubleValue(), olditer);
        }
        for(; newiter.valid(); newiter.advance()) {
          added.add(newiter.doubleValue(), newiter);
        }
        // add new RkNN
        for(DoubleDBIDListIter newnn = added.iter(); newnn.valid(); newnn.advance()) {
          materialized_RkNN.get(newnn).add(DBIDUtil.newPair(newnn.doubleValue(), id));
        }
        // remove old RkNN
        for(DoubleDBIDListIter oldnn = removed.iter(); oldnn.valid(); oldnn.advance()) {
          materialized_RkNN.get(oldnn).remove(DBIDUtil.newPair(oldnn.doubleValue(), id));
        }

        rkNN_ids.add(id);
      }
    }
    return rkNN_ids;
  }