You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Alex Baranau (JIRA)" <ji...@apache.org> on 2011/04/21 17:32:05 UTC

[jira] [Created] (HBASE-3811) Allow adding attributes to Scan

Allow adding attributes to Scan
-------------------------------

                 Key: HBASE-3811
                 URL: https://issues.apache.org/jira/browse/HBASE-3811
             Project: HBase
          Issue Type: Improvement
          Components: client
            Reporter: Alex Baranau
            Priority: Minor


There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.

Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031202#comment-13031202 ] 

Ted Yu commented on HBASE-3811:
-------------------------------

Should we generalize the type of value in attributes map to be of byte [] ?

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Baranau updated HBASE-3811:
--------------------------------

    Attachment: HBASE-3811.patch

Attached new patch. Major change:
* attributes map is changed from Map<String, String> to Map<String, byte[]>.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-3811:
-------------------------

      Resolution: Fixed
        Assignee: Alex Baranau
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Committed to TRUNK.  Thanks for the patch Alex (I made you a contributor and so in future you should be able to assign yourself issues).

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Assignee: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039408#comment-13039408 ] 

Hudson commented on HBASE-3811:
-------------------------------

Integrated in HBase-TRUNK #1939 (See [https://builds.apache.org/hudson/job/HBase-TRUNK/1939/])
    HBASE-3811 Allow adding attributes to Scan
HBASE-3811 Allow adding attributes to Scan

stack : 
Files : 
* /hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestScan.java

stack : 
Files : 
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Scan.java


> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Assignee: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031218#comment-13031218 ] 

Ted Yu commented on HBASE-3811:
-------------------------------

If we use "sourceScan" attribute to store the unique ID for distributed scan, a natural choice would be byte array representing the start/end row(s) of the original Scan.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036513#comment-13036513 ] 

stack commented on HBASE-3811:
------------------------------

Why do you extend TestCase Alex?  Its a new test.  Junit4 doesn't use TestCase?  Or does it?

Do isEmpty rather than '+      if (attributes.size() == 0) {'

It seems strange we would catch an EOFE on deserialization when we have the version available to us.  Can we use the SCAN_VERSION?  Up it to 2 and have version 2 able to deserialize both versions?

Otherwise patch looks great Alex.



> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Baranau updated HBASE-3811:
--------------------------------

    Attachment: HBASE-3811.patch

Submitted updated patch (fixed the nits mentioned by Stack).

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Baranau updated HBASE-3811:
--------------------------------

    Attachment: HBASE-3811.patch

Attached patch. There's small Q about it (you can see it in comments): since we changing the data format of serialized scan, should we change scan implementation version and/or should we support previous format (this way we will support "older" clients)?

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Baranau updated HBASE-3811:
--------------------------------

    Attachment: HBASE-3811.patch

Sorry, attached new one: my IDE shuffled the imports in the previous one :(

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Jonathan Hsieh (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Hsieh updated HBASE-3811:
----------------------------------

    Fix Version/s: 0.92.0
    
> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Assignee: Alex Baranau
>            Priority: Minor
>             Fix For: 0.92.0
>
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032026#comment-13032026 ] 

Ted Yu commented on HBASE-3811:
-------------------------------

I wanted to test backward compatibility of the read() method.
The result means we don't have to increase the version number of Scan.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032048#comment-13032048 ] 

Alex Baranau commented on HBASE-3811:
-------------------------------------

That was expected by me since I added the code below to handle this case:

    int numAttributes = 0;
    try {
      numAttributes = in.readInt();
    } catch (EOFException e) { // indicates that serialized scan doesn't support attributes
      // DO NOTHING
      // TODO: should we really care about it? or should we increase scan version number and handle/not handle
      // attributes depending on version?
    }

Still one may think that using Scan version is cleaner variant. Not sure what are the plans for Scan version and when it is ok to change it *by initial design*.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Baranau updated HBASE-3811:
--------------------------------

    Status: Patch Available  (was: Open)

I was going to submit patch for review on review board, but had problems accessing it at https://reviews.apache.org/account/login/ (looks like my existing account doesn't work, nor password recovery/register functionality) :(

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039343#comment-13039343 ] 

Alex Baranau commented on HBASE-3811:
-------------------------------------

Thank you!

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Assignee: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032019#comment-13032019 ] 

Alex Baranau commented on HBASE-3811:
-------------------------------------

> I then commented out the persistence of attributes map in 
> write(final DataOutput out), TestScannerTimeout passed too.

Any specific reason for that? Just wondering...

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039233#comment-13039233 ] 

Alex Baranau commented on HBASE-3811:
-------------------------------------

qt. Why do you extend TestCase Alex? Its a new test. Junit4 doesn't use TestCase? Or does it?

Just tried to follow the "coding style" here, as I saw other test cases use this design. Cleaning it.

qt. It seems strange we would catch an EOFE on deserialization when we have the version available to us. Can we use the SCAN_VERSION? Up it to 2 and have version 2 able to deserialize both versions?

Exactly. That is what I meant by saying/asking "Still one may think that using Scan version is cleaner variant. Not sure what are the plans for Scan version and when it is ok to change it by initial design."


> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Alex Baranau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031206#comment-13031206 ] 

Alex Baranau commented on HBASE-3811:
-------------------------------------

Hm. I thought about scan attributes as usual attributes/settings map, which is comparable to e.g. org.apache.hadoop.conf.Configuration or similar.

Does anyone see we are going to use byte[] values? Are we going to put in values e.g. serialized objects, or smth related?



> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025522#comment-13025522 ] 

stack commented on HBASE-3811:
------------------------------

You could change Scan so it passes an optional Map.   Add an attributes method to Scan.  If attributes > 0, instantiate a Map and then serialize it out.  On other end, have check for null or non-null Map when deserializing (We don't want to carry the Map for every Scan I'd say -- just carry it when attributes present... but perhaps I'm doing premature optimization here).

This could become more important now we have CPs.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027546#comment-13027546 ] 

Ted Yu commented on HBASE-3811:
-------------------------------

We can follow the example of HTableDescriptor.write():
{code}
    out.writeInt(families.size());
    for(Iterator<HColumnDescriptor> it = families.values().iterator();
{code}

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3811) Allow adding attributes to Scan

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031708#comment-13031708 ] 

Ted Yu commented on HBASE-3811:
-------------------------------

I ran TestScan, TestScannerTimeout and TestFromClientSide based on today's patch and they passed.
I then commented out the persistence of attributes map in write(final DataOutput out), TestScannerTimeout passed too.

> Allow adding attributes to Scan
> -------------------------------
>
>                 Key: HBASE-3811
>                 URL: https://issues.apache.org/jira/browse/HBASE-3811
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>            Reporter: Alex Baranau
>            Priority: Minor
>         Attachments: HBASE-3811.patch, HBASE-3811.patch
>
>
> There's sometimes a need to add custom attribute to Scan object so that it can be accessed on server side.
> Example of the case where it is needed discussed here: http://search-hadoop.com/m/v3Jtb2GkiO. There might be other cases where it is useful, which are mostly about logging/gathering stats on server side.
> Alternative to allowing adding any custom attributes to scan could be adding some fixed field, like "type" to the class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira