Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1237

DumpJournal fails on non-BTree/HTree classes

    Details

    • Type: Bug
    • Status: Done
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: BLAZEGRAPH_RELEASE_1_5_1
    • Fix Version/s: BLAZEGRAPH_RELEASE_1_5_2
    • Component/s: Journal
    • Labels:
      None

      Description

      DumpJournal -pages fails on a journal containing non-BTree/HTree resources. In this case, it failed on a SolutionSetStream.

      java.lang.UnsupportedOperationException
              at com.bigdata.btree.Checkpoint.getHeight(Checkpoint.java:124)
              at com.bigdata.btree.BaseIndexStats.<init>(BaseIndexStats.java:101)
              at com.bigdata.bop.solutions.SolutionSetStream.dumpPages(SolutionSetStream.java:464)
              at com.bigdata.journal.DumpJournal.dumpNamedIndicesMetadata(DumpJournal.java:763)
              at com.bigdata.journal.DumpJournal.dumpJournal(DumpJournal.java:616)
              at com.bigdata.journal.DumpJournal.main(DumpJournal.java:286)
      Error: java.lang.UnsupportedOperationException on file: blazegraph.jnl
      

      The relevant code block is:

                  {
      
                     final BaseIndexStats stats = ndx.dumpPages(
                           dumpPages/* recursive */, dumpPages/* visitLeaves */); // <== THIS LINE IS FAILING
      
                      out.println("\t" + stats);
      
                      pageStats.put(name, stats);
      
                      if (dumpIndices) {
      
                          if (ndx instanceof AbstractBTree) {
                          
                              /*
                               * TODO GIST : dumpTuples for HTree.
                               */
                              
                              DumpIndex.dumpIndex((AbstractBTree) ndx, showTuples);
                              
                          }
      
                      }
      
                  }
      

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        I have replicated this within a test case. In fact, the HTree does not encounter a problem and we already have test coverage for that. The problem is apparently restricted to the SolutionSetStream.

        Ah. I am also able to hit this with the HTree if dumpPages is not specified.

        New unit tests now exist for both conditions.

        The root cause is Checkpoint,getHeight() throwing an UnsupportedOperationException rather than returning ZERO (0) per the javadoc in ICheckpoint and per the HTree and Stream specific Checkpoint constructors.

        The fix is to Checkpoint.java. Replace the existing definitions of the following two methods:

           /**
            * {@inheritDoc}
            * 
            * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on
            *      non-BTree classes </a>
            */
            @Override
            public final int getHeight() {
        
        //		switch (indexType) {
        //		case BTree:
        //			return height;
        //		default:
        //			throw new UnsupportedOperationException();
        //		}
               return height;
                
            }
        
            /**
             * {@inheritDoc}
             * 
             * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on
             *      non-BTree classes </a>
             */
            @Override
            public final int getGlobalDepth() {
            	
        //		switch (indexType) {
        //		case HTree:
        //			return height;
        //		default:
        //			throw new UnsupportedOperationException();
        //		}
               return height;
        
            }
        
        

        Commit 42fe472227c74132e59bf98f4b92cbb9ac737622 to TICKET_1129.

        Journal and HTree test suites are green.

        Merged to master. Scheduled for 1.5.2.

        Show
        bryanthompson bryanthompson added a comment - I have replicated this within a test case. In fact, the HTree does not encounter a problem and we already have test coverage for that. The problem is apparently restricted to the SolutionSetStream. Ah. I am also able to hit this with the HTree if dumpPages is not specified. New unit tests now exist for both conditions. The root cause is Checkpoint,getHeight() throwing an UnsupportedOperationException rather than returning ZERO (0) per the javadoc in ICheckpoint and per the HTree and Stream specific Checkpoint constructors. The fix is to Checkpoint.java. Replace the existing definitions of the following two methods: /** * {@inheritDoc} * * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on * non-BTree classes </a> */ @Override public final int getHeight() { // switch (indexType) { // case BTree: // return height; // default: // throw new UnsupportedOperationException(); // } return height; } /** * {@inheritDoc} * * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on * non-BTree classes </a> */ @Override public final int getGlobalDepth() { // switch (indexType) { // case HTree: // return height; // default: // throw new UnsupportedOperationException(); // } return height; } Commit 42fe472227c74132e59bf98f4b92cbb9ac737622 to TICKET_1129. Journal and HTree test suites are green. Merged to master. Scheduled for 1.5.2.

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: