Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTable.incrementColumnValue()


        }
        long totalDeletes = deletes.size();
        scanner.close();
        messages.delete(deletes);
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -(totalDeletes - deletes.size()));
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
        mailboxes.close();
        messages.close();
    }

    private Map<Long, MessageMetaData> createMetaData(List<Message<UUID>> uids) {
View Full Code Here


    @Override
    public long nextModSeq(MailboxSession session, Mailbox<UUID> mailbox) throws MailboxException {
        HTable mailboxes = null;
        try {
            mailboxes = new HTable(conf, MAILBOXES_TABLE);
            long newValue = mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
            return newValue;
        } catch (IOException e) {
            throw new MailboxException("lastUid", e);
        } finally {
            if (mailboxes != null) {
View Full Code Here

    @Override
    public long nextUid(MailboxSession session, Mailbox<UUID> mailbox) throws MailboxException {
        HTable mailboxes = null;
        try {
            mailboxes = new HTable(conf, MAILBOXES_TABLE);
            long newValue = mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_LASTUID, 1);
            mailboxes.close();
            return newValue;
        } catch (IOException e) {
            throw new MailboxException("lastUid", e);
        } finally {
View Full Code Here

            mailboxes = new HTable(conf, MAILBOXES_TABLE);
            /** TODO: also implement/update the message count for this mailbox
             *  and implement countMessages with get.
             */
            Delete delete = new Delete(messageRowKey(message));
            mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
            messages.delete(delete);

        } catch (IOException ex) {
            throw new MailboxException("Delete of message " + message + " failed in mailbox " + mailbox, ex);
        } finally {
View Full Code Here

                out.write(b);
            }
            in.close();
            out.close();
            // increase the message count for the current mailbox
            mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, 1);
            return new SimpleMessageMetaData(message);
        } catch (IOException ex) {
            throw new MailboxException("Error setting flags for messages in " + mailbox, ex);
        } finally {
            if (messages != null) {
View Full Code Here

        //TODO: do I have to check if the message is flagged for delete here?
        HTable messages = new HTable(conf, MESSAGES_TABLE);
        HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
        Delete delete = new Delete(messageRowKey(mailbox.getMailboxId(), uid));
        messages.delete(delete);
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
        mailboxes.close();
        messages.close();
    }
View Full Code Here

        HTable messages = new HTable(conf, MESSAGES_TABLE);
        HTable mailboxes = new HTable(conf, MAILBOXES_TABLE);
        Delete delete = new Delete(messageRowKey(mailbox.getMailboxId(), uid));
        messages.delete(delete);
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_MESSAGE_COUNT, -1);
        mailboxes.incrementColumnValue(mailboxRowKey(mailbox.getMailboxId()), MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, 1);
        mailboxes.close();
        messages.close();
    }

    private void deleteDeletedMessagesInMailboxBetweenUIDs(Mailbox<UUID> mailbox, long fromUid, long toUid) throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.