Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-7629

HBaseTableTest does not test increment() properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0, 3.5.1
    • Fix Version/s: 4.0.0
    • Component/s: Datasets, Test
    • Labels:
      None
    • Release Notes:
      Adds additional tests for read-less increments in HBase.
    • Rank:
      1|hzzojb:

      Description

      The issue is that the getTable() method is overridden to always enable readless increments for the dataset instance. However, getTableAdmin() does not do the same thing.

        @Override
        protected BufferingTable getTable(DatasetContext datasetContext, String name,
                                          ConflictDetection conflictLevel) throws Exception {
          // ttl=-1 means "keep data forever"
          DatasetSpecification spec = DatasetSpecification.builder(name, "foo")
            .property(Table.PROPERTY_READLESS_INCREMENT, "true")
            .property(Table.PROPERTY_CONFLICT_LEVEL, conflictLevel.name())
            .build();
          return new HBaseTable(datasetContext, spec, cConf, TEST_HBASE.getConfiguration(), hBaseTableUtil);
        }
      
        @Override
        protected HBaseTableAdmin getTableAdmin(DatasetContext datasetContext, String name,
                                                DatasetProperties props) throws IOException {
          DatasetSpecification spec = new HBaseTableDefinition("foo").configure(name, props);
          return getTableAdmin(datasetContext, spec);
        }
      

      Thus we are testing readless increments with HBase tables that do have the readless increment coprocessor.

      It is amazing that all tests pass. That means there is no test that test repeated increments. Also, this means that the code path in BufferingTable that test regular increments is not covered by the test.

      We should test both cases.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andreas Andreas Neumann
                Reporter:
                andreas Andreas Neumann
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: