[
https://issues.apache.org/jira/browse/PHOENIX-5556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
chenglei updated PHOENIX-5556:
------------------------------
Description:
Load IndexMetaData is a somewhat expensive operation because it may deserialize
from scan attribute. In following preBatchMutateWithExceptions
{code:java}
610 public void
preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnvironment> c,
611 MiniBatchOperationInProgress<Mutation> miniBatchOp)
throws Throwable {
612 ignoreAtomicOperations(miniBatchOp);
613 BatchMutateContext context = new
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
614 setBatchMutateContext(c, context);
615 Mutation firstMutation = miniBatchOp.getOperation(0);
....
639 prepareIndexMutations(c, miniBatchOp, context, mutations, now);
640
metricSource.updateIndexPrepareTime(EnvironmentEdgeManager.currentTimeMillis()
- start);
{code}
was:
Load IndexMetaData is a somewhat expensive operation because it may deserialize
from scan attribute. In following
{code:java}
610 public void
preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnvironment> c,
611 MiniBatchOperationInProgress<Mutation> miniBatchOp) throws
Throwable {
612 ignoreAtomicOperations(miniBatchOp);
613 BatchMutateContext context = new
BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
setBatchMutateContext(c, context);
Mutation firstMutation = miniBatchOp.getOperation(0);
ReplayWrite replayWrite = this.builder.getReplayWrite(firstMutation);
/*
* Exclusively lock all rows so we get a consistent read
* while determining the index updates
*/
if (replayWrite == null) {
populateRowsToLock(miniBatchOp, context);
lockRows(context);
}
long now = EnvironmentEdgeManager.currentTimeMillis();
// Add the table rows in the mini batch to the collection of pending
rows. This will be used to detect
// concurrent updates
if (replayWrite == null) {
populatePendingRows(context, now);
}
// First group all the updates for a single row into a single update to
be processed
Collection<? extends Mutation> mutations = groupMutations(miniBatchOp,
now, replayWrite);
// early exit if it turns out we don't have any edits
if (mutations == null) {
return;
}
long start = EnvironmentEdgeManager.currentTimeMillis();
prepareIndexMutations(c, miniBatchOp, context, mutations, now);
metricSource.updateIndexPrepareTime(EnvironmentEdgeManager.currentTimeMillis()
- start);
{code}
> Avoid repeatedly load IndexMetaData For IndexRegionObserver
> -----------------------------------------------------------
>
> Key: PHOENIX-5556
> URL: https://issues.apache.org/jira/browse/PHOENIX-5556
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.15.0, 5.1.0
> Reporter: Chenglei
> Assignee: chenglei
> Priority: Major
>
> Load IndexMetaData is a somewhat expensive operation because it may
> deserialize from scan attribute. In following preBatchMutateWithExceptions
> {code:java}
> 610 public void
> preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnvironment> c,
> 611 MiniBatchOperationInProgress<Mutation> miniBatchOp)
> throws Throwable {
> 612 ignoreAtomicOperations(miniBatchOp);
> 613 BatchMutateContext context = new
> BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
> 614 setBatchMutateContext(c, context);
> 615 Mutation firstMutation = miniBatchOp.getOperation(0);
> ....
> 639 prepareIndexMutations(c, miniBatchOp, context, mutations, now);
> 640
> metricSource.updateIndexPrepareTime(EnvironmentEdgeManager.currentTimeMillis()
> - start);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)