[
https://issues.apache.org/jira/browse/PHOENIX-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14254952#comment-14254952
]
James Taylor commented on PHOENIX-1536:
---------------------------------------
Thanks for the revisions, [~rajeshbabu]. Our practice to date has been to go
ahead and use a new API (and bump up the pom version to the required newer
version), but protect the calling of the new API so that we won't run into
problems for older versions (as you've already done). I'm not a big fan of
reflection, because it makes it very hard to track down usages of an API.
{code}
- st = new IndexSplitTransaction(indexRegion, splitKey);
+ int encodedVersion =
VersionUtil.encodeVersion(environment.getHBaseVersion());
+ if(encodedVersion >= SPLIT_TXN_MINIMUM_SUPPORTED_VERSION) {
+ st = new SplitTransaction(indexRegion, splitKey);
+ st.useZKForAssignment =
environment.getConfiguration().getBoolean("hbase.assignment.usezk", true);
+ } else {
+ st = new IndexSplitTransaction(indexRegion, splitKey);
+ }
+
{code}
I'd try this from a pre-HBase 0.98.9 release to make sure you don't get a
NoSuchFieldException when a split occurs. If you do, you could put the setting
of useZKForAssignment inside a static SplitTransactionUtil method.
> Make use of SplitTransaction to split local index region from 0.98.9 onwards
> ----------------------------------------------------------------------------
>
> Key: PHOENIX-1536
> URL: https://issues.apache.org/jira/browse/PHOENIX-1536
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.2.2
> Reporter: Rajeshbabu Chintaguntla
> Fix For: 5.0.0, 4.3
>
> Attachments: PHOENIX-1536.patch, PHOENIX-1536_v2.patch
>
>
> Currently we are using IndexSpilitTransaction which is duplicate of
> SplitTransaction with minor changes. From 0.98.9 onwards we can use the
> SplitTransaction itself.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)