hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-8214) Remove proxy and engine, rely directly on pb generated Service
Date Tue, 30 Apr 2013 20:50:17 GMT

     [ https://issues.apache.org/jira/browse/HBASE-8214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

stack updated HBASE-8214:
-------------------------

    Attachment: 8214v7.txt

Fix unit tests.  Here is an updated note on the patch too.

{code}
Removes engine and proxy.  Everywhere we now use the pb Interface/Service with no
shim or decoration (the BlockingInterface to be more specific).  All "protocols"
have been removed; we are all about pb Service now.

Patch is mostly removals and generated code then a bunch of boiler-plate replaces.

Compiles.  Most tests pass.  Need to fix the remainder.

Pluses:
+ Regularizes our rpc.  No more voodoo.
+ Removes at least two layers.  We could remove more if we go mess with protoc generation
(as per Gary as per pb recommendation)

Cons:
+ How we pass security info is ugly.  Previous, the kerberos and token info was an interface
that the rpc interface/protocol implemented but now, because pb does the server and stub
service implementation creation and they cannot be altered -- not w/o protoc messing, we
have to pass the rpc interface and its security info separately (you cannot take the
BlockingService or BlockingStub class and get the token and kerberos Interfaces from them,
not w/o a bunch of ugly delegation classes).

This patch moves the security info -- the kerberos and user annotations -- off the
protocol/service implementions and on to new Interfaces whose only purpose is to
act as a vessel to carry these annotations.  This is temporary till a better solution.
The annotations can no longer be put on the protocol/service directly because creation
of instances is done via the pb generated code.  I could add delegating objects but
would rather not.

Adds a class per rpc interface named *SecurityInfo.  For example, ClientServiceSecurityInfo
and AdminServiceSecurityInfo.
Gets passed when we setup an rpcserver and when we make an rpcclient stub.

Removes the now useless IpcProtocol and ditto for interfaces that extended the pb blockinginterfaces
such as
MasterAdminProtocol.  Instead, we now pass raw BlockingInterface and the kerberos and token
interfaces are
moved to the new *SecurityInfo classes.

Bulk of changes are using BlockingInterface instead and class removals such as HBaseClientRPC
and the support
for caching of method invocations.  For example, changing AdminProto:col to instead refer
to AdminService.BlockingInterface (If you looked at old AdminProtocol, it implemented BlockingInterface)

The new rpc classes are named RpcClient and RpcServer (The silly RpcServer Interface was renamed
RpcServerInterface) These classes have facility to help make the protobuf stub on the client
side.

Got rid of MasterService that only had isMasterRunning in it and added this method to MasterMonitor
and
to MasterAdmin -- they both have it now; as said above we were trying to do some kinda inheritance
where
both MasterMonitor and MasterAdmin both had isMasterRunning method.  Dodgy.  Fixed issue where
master
services were faking multiple inheritance on pb services.

Fixed issue you can see in trunk where we'll complain about bad pb parse just after an error
(we were
not clearing out the channel if client-side did not have a corresponding Call because client
had timed
out)

Moved a few classes out of HConnectionManager -- it is too fat as is.

TODO:

+ See if I can make this cleaner still.  Would appreciate suggestion on the *SecurityInfo
stuff.

Side note:

In old 0.94 code, we would create proxy and then ask the server what it's version was.  This
would
setup a connection to first region in a table and then ask it its version.  We no longer make
this
call.  In current trunk, we just setup the proxy and return.  All of the below code is no
longer
triggered in trunk.  Lets see if we can do without it.

 43     long startTime = System.currentTimeMillis();
 42     IOException ioe;
 41     int reconnectAttempts = 0;
 40     while (true) {
 39       try {
 38         return rpcClient.getProxy(protocol, clientVersion, addr, conf, rpcTimeout);
 37       } catch(SocketTimeoutException te) {  // namenode is busy
 36         LOG.info("Problem connecting to server: " + addr);
 35         ioe = te;
 34       } catch (IOException ioex) {
 33         // We only handle the ConnectException.Rp
 32         ConnectException ce = null;
 31         if (ioex instanceof ConnectException) {
 30           ce = (ConnectException) ioex;
 29           ioe = ce;
 28         } else if (ioex.getCause() != null
 27             && ioex.getCause() instanceof ConnectException) {
 26           ce = (ConnectException) ioex.getCause();
 25           ioe = ce;
 24         } else if (ioex.getMessage().toLowerCase()
 23             .contains("connection refused")) {
 22           ce = new ConnectException(ioex.getMessage());
 21           ioe = ce;
 20         } else {
 19           // This is the exception we can't handle.
 18           ioe = ioex;
 17         }
 16         if (ce != null) {
 15           handleConnectionException(++reconnectAttempts, maxAttempts, protocol,
 14               addr, ce);
 13         }
 12       }
 11       // check if timed out
 10       if (System.currentTimeMillis() - timeout >= startTime) {
  9         throw ioe;
  8       }
  7
  6       // wait for retry
  5       try {
  4         Thread.sleep(1000);
  3       } catch (InterruptedException ie) {
  2         // IGNORE
  1       }
  0     }

This patch does not change the above fact. It does though make a change which acknowledges
that stub setup does not make a connection on creation; I changed ServerCallable so its
connect method is now called prepare.

{code}
                
> Remove proxy and engine, rely directly on pb generated Service
> --------------------------------------------------------------
>
>                 Key: HBASE-8214
>                 URL: https://issues.apache.org/jira/browse/HBASE-8214
>             Project: HBase
>          Issue Type: Bug
>          Components: IPC/RPC
>            Reporter: stack
>            Assignee: stack
>         Attachments: 8124.txt, 8214v2.txt, 8214v3.txt, 8214v4.txt, 8214v5.txt, 8214v6.txt,
8214v7.txt
>
>
> Attached patch is not done.  Removes two to three layers -- depending on how you count
-- between client and rpc client and similar on server side (between rpc and server implementation).
 Strips ProtobufRpcServer/Client and HBaseClientRpc/HBaseServerRpc.  Also gets rid of proxy.

--
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

Mime
View raw message