You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Abhishek Talluri (JIRA)" <ji...@apache.org> on 2018/10/31 04:38:00 UTC

[jira] [Comment Edited] (PHOENIX-5002) Don't load Indexer coprocessor for non-indexed tables

    [ https://issues.apache.org/jira/browse/PHOENIX-5002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669589#comment-16669589 ] 

Abhishek Talluri edited comment on PHOENIX-5002 at 10/31/18 4:37 AM:
---------------------------------------------------------------------

[~gjacoby] [~vincentpoon] I do see that there is an isEnabled method that is checked for each Mutation to see if that mutation needs to be processed for calculating the index updates or not. But I don't see a way to set that manually on a table level, as it just checks for the UUID of each mutation and sets it to true, which means that the check is always true for a mutation other than when there is no ID assigned for it. I guess we could add some table level property or add logic to check for zero indexes and make this method return false.

I do see these snippets of code in PhoenixIndexCodec that returns the value for isEnabled.
{code:java}
public boolean isEnabled(Mutation m) throws IOException {
        return hasIndexMaintainers(m.getAttributesMap());
    }
}

boolean hasIndexMaintainers(Map<String, byte[]> attributes) {
    if (attributes == null) { return false; }
    byte[] uuid = attributes.get(INDEX_UUID);
    if (uuid == null) { return false; }
    return true;
}
{code}
Let me know if you want me to add and test that extra piece of code in hasIndexMaintainers.

 


was (Author: abhishektalluri@cloudera.com):
[~gjacoby] [~vincentpoon] I do see that there is an isEnabled method that is checked for each Mutation to see if that mutation needs to be processed for calculating the index updates or not. But I don't see a way to set that manually on a table level, as it just checks for the UUID of each mutation and sets it to true, which means that the check is always true for a mutation other than when there is no ID assigned for it. I guess we could add some table level property or add logic to check for zero indexes and make this method return false.

I do see these snippets of code in PhoenixIndexCodec that returns the value for isEnabled.

public boolean isEnabled(Mutation m) throws IOException {
return hasIndexMaintainers(m.getAttributesMap());
}

boolean hasIndexMaintainers(Map<String, byte[]> attributes) {
if (attributes == null) \{ return false; }
byte[] uuid = attributes.get(INDEX_UUID);
if (uuid == null) \{ return false; }
return true;
}

Let me know if you want me to add and test that extra piece of code in hasIndexMaintainers.

 

> Don't load Indexer coprocessor for non-indexed tables
> -----------------------------------------------------
>
>                 Key: PHOENIX-5002
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5002
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.14.1
>            Reporter: Vincent Poon
>            Priority: Major
>
> It seems the Indexer coprocessor is loaded for tables even if they have no indexes.
> There is some overhead such as write locking within Phoenix - we should investigate whether we can avoid loading the Indexer coproc or disable it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)