@Override public boolean addAll(int index, Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(index, c); } else { return super.addAll(index, c); } }
@Override public boolean addAll(Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(c); } else { return super.addAll(c); } }
@Override public boolean addAll(int index, Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(index, c); } else { return super.addAll(index, c); } }
@Override public boolean addAll(Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(c); } else { return super.addAll(c); } }
@Override public boolean addAll(int index, Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(index, c); } else { return super.addAll(index, c); } }
@Override public boolean addAll(Collection<? extends Long> c) { if (fullImpl != null) { return fullImpl.addAll(c); } else { return super.addAll(c); } }
public static DateTimeColumn create(String fileName, LongArrayList dateTimes) { DateTimeColumn column = new DateTimeColumn(fileName, dateTimes.size()); column.data.addAll(dateTimes); return column; }
invalid.addAll(timedOut); for (long tx : timedOut) { committingChangeSets.remove(tx);
invalid.addAll(timedOut); for (long tx : timedOut) { committingChangeSets.remove(tx);
/** * Restore the initial in-memory transaction state from a snapshot. */ private void restoreSnapshot(TransactionSnapshot snapshot) { LOG.info("Restoring transaction state from snapshot at " + snapshot.getTimestamp()); Preconditions.checkState(lastSnapshotTime == 0, "lastSnapshotTime has been set!"); Preconditions.checkState(readPointer == 0, "readPointer has been set!"); Preconditions.checkState(lastWritePointer == 0, "lastWritePointer has been set!"); Preconditions.checkState(invalid.isEmpty(), "invalid list should be empty!"); Preconditions.checkState(inProgress.isEmpty(), "inProgress map should be empty!"); Preconditions.checkState(committingChangeSets.isEmpty(), "committingChangeSets should be empty!"); Preconditions.checkState(committedChangeSets.isEmpty(), "committedChangeSets should be empty!"); LOG.info("Restoring snapshot of state: " + snapshot); lastSnapshotTime = snapshot.getTimestamp(); readPointer = snapshot.getReadPointer(); lastWritePointer = snapshot.getWritePointer(); invalid.addAll(snapshot.getInvalid()); inProgress.putAll(txnBackwardsCompatCheck(defaultLongTimeout, longTimeoutTolerance, snapshot.getInProgress())); committingChangeSets.putAll(snapshot.getCommittingChangeSets()); committedChangeSets.putAll(snapshot.getCommittedChangeSets()); }
/** * Restore the initial in-memory transaction state from a snapshot. */ private void restoreSnapshot(TransactionSnapshot snapshot) { LOG.info("Restoring transaction state from snapshot at " + snapshot.getTimestamp()); Preconditions.checkState(lastSnapshotTime == 0, "lastSnapshotTime has been set!"); Preconditions.checkState(readPointer == 0, "readPointer has been set!"); Preconditions.checkState(lastWritePointer == 0, "lastWritePointer has been set!"); Preconditions.checkState(invalid.isEmpty(), "invalid list should be empty!"); Preconditions.checkState(inProgress.isEmpty(), "inProgress map should be empty!"); Preconditions.checkState(committingChangeSets.isEmpty(), "committingChangeSets should be empty!"); Preconditions.checkState(committedChangeSets.isEmpty(), "committedChangeSets should be empty!"); LOG.info("Restoring snapshot of state: " + snapshot); lastSnapshotTime = snapshot.getTimestamp(); readPointer = snapshot.getReadPointer(); lastWritePointer = snapshot.getWritePointer(); invalid.addAll(snapshot.getInvalid()); inProgress.putAll(txnBackwardsCompatCheck(defaultLongTimeout, longTimeoutTolerance, snapshot.getInProgress())); committingChangeSets.putAll(snapshot.getCommittingChangeSets()); committedChangeSets.putAll(snapshot.getCommittedChangeSets()); }
@Override public LongColumn copy() { LongColumn copy = emptyCopy(size()); copy.data.addAll(data); copy.setComment(comment()); return copy; }
@Override public LongArrayList recommendInternal(ClickData clickData) { //filter out items that have been release too long ago //first, retrieve the recommendation results of the underlying algorithm LongArrayList rec = mainStrategy.recommendInternal(clickData); //create lists of filtered items and retained items LongArrayList filteredRec = new LongArrayList(); LongArrayList filteredRecNotMatch = new LongArrayList(); //iterate over the recommendation list of the underlying strategy for (int j = 0; j < rec.size(); j++) { long i = rec.getLong(j); // filter item based on the difference between the current (simulation) time and // the time of publication if ((clickData.click.timestamp.getTime() - timestampMap.get(i)) <= filterTime && (clickData.click.timestamp.getTime() - timestampMap.get(i)) > 0) { filteredRec.add(i); } else if (fallback) { //if we have a fallback, add the filtered item to the fallback list filteredRecNotMatch.add(i); } } //merge the filtered list with the fallback list (empty in case fallback==false) filteredRec.addAll(filteredRecNotMatch); //return the filtered list return filteredRec; }
@Override public LongArrayList recommendInternal(ClickData clickData) { //filter out items that have not received at last one click in the last time frame //first, retrieve the recommendation results of the underlying algorithm LongArrayList rec = mainStrategy.recommendInternal(clickData); //create lists of filtered items and retained items LongArrayList filteredRec = new LongArrayList(); LongArrayList filteredRecNotMatch = new LongArrayList(); //iterate over the recommendation list of the underlying strategy for (int j = 0; j < rec.size(); j++) { long i = rec.getLong(j); //filter items whose last-clicked timestamp is too old if ((itemClickTime.containsKey(i)) && ((clickData.click.timestamp.getTime()-itemClickTime.get(i))<filterTime)) { filteredRec.add(i); } else if (fallback) { //if we have a fallback, add the filtered item to the fallback list filteredRecNotMatch.add(i); } } //merge the filtered list with the fallback list (empty in case fallback==false) filteredRec.addAll(filteredRecNotMatch); //return the filtered list return filteredRec; }
allRecInSameCategory.addAll(allRecNotSameCategory);
assert(prevList.get(0) == node); int nodeLength = node.length(); node.kmers.addAll(kmers); kmers = node.kmers; node.weight.addAll(weight); additionalKmerOffsets = new IntArrayList(node.additionalKmers.size()); additionalKmers.addAll(node.additionalKmers); additionalKmerOffsets.addAll(node.additionalKmerOffsets);
LongArrayList toCollapsePathKmers = new LongArrayList(toCollapse.pathLength); for (KmerPathSubnode sn : traversalForward ? toCollapse.toSubnodeNextPath() : toCollapse.toSubnodePrevPath()) { toCollapsePathKmers.addAll(sn.node().pathKmers());
@Override public LongArrayList recommendInternal(ClickData clickData) { //filter out items with low overall click counts //first, retrieve the recommendation results of the underlying algorithm LongArrayList rec = mainStrategy.recommendInternal(clickData); //create lists of filtered items and retained items LongArrayList filteredRec = new LongArrayList(); LongArrayList filteredRecNotMatch = new LongArrayList(); //iterate over the recommendation list of the underlying strategy for (int j = 0; j < rec.size(); j++) { long i = rec.getLong(j); //filter items if they do not have enough clicks if ((itemClickCount.containsKey(i)) && (itemClickCount.get(i) >= minClickCount)) { filteredRec.add(i); } else if (fallback) { //if we have a fallback, add the filtered item to the fallback list filteredRecNotMatch.add(i); } } //merge the filtered list with the fallback list (empty in case fallback==false) filteredRec.addAll(filteredRecNotMatch); //return the filtered list return filteredRec; }
additionalKmerOffsets = toMerge.additionalKmerOffsets; } else if (toMerge.additionalKmers != null) { additionalKmers.addAll(toMerge.additionalKmers); additionalKmerOffsets.addAll(toMerge.additionalKmerOffsets); additionalKmerOffsets = new IntArrayList(toMerge.kmers.size()); } else { additionalKmers.addAll(toMerge.kmers);