Package edu.brown.hstore.txns

Examples of edu.brown.hstore.txns.DependencyInfo


            Map<Integer, DependencyInfo> stmt_dinfos = this.depTrackerDbg.getStatementDependencies(this.ts, i);
            assertNotNull(stmt_dinfos);
            assertFalse(stmt_dinfos.isEmpty());
           
            for (Integer d_id : stmt_dinfos.keySet()) {
                DependencyInfo dinfo = stmt_dinfos.get(d_id);
                assertNotNull(dinfo);
               
                if (this.internal_dependency_ids.contains(d_id)) {
                    // This fragment should have been broadcast to all partitions
                    assertEquals(NUM_PARTITIONS, dinfo.getExpectedPartitions().size());
                    // But never out to VoltProcedure
                    assertFalse(this.output_dependency_ids.contains(d_id));
                    // And we should have a task blocked waiting for this dependency
                    assertFalse(dinfo.getBlockedWorkFragments().isEmpty());
                } else {
                    assertEquals(1, dinfo.getExpectedPartitions().size());
                    assertEquals(LOCAL_PARTITION, dinfo.getExpectedPartitions().get());
                }
            } // FOR
           
        } // FOR
        //System.err.println(this.ts);
View Full Code Here


        assertEquals(AbstractTransaction.RoundState.STARTED, this.ts.getCurrentRoundState(LOCAL_PARTITION));
       
        // We want to add results for just one of the duplicated statements and make sure that
        // we only unblock one of them. First we need to find an internal dependency that has blocked tasks
        Integer internal_d_id = null;
        DependencyInfo internal_dinfo = null;
        for (Integer d_id : this.internal_dependency_ids) {
            internal_d_id = d_id;
            internal_dinfo = this.depTrackerDbg.getDependencyInfo(this.ts, d_id);
            if (internal_dinfo != null) break;
        } // FOR
        assertNotNull(internal_d_id);
        assertNotNull(internal_dinfo);
       
        // Now shove a fake result for each partition at the TransactionState object. This should
        // cause the blocked FragmentTaskMessage to get moved into the "ready" queue
        for (int partition = 0; partition < NUM_PARTITIONS; partition++) {
            assertFalse(internal_dinfo.hasTasksReady());
            // If this is the first partition, then add one for each of the duplicate Statements
            // We want to make sure that they don't unblock
            for (int stmt_index = 0; stmt_index < NUM_DUPLICATE_STATEMENTS; stmt_index++) {
                if (partition != LOCAL_PARTITION && stmt_index > 0) break;
                int dependency_id = this.internal_dependency_ids.get(stmt_index);
                LOG.debug("Adding result for [partition=" + partition + ", dependency_id=" + dependency_id + ", stmt_index=" + stmt_index + "]");
                this.depTracker.addResult(this.ts, partition, dependency_id, FAKE_RESULT);
            } // FOR
        } // FOR
        if (NUM_PARTITIONS != internal_dinfo.getResults().size()) {
            LOG.info(this.ts);
            LOG.info("----------------------------------");
            LOG.info(internal_dinfo);
        }
        assertEquals(internal_dinfo.getResults().toString(), NUM_PARTITIONS, internal_dinfo.getResults().size());
        assert(internal_dinfo.hasTasksReleased());
       
        // Make sure that all other Statements didn't accidently unblock their FragmentTaskMessages...
        for (int stmt_index = 1; stmt_index < NUM_DUPLICATE_STATEMENTS; stmt_index++) {
            int dep_id = this.internal_dependency_ids.get(stmt_index);
            DependencyInfo other = this.depTrackerDbg.getDependencyInfo(this.ts, dep_id);
            assertNotNull(other);
            assertFalse(other.hasTasksReady());
            assertFalse(other.hasTasksReleased());
            assertEquals(1, other.getResults().size());
        } // FOR
        // System.err.println(this.ts);
    }
View Full Code Here

TOP

Related Classes of edu.brown.hstore.txns.DependencyInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.