// TODO(ohler): make this scalable, e.g. by adding pagination
public List<RemoteConvWavelet> getAllWavelets(CheckedTransaction tx, StableUserId userId)
throws RetryableFailure, PermanentFailure {
log.info("getAllWaves(" + userId + ")");
CheckedIterator i = tx.prepare(new Query(WAVELET_ENTITY_KIND)
.setAncestor(makeRootKey(userId))
.addSort(WAVELET_LAST_MODIFIED_MILLIS_PROPERTY, Query.SortDirection.DESCENDING))
.asIterator();
ImmutableList.Builder<RemoteConvWavelet> b = ImmutableList.builder();
while (i.hasNext()) {
b.add(parseWaveletEntity(i.next()));
}
List<RemoteConvWavelet> out = b.build();
log.info("Got " + out.size() + " wavelets");
return out;
}