messages = new HTable(conf, MESSAGES_TABLE);
/* Limit the number of entries scanned to just the mails in this mailbox */
Scan scan = new Scan(messageRowKey(mailbox.getMailboxId(), Long.MAX_VALUE),
messageRowKey(mailbox.getMailboxId(), 0));
scan.addFamily(MESSAGES_META_CF);
scan.setFilter(new SingleColumnValueExcludeFilter(MESSAGES_META_CF, FLAGS_SEEN, CompareOp.EQUAL, MARKER_MISSING));
scan.setCaching(messages.getScannerCaching() * 2);
scan.setMaxVersions(1);
scanner = messages.getScanner(scan);
long count = 0;
Result result;