Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Formalize a way for modifying state in an in-memory Row result #5

Open
Lemmsjid opened this issue May 16, 2012 · 0 comments
Open

Formalize a way for modifying state in an in-memory Row result #5

Lemmsjid opened this issue May 16, 2012 · 0 comments
Assignees

Comments

@Lemmsjid
Copy link
Contributor

Sometimes you want to do the following:

  • Fetch row from Hbase
  • Modify data and put back into Hbase
  • Use the modified row in further pieces of code

HPaste assumes rows returned from Hbase are immutable and there is therefore no way to do this without injecting another step, with is to re-fetch the data from Hbase. This is in most cases a preferred way to do things, because in-memory state increases the chance of subtle bugs creeping into the system.

That said, there are performance critical hotspots where this needs to be supported.

The tentative way to do this is to simply provide a copy constructor for an HRow object, along with direct setters for column and row families. In other words, don't manipulate the state of the original object, instead provide a scenario where you can copy the object and manipuate the state during the copy operation. This will reduce the number of subtle bugs that can arrive from doing things like caching ancillary results in HRow objects.

@ghost ghost assigned Lemmsjid May 16, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant