You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by dashengju <gi...@git.apache.org> on 2014/12/26 04:59:06 UTC
[GitHub] storm pull request: [STORM-607] storm-hbase HBaseMapState should s...
GitHub user dashengju opened a pull request:
https://github.com/apache/storm/pull/364
[STORM-607] storm-hbase HBaseMapState should support user to customize the hbase-key & hbase-qualifier
In HBaseMapState, user can specific hbase-qualifier by Options, and the hbase-key is composed by all the keys by multiPut's List<Object> keys.
for example, If I have stream with <deal_id, date, pv>, grouped by <deal_id, date>, then, the hbase-key is composed by<deal_id, date>, the hbase-qualifier is pv.
But when I want hbase-key is deal_id, and hbase-qualifier is pv+date, HBaseMapState can not support this.
==================================================================================
With this patch, user can customize the hbase-key & hbase-qualifier by interface TridentHBaseMapMapper.
As a old user, can use the old style like this:
HBaseMapState.Options hbaseOptions = new HBaseMapState.Options();
hbaseOptions.mapMapper = new SimpleTridentHBaseMapMapper("pv");
Also, you can customize the hbase-key & hbase-qualifier like this:
public class WithDateHBaseMapMapper implements TridentHBaseMapMapper {
private String qualifierPrefix;
public WithDateHBaseMapMapper(String qualifierPrefix) {
this.qualifierPrefix = qualifierPrefix;
}
@Override
public byte[] rowKey(List<Object> keys) {
String dealId = String.valueOf(keys.get(0));
return dealId.getBytes();
}
@Override
public String qualifier(List<Object> keys) {
String dateStr = String.valueOf(keys.get(1));
return qualifierPrefix + "_" + dateStr;
}
}
HBaseMapState.Options hbaseOptions = new HBaseMapState.Options();
hbaseOptions.mapMapper = new WithDateHBaseMapMapper("pv");
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dashengju/storm branch_for_storm_hbase_extend
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/364.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #364
----
commit e6f509f82c30eaed5f2b3a6db5340d1438020adc
Author: dashengju <da...@qq.com>
Date: 2014-12-26T03:53:19Z
make user to specific the key and qualifier of storm-hbase HBaseMapState
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-607] storm-hbase HBaseMapState should s...
Posted by knusbaum <gi...@git.apache.org>.
Github user knusbaum commented on the pull request:
https://github.com/apache/storm/pull/364#issuecomment-87723164
This looks ok to me, but it's not my area, so I'll wait for someone else to look it over as well before I +1.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-607] storm-hbase HBaseMapState should s...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/storm/pull/364
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-607] storm-hbase HBaseMapState should s...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on the pull request:
https://github.com/apache/storm/pull/364#issuecomment-97205245
@dashengju Sorry the review took so long. The changes look good to me +1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-607] storm-hbase HBaseMapState should s...
Posted by dashengju <gi...@git.apache.org>.
Github user dashengju commented on the pull request:
https://github.com/apache/storm/pull/364#issuecomment-68693496
@ptgoetz , can you help to review this PR?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---