Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6315

ipc.HBaseClient should support address change as does hdfs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 0.95.2
    • Fix Version/s: None
    • Component/s: IPC/RPC
    • Labels:
      None

      Description

      ipc.HBaseClient is a copy paste from ipc.Client. This implementation now support adress change.

      As a side node, HBase comment on 'the max number of retries is 45' is now wrong.

      — HBaseClient
      } catch (SocketTimeoutException toe)

      { /* The max number of retries is 45, * which amounts to 20s*45 = 15 minutes retries. */ handleConnectionFailure(timeoutFailures++, maxRetries, toe); }

      catch (IOException ie)

      { handleConnectionFailure(ioFailures++, maxRetries, ie); }

      — Hadoop Client
      } catch (SocketTimeoutException toe) {
      /* Check for an address change and update the local reference.

      • Reset the failure counter if the address was changed
        */
        if (updateAddress()) { timeoutFailures = ioFailures = 0; }
        /* The max number of retries is 45,
        * which amounts to 20s*45 = 15 minutes retries.
        */
        handleConnectionFailure(timeoutFailures++, 45, toe);
        } catch (IOException ie) {
        if (updateAddress()) { timeoutFailures = ioFailures = 0; }

        handleConnectionFailure(ioFailures++, maxRetries, ie);
        }

      private synchronized boolean updateAddress() throws IOException {
      // Do a fresh lookup with the old host name.
      InetSocketAddress currentAddr = NetUtils.makeSocketAddr(
      server.getHostName(), server.getPort());

      if (!server.equals(currentAddr))

      { LOG.warn("Address change detected. Old: " + server.toString() + " New: " + currentAddr.toString()); server = currentAddr; return true; }

      return false;
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nkeywal Nicolas Liochon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: