[
https://issues.apache.org/jira/browse/PHOENIX-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14252001#comment-14252001
]
James Taylor commented on PHOENIX-1536:
---------------------------------------
Performance looks good. Nice job, [~rajeshbabu].
As far as the code to determine using SplitTransaction or not, we typically do
that based on the HBase version. The reason is that we have standard utilities
to do that and it becomes easier to see where the version-conditional code in
Phoenix is. Here's what that would look like:
{code}
@@ -55,7 +56,7 @@ public class LocalIndexSplitter extends BaseRegionObserver {
private static final Log LOG = LogFactory.getLog(LocalIndexSplitter.class);
- private IndexSplitTransaction st = null;
+ private SplitTransaction st = null;
+ private static final int SPLIT_TXN_MINIMUM_SUPPORTED_VERSION = VersionUtil
.encodeVersion("0.98.9");
private PairOfSameType<HRegion> daughterRegions = null;
private static final ParseNodeFactory FACTORY = new ParseNodeFactory();
@@ -75,7 +76,15 @@ public class LocalIndexSplitter extends BaseRegionObserver {
HRegion indexRegion = IndexUtil.getIndexRegion(environment);
if (indexRegion == null) return;
try {
- st = new IndexSplitTransaction(indexRegion, splitKey);
+ int encodedVersion =
VersionUtil.encodeVersion(environment.getHBaseVersion());
+ if (encodedVersion >= SPLIT_TXN_MINIMUM_SUPPORTED_VERSION) {
+ st = new SplitTransaction(indexRegion, splitKey);
+ } else {
+ st = new IndexSplitTransaction(indexRegion, splitKey);
+ }
{code}
If you're ok with this change, then please check it in afterwards. And then
please work with the HBase community to get a "blessed" path for your
colocation mechanism.
> 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
>
>
> 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)