Projects >> h-store >>00448a3cd608916ebb925e70a44e274021da4e23

Chunk
Conflicting content
     */
    public void transactionInit(AbstractTransaction ts) {
        assert(ts.isInitialized()) : "Uninitialized transaction handle [" + ts + "]";
<<<<<<< HEAD
        if (hstore_conf.site.txn_profiling && ts instanceof LocalTransaction) {
            LocalTransaction localTxn = (LocalTransaction)ts;
            if (localTxn.profiler != null) localTxn.profiler.startInitQueue();
        }
        this.txnQueueManager.initTransaction(ts);
=======
        this.txnQueueManager.queueTransactionInit(ts);
        
//        for (int partition : ts.getPredictTouchedPartitions().values()) {
//            if (this.isLocalPartition(partition)) {
//                this.executors[partition].queueInit(ts);
//            }
//        } // FOR
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
    }
    
    /**
Solution content
     */
    public void transactionInit(AbstractTransaction ts) {
        assert(ts.isInitialized()) : "Uninitialized transaction handle [" + ts + "]";
        if (hstore_conf.site.txn_profiling && ts instanceof LocalTransaction) {
            LocalTransaction localTxn = (LocalTransaction)ts;
            if (localTxn.profiler != null) localTxn.profiler.startInitQueue();
        }
        this.txnQueueManager.queueTransactionInit(ts);
    }
    
    /**
File
HStoreSite.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
            inflight_cmdlog = cmdLogger.getTotalTxnCount();
        }
        
<<<<<<< HEAD
        siteInfo.put("InFlight Txns", String.format("%d total / %d queued / %d cmdlog / %d deletable [totalMin=%d, totalMax=%d]",
                        inflight_cur,                           // total
                        queueManagerDebug.getInitQueueSize(),   // queued
                        inflight_cmdlog,                        // cmdlog
                        this.siteDebug.getDeletableTxnCount(),  // deletable
                        this.inflight_min,                      // totalMin
                        this.inflight_max                       // totalMax
=======
        siteInfo.put("InFlight Txns",
                      String.format("%d total / %d init / %d queued / %d restart / %d cmdlog / %d deletable " +
        		                    "[totalMin=%d, totalMax=%d]",
                                    inflight_cur,       // total
                                    queueManagerDebug.getInitQueueSize(), // init
                                    queueManagerDebug.getLockQueueSize(), // queued
                                    queueManagerDebug.getRestartQueueSize(), // restart
                                    inflight_cmdlog,    // cmdlog
                                    this.siteDebug.getDeletableTxnCount(), // deletable
                                    this.inflight_min,  // totalMin
                                    this.inflight_max   // totalMax
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
        ));
        
        
Solution content
            inflight_cmdlog = cmdLogger.getTotalTxnCount();
        }
        
        siteInfo.put("InFlight Txns",
                      String.format("%d total / %d init / %d queued / %d restart / %d cmdlog / %d deletable " +
        		                    "[totalMin=%d, totalMax=%d]",
                                    inflight_cur,       // total
                                    queueManagerDebug.getInitQueueSize(), // init
                                    queueManagerDebug.getLockQueueSize(), // queued
                                    queueManagerDebug.getRestartQueueSize(), // restart
                                    inflight_cmdlog,    // cmdlog
                                    this.siteDebug.getDeletableTxnCount(), // deletable
                                    this.inflight_min,  // totalMin
                                    this.inflight_max   // totalMax
        ));
        
        
File
HStoreSiteStatus.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
            }
                    }
                }
<<<<<<< HEAD
            // TransactionQueueManager - Requeued Txns
            if (queueManagerDebug.getRestartQueueSize() > 0) {
                queueStatus += "\nRequeues: " + queueManagerDebug.getRestartQueueSize();
            }
=======
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
            m.put("Lock Queue", queueStatus);
            
Solution content
                    }
                }
            }
            m.put("Lock Queue", queueStatus);
            
File
HStoreSiteStatus.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Chunk
Conflicting content
        
        if (debug.val)
            LOG.debug(String.format("Starting %s thread", this.getClass().getSimpleName()));
<<<<<<< HEAD
        AbstractTransaction nextTxn = null;
        int added = 0;
=======
        AbstractTransaction next_init = null;
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
        while (this.stop == false) {
            try {
                nextTxn = this.initQueue.poll(THREAD_WAIT_TIME, THREAD_WAIT_TIMEUNIT);
Solution content
        
        if (debug.val)
            LOG.debug(String.format("Starting %s thread", this.getClass().getSimpleName()));
        AbstractTransaction nextTxn = null;
        while (this.stop == false) {
            try {
                nextTxn = this.initQueue.poll(THREAD_WAIT_TIME, THREAD_WAIT_TIMEUNIT);
File
TransactionQueueManager.java
Developer's decision
Combination
Kind of conflict
Variable
Chunk
Conflicting content
            } catch (InterruptedException ex) {
                // IGNORE
            }
<<<<<<< HEAD
            if (nextTxn != null) {
                if (hstore_conf.site.txn_profiling && nextTxn instanceof LocalTransaction) {
                    LocalTransaction localTxn = (LocalTransaction)nextTxn;
                    if (localTxn.profiler != null) localTxn.profiler.startQueueLock();
                }
                
                PartitionCountingCallback callback = nextTxn.getInitCallback();
                assert(callback.isInitialized()) :
                    String.format("Unexpected uninitialized %s for %s\n%s",
                                  callback.getClass().getSimpleName(),
                                  nextTxn, callback.toString());
                boolean ret = (callback.isAborted() == false);
                Status status = null;
                
                if (trace.val)
                    LOG.trace(String.format("Adding %s to lock queus for partitions %s\n%s",
                              nextTxn, nextTxn.getPredictTouchedPartitions(), callback));
                for (int partition : nextTxn.getPredictTouchedPartitions().values()) {
                    // Skip any non-local partition
                    if (this.lockQueues[partition] == null) continue;
                    
                    // If this txn gets rejected when we try to insert it, then we 
                    // just need to stop trying to add it to other partitions
                    if (ret) {
                        status = this.lockQueueInsert(nextTxn, partition, callback);
                        if (status != Status.OK) ret = false;
                    // IMPORTANT: But we still need to go through and decrement the
                    // callback's counter for those other partitions.
                    } else {
                        callback.decrementCounter(partition);
                    }
                } // FOR
                if (ret) {
                    added++;
                    if (trace.val) 
                        LOG.debug(String.format("Finished processing lock queues for %s [result=%s]",
                                  nextTxn, ret));
                }
=======
            if (next_init != null) {
                this.initTransaction(next_init);
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
            }
            // Requeue mispredicted local transactions
<<<<<<< HEAD
Solution content
            } catch (InterruptedException ex) {
                // IGNORE
            }
            if (nextTxn != null) {
                this.initTransaction(nextTxn);
            }
            // Requeue mispredicted local transactions
File
TransactionQueueManager.java
Developer's decision
Manual
Kind of conflict
Assert statement
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
            }
            // Requeue mispredicted local transactions
<<<<<<< HEAD
            if ((nextTxn == null || added > CHECK_INIT_QUEUE_LIMIT) &&
                    this.restartQueue.isEmpty() == false) {
=======
            if (next_init == null && this.restartQueue.isEmpty() == false) {
>>>>>>> cb3481cbe63d36941c4a59a5dbb03f3b04a9d5df
                this.checkRestartQueue();
            }
        } // WHILE
Solution content
            }
            // Requeue mispredicted local transactions
            if (nextTxn == null && this.restartQueue.isEmpty() == false) {
                this.checkRestartQueue();
            }
        } // WHILE
File
TransactionQueueManager.java
Developer's decision
Manual
Kind of conflict
If statement