tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micael Capitão (JIRA) <j...@apache.org>
Subject [jira] [Commented] (TEPHRA-99) Make "long running" transactions usable with TransactionContext
Date Thu, 14 Sep 2017 16:45:00 GMT

    [ https://issues.apache.org/jira/browse/TEPHRA-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16166560#comment-16166560

Micael Capitão commented on TEPHRA-99:

"I have a use case that does not require long running write transactions but does require
a "long running read transaction".
In my use case I am serving HBase data through a REST API. The data is served to the user
in pages (to simplify we can think of it as just a full table scan, served in pages). On each
request I have a "pageInfo" that has, essentially, the last row for that page and the encoded
transaction. With the last row information I can resume the scan but I have no way of injecting
back the encoded transaction so I cannot have a checkpoint isolated view that is consistent
throughout all the pages.

Digging Tephra's code it seems there isn't really any impediment to achieve this. The only
impediment is that functionality not being exposed to the client facing API.
One possible solution would be to just use the TransactionContext for the first page and extract
the transaction; and on the subsequent calls completely forget about TransactionContext and
inject the transaction directly on the Scan (scan.setAttribute(TxConstants.TX_OPERATION_ATTRIBUTE_KEY,
<my transaction>)). I can workaround with something like that but it seems a bit odd.

> Make "long running" transactions usable with TransactionContext
> ---------------------------------------------------------------
>                 Key: TEPHRA-99
>                 URL: https://issues.apache.org/jira/browse/TEPHRA-99
>             Project: Tephra
>          Issue Type: Improvement
>          Components: core
>            Reporter: Gary Helmling
>            Assignee: Gary Helmling
> "Long running" transactions (type == LONG) are supported by the Tephra {{TransactionManager}},
but {{TransactionContext}} does not expose any way for clients to interact with them.  I think
this will require a couple changes:
> * add a {{startLong()}} method to TransactionContext
> * add a constructor to TransactionContext that takes an existing {{Transaction}} instance.
 Since long running transactions are often used in map reduce processing, the process committing
the transaction may be different from the process that started the transaction.  In this situation,
we need a way to pass the serialized transaction all the way through to the other process.
> Regarding map reduce support, we could use additional utilities or support in place to
make transactions easier to use with map reduce.  But this would at least serve as a first

This message was sent by Atlassian JIRA

View raw message