public static AsyncPrepare create (BasicAction act, boolean reportHeuristics, AbstractRecord rec) { return new AsyncPrepare(act, reportHeuristics, rec); }
public static AsyncPrepare create (BasicAction act, boolean reportHeuristics, AbstractRecord rec) { return new AsyncPrepare(act, reportHeuristics, rec); }
protected int async_prepare(boolean reportHeuristics) { int p = TwoPhaseOutcome.PREPARE_OK; AbstractRecord lastRec = pendingList.getRear(); Collection<Future<Integer>> tasks = new ArrayList<Future<Integer>>(); while (pendingList.size() != 0) tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare( this, reportHeuristics, pendingList.getFront()))); // prepare the last (or only) participant on the callers thread if (lastRec != null) p = doPrepare(reportHeuristics, lastRec); // get the results for (Future<Integer> task : tasks) { try { int outcome = task.get(); if (p == TwoPhaseOutcome.PREPARE_OK) p = outcome; } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } return p; }
protected int async_prepare(boolean reportHeuristics) { int p = TwoPhaseOutcome.PREPARE_OK; AbstractRecord lastRec = pendingList.getRear(); Collection<Future<Integer>> tasks = new ArrayList<Future<Integer>>(); while (pendingList.size() != 0) tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare( this, reportHeuristics, pendingList.getFront()))); // prepare the last (or only) participant on the callers thread if (lastRec != null) p = doPrepare(reportHeuristics, lastRec); // get the results for (Future<Integer> task : tasks) { try { int outcome = task.get(); if (p == TwoPhaseOutcome.PREPARE_OK) p = outcome; } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } return p; }
protected int async_prepare(boolean reportHeuristics) { int p = TwoPhaseOutcome.PREPARE_OK; AbstractRecord lastRec = pendingList.getRear(); Collection<Future<Integer>> tasks = new ArrayList<Future<Integer>>(); while (pendingList.size() != 0) tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare( this, reportHeuristics, pendingList.getFront()))); // prepare the last (or only) participant on the callers thread if (lastRec != null) p = doPrepare(reportHeuristics, lastRec); // get the results for (Future<Integer> task : tasks) { try { int outcome = task.get(); if (p == TwoPhaseOutcome.PREPARE_OK) p = outcome; } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } return p; }
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));
tasks.add(TwoPhaseCommitThreadPool.submitJob(new AsyncPrepare(this, reportHeuristics, pendingList.getFront())));