Using Accumulo 1.4.3, I have a table configured to keep Many (maxint) versions of each key, with the version being interpreted as a timestamp. Given a set of times I'm interested in, I can pull out the data at exactly those times with no problem.

But I also want another behavior: if I don't have a particular time, I want to respond with the most recent version of the data. I'm trying to use this code:

  void setScannerForTimestamp(Scanner scanner, DateTime timestamp) {
    if (timestamp == null) {
        IteratorSetting cfg = new IteratorSetting(10, "vers", 
VersioningIterator.class)
        VersioningIterator.setMaxVersions(cfg, 1)
        scanner.addScanIterator(cfg)
    } else {
      TimestampSetIterator.setupIterator(scanner, timestamp)
    }
  }

where TimestampSetIterator is my own custom iterator that's already working.

In my table, I have 76063 different data points, each with 31 versions. When I pass a null timestamp, I expect to get back 76063 entries. Instead, I get 76063*31 = 2357953 entries. That is, it looks like the table is ignoring the part where I setMaxVersions to 1. What am I missing?

Reply via email to