You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2012/12/20 01:17:16 UTC

[jira] [Commented] (HBASE-5448) Support for dynamic coprocessor endpoints with PB-based RPC

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

stack commented on HBASE-5448:
------------------------------

[~ghelmling] Mighty Gary, why ConcurrentSkipListMap in the below in HTable#coprocessorService rather than what was used previously up in HTable#coprocessorExec, a TreeMap wrapped in a Collections.synchronizedMap?  The former does not allow values of null whereas the latter does.  There is a test in TestServerCustomProtocol that tests we can get back null.  It fails if I try to return null because of the above change. Here is the code I refer to:

{code}
	
  public <T extends Service, R> Map<byte[],R> coprocessorService(final Class<T> service,
1389	
      byte[] startKey, byte[] endKey, final Batch.Call<T,R> callable)
1390	
      throws ServiceException, Throwable {
1391	
    final Map<byte[],R> results =  new ConcurrentSkipListMap<byte[], R>(Bytes.BYTES_COMPARATOR);
1392	
    coprocessorService(service, startKey, endKey, callable, new Batch.Callback<R>() {
1393	
      public void update(byte[] region, byte[] row, R value) {
1394	
        if (value == null) {
1395	
          if (LOG.isDebugEnabled()) {
1396	
            LOG.debug("Call to " + service.getName() +
1397	
                " received NULL value from Batch.Call for region " + Bytes.toStringBinary(region));
1398	
          }
1399	
        } else {
1400	
          results.put(region, value);
1401	
        }
1402	
      }
1403	
    });
1404	
    return results;
1405	
  }
{code}

Wondering if an explicit reason that I am not aware of (There maybe given you seem to go out of your way to  not return nulls though it seems simple enough to go back to the old way of doing nulls).

Thanks boss.
                
> Support for dynamic coprocessor endpoints with PB-based RPC
> -----------------------------------------------------------
>
>                 Key: HBASE-5448
>                 URL: https://issues.apache.org/jira/browse/HBASE-5448
>             Project: HBase
>          Issue Type: Sub-task
>          Components: IPC/RPC, master, migration, regionserver
>            Reporter: Todd Lipcon
>            Assignee: Gary Helmling
>             Fix For: 0.96.0
>
>         Attachments: HBASE-5448_2.patch, HBASE-5448_3.patch, HBASE-5448_4.patch, HBASE-5448.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira