XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      When i dig in HBASE-14659, i run testWritingPEData. There are a lot of NPE thrown and testcase run a long time.

      The reason is that, in HFileOutputFormat2

                  HRegionLocation loc = null;
                  String tableName = conf.get(OUTPUT_TABLE_NAME_CONF_KEY);
      
                  try (Connection connection = ConnectionFactory.createConnection(conf);
                         RegionLocator locator =
                           connection.getRegionLocator(TableName.valueOf(tableName))) {
                    loc = locator.getRegionLocation(rowKey);
                  } catch (Throwable e) {
                    LOG.warn("there's something wrong when locating rowkey: " +
                      Bytes.toString(rowKey), e);
                    loc = null;
                  }
      

      Because we did not set OUTPUT_TABLE_NAME_CONF_KEY, So tableName is null, So NPE thrown.

      And connection will be created which RegionLocator use to find region location. Because zk is not start in this testcase, So it will retry many times.

      But all this actions are not required, we can skip create connection by check whether tableName is null

      Attachments

        1. HBASE-14662.patch
          2 kB
          Heng Chen

        Activity

          People

            chenheng Heng Chen
            chenheng Heng Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: