You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by md...@apache.org on 2014/01/22 20:12:24 UTC
git commit: ACCUMULO-2136 Move Thread.start out of Fate's constructor
Updated Branches:
refs/heads/master 31b68c40f -> 680433bec
ACCUMULO-2136 Move Thread.start out of Fate's constructor
Signed-off-by: Mike Drob <md...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/680433be
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/680433be
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/680433be
Branch: refs/heads/master
Commit: 680433becd10548b8ada2041c993295b50e3794e
Parents: 31b68c4
Author: Vikram Srivastava <vi...@cloudera.com>
Authored: Thu Jan 9 23:46:11 2014 -0800
Committer: Mike Drob <md...@cloudera.com>
Committed: Wed Jan 22 14:12:09 2014 -0500
----------------------------------------------------------------------
.../main/java/org/apache/accumulo/fate/Fate.java | 16 +++++++++++++---
.../java/org/apache/accumulo/master/Master.java | 3 ++-
2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/680433be/fate/src/main/java/org/apache/accumulo/fate/Fate.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/Fate.java b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
index 2d69647..ec41be2 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -138,11 +138,21 @@ public class Fate<T> {
}
- // TODO: move thread creation to another method ACCUMULO-2136
- public Fate(T environment, TStore<T> store, int numThreads) {
+ /**
+ * Creates a Fault-tolerant executor.
+ * <p>
+ * Note: Users of this class should call {@link #startTransactionRunners(int)} to
+ * launch the {@link TransactionRunner} threads after creating a Fate object.
+ */
+ public Fate(T environment, TStore<T> store) {
this.store = store;
this.environment = environment;
-
+ }
+
+ /**
+ * Launches the specified number of {@link TransactionRunner} threads.
+ */
+ public void startTransactionRunners(int numThreads) {
for (int i = 0; i < numThreads; i++) {
// TODO: use an ExecutorService, maybe a utility to do these steps throughout the server packages - ACCUMULO-1311
Thread thread = new Daemon(new LoggingRunnable(log, new TransactionRunner()), "Repo runner " + i);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/680433be/server/master/src/main/java/org/apache/accumulo/master/Master.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java
index 86a35cd..5264f46 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/Master.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java
@@ -897,7 +897,8 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt
int threads = this.getConfiguration().getConfiguration().getCount(Property.MASTER_FATE_THREADPOOL_SIZE);
- fate = new Fate<Master>(this, store, threads);
+ fate = new Fate<Master>(this, store);
+ fate.startTransactionRunners(threads);
SimpleTimer.getInstance().schedule(new Runnable() {