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

RPC client not using Codec and CellBlock for puts by default

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.98.0
    • 1.2.0, 1.3.0, 1.1.4, 1.0.4, 0.98.18, 2.0.0
    • None
    • None
    • Reviewed

    Description

      For puts we use MultiServerCallable. Here to decide whether to use cellBlock we have

      private boolean isCellBlock() {
          // This is not exact -- the configuration could have changed on us after connection was set up
          // but it will do for now.
          HConnection connection = getConnection();
          if (connection == null) return true; // Default is to do cellblocks.
          Configuration configuration = connection.getConfiguration();
          if (configuration == null) return true;
          String codec = configuration.get(HConstants.RPC_CODEC_CONF_KEY, "");
          return codec != null && codec.length() > 0;
        }
      

      By default in hbase-default.xml, we dont have any Codec being specified.

      Where as in AbstractRpcClient we have

      Codec getCodec() {
          // For NO CODEC, "hbase.client.rpc.codec" must be configured with empty string AND
          // "hbase.client.default.rpc.codec" also -- because default is to do cell block encoding.
          String className = conf.get(HConstants.RPC_CODEC_CONF_KEY, getDefaultCodec(this.conf));
          if (className == null || className.length() == 0) return null;
          try {
            return (Codec)Class.forName(className).newInstance();
          } catch (Exception e) {
            throw new RuntimeException("Failed getting codec " + className, e);
          }
        }
      .....
      public static String getDefaultCodec(final Configuration c) {
          // If "hbase.client.default.rpc.codec" is empty string -- you can't set it to null because
          // Configuration will complain -- then no default codec (and we'll pb everything).  Else
          // default is KeyValueCodec
          return c.get(DEFAULT_CODEC_CLASS, KeyValueCodec.class.getCanonicalName());
        }
      

      Our aim is to by def use Codec and it is KeyValueCodec.

      The codec finding in MultiServerCallable to be same way as in AbstractRpcClient and then only we will be doing cellblock stuff.

      Attachments

        1. HBASE-15198_addendum-branch-1.0.patch
          0.7 kB
          Anoop Sam John
        2. HBASE-15198_V2.patch
          4 kB
          Anoop Sam John
        3. HBASE-15198_V3.patch
          5 kB
          Anoop Sam John
        4. HBASE-15198_V4.patch
          8 kB
          Anoop Sam John
        5. HBASE-15198_V5.patch
          9 kB
          Anoop Sam John
        6. HBASE-15198_V6.patch
          9 kB
          Michael Stack
        7. HBASE-15198_V6.patch
          9 kB
          Anoop Sam John
        8. HBASE-15198.patch
          4 kB
          Anoop Sam John
        9. HBASE-15198-0.98.patch
          10 kB
          Anoop Sam John
        10. HBASE-15198-0.98.patch
          10 kB
          Anoop Sam John
        11. HBASE-15198-branch-1.0.patch
          10 kB
          Anoop Sam John
        12. HBASE-15198-branch-1.1.patch
          10 kB
          Anoop Sam John
        13. HBASE-15198-branch-1.patch
          12 kB
          Anoop Sam John

        Issue Links

          Activity

            People

              anoop.hbase Anoop Sam John
              anoop.hbase Anoop Sam John
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: