You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bh...@apache.org on 2014/03/07 16:56:06 UTC
[1/6] git commit: ACCUMULO-2270 Make initialization of static
threadpool thread-safe
Repository: accumulo
Updated Branches:
refs/heads/1.6.0-SNAPSHOT 9231648ae -> a4e562602
refs/heads/master 7b0e4635b -> feff9e62f
ACCUMULO-2270 Make initialization of static threadpool thread-safe
Signed-off-by: Bill Havanki <bh...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/18006d24
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/18006d24
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/18006d24
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: 18006d245372640472ecc9f987a32cb989cb3be6
Parents: f76b8e0
Author: Vikram Srivastava <vi...@cloudera.com>
Authored: Tue Jan 28 23:29:10 2014 -0800
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:43:40 2014 -0500
----------------------------------------------------------------------
.../apache/accumulo/server/master/tableOps/BulkImport.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/18006d24/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
index 5e85277..2281eea 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
@@ -476,19 +476,20 @@ class LoadFiles extends MasterRepo {
return 500;
return 0;
}
-
- synchronized void initializeThreadPool(Master master) {
+
+ private static synchronized ExecutorService getThreadPool(Master master) {
if (threadPool == null) {
int threadPoolSize = master.getSystemConfiguration().getCount(Property.MASTER_BULK_THREADPOOL_SIZE);
ThreadPoolExecutor pool = new SimpleThreadPool(threadPoolSize, "bulk import");
pool.allowCoreThreadTimeOut(true);
threadPool = new TraceExecutorService(pool);
}
+ return threadPool;
}
@Override
public Repo<Master> call(final long tid, final Master master) throws Exception {
- initializeThreadPool(master);
+ ExecutorService executor = getThreadPool(master);
final SiteConfiguration conf = ServerConfiguration.getSiteConfiguration();
FileSystem fs = master.getFileSystem();
List<FileStatus> files = new ArrayList<FileStatus>();
@@ -525,7 +526,7 @@ class LoadFiles extends MasterRepo {
// Use the threadpool to assign files one-at-a-time to the server
final List<String> loaded = Collections.synchronizedList(new ArrayList<String>());
for (final String file : filesToLoad) {
- results.add(threadPool.submit(new Callable<List<String>>() {
+ results.add(executor.submit(new Callable<List<String>>() {
@Override
public List<String> call() {
List<String> failures = new ArrayList<String>();
[4/6] git commit: Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Posted by bh...@apache.org.
Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a4e56260
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a4e56260
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a4e56260
Branch: refs/heads/master
Commit: a4e562602a4dbfff9611f292fd8369124279f83c
Parents: 9231648 18006d2
Author: Bill Havanki <bh...@cloudera.com>
Authored: Fri Mar 7 10:55:27 2014 -0500
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:55:27 2014 -0500
----------------------------------------------------------------------
----------------------------------------------------------------------
[5/6] git commit: Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Posted by bh...@apache.org.
Merge branch '1.5.2-SNAPSHOT' into 1.6.0-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a4e56260
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a4e56260
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a4e56260
Branch: refs/heads/1.6.0-SNAPSHOT
Commit: a4e562602a4dbfff9611f292fd8369124279f83c
Parents: 9231648 18006d2
Author: Bill Havanki <bh...@cloudera.com>
Authored: Fri Mar 7 10:55:27 2014 -0500
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:55:27 2014 -0500
----------------------------------------------------------------------
----------------------------------------------------------------------
[2/6] git commit: ACCUMULO-2270 Make initialization of static
threadpool thread-safe
Posted by bh...@apache.org.
ACCUMULO-2270 Make initialization of static threadpool thread-safe
Signed-off-by: Bill Havanki <bh...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/18006d24
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/18006d24
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/18006d24
Branch: refs/heads/master
Commit: 18006d245372640472ecc9f987a32cb989cb3be6
Parents: f76b8e0
Author: Vikram Srivastava <vi...@cloudera.com>
Authored: Tue Jan 28 23:29:10 2014 -0800
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:43:40 2014 -0500
----------------------------------------------------------------------
.../apache/accumulo/server/master/tableOps/BulkImport.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/18006d24/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
index 5e85277..2281eea 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
@@ -476,19 +476,20 @@ class LoadFiles extends MasterRepo {
return 500;
return 0;
}
-
- synchronized void initializeThreadPool(Master master) {
+
+ private static synchronized ExecutorService getThreadPool(Master master) {
if (threadPool == null) {
int threadPoolSize = master.getSystemConfiguration().getCount(Property.MASTER_BULK_THREADPOOL_SIZE);
ThreadPoolExecutor pool = new SimpleThreadPool(threadPoolSize, "bulk import");
pool.allowCoreThreadTimeOut(true);
threadPool = new TraceExecutorService(pool);
}
+ return threadPool;
}
@Override
public Repo<Master> call(final long tid, final Master master) throws Exception {
- initializeThreadPool(master);
+ ExecutorService executor = getThreadPool(master);
final SiteConfiguration conf = ServerConfiguration.getSiteConfiguration();
FileSystem fs = master.getFileSystem();
List<FileStatus> files = new ArrayList<FileStatus>();
@@ -525,7 +526,7 @@ class LoadFiles extends MasterRepo {
// Use the threadpool to assign files one-at-a-time to the server
final List<String> loaded = Collections.synchronizedList(new ArrayList<String>());
for (final String file : filesToLoad) {
- results.add(threadPool.submit(new Callable<List<String>>() {
+ results.add(executor.submit(new Callable<List<String>>() {
@Override
public List<String> call() {
List<String> failures = new ArrayList<String>();
[3/6] git commit: ACCUMULO-2270 Make initialization of static
threadpool thread-safe
Posted by bh...@apache.org.
ACCUMULO-2270 Make initialization of static threadpool thread-safe
Signed-off-by: Bill Havanki <bh...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/9231648a
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/9231648a
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/9231648a
Branch: refs/heads/master
Commit: 9231648ae1d7795456970f858b37f6bfc110e6ca
Parents: d2da431
Author: Vikram Srivastava <vi...@cloudera.com>
Authored: Tue Jan 28 23:29:10 2014 -0800
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:45:49 2014 -0500
----------------------------------------------------------------------
.../org/apache/accumulo/master/tableOps/BulkImport.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/9231648a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
index 430f14d..bdc89dd 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
@@ -484,19 +484,20 @@ class LoadFiles extends MasterRepo {
return 500;
return 0;
}
-
- synchronized void initializeThreadPool(Master master) {
+
+ private static synchronized ExecutorService getThreadPool(Master master) {
if (threadPool == null) {
int threadPoolSize = master.getSystemConfiguration().getCount(Property.MASTER_BULK_THREADPOOL_SIZE);
ThreadPoolExecutor pool = new SimpleThreadPool(threadPoolSize, "bulk import");
pool.allowCoreThreadTimeOut(true);
threadPool = new TraceExecutorService(pool);
}
+ return threadPool;
}
-
+
@Override
public Repo<Master> call(final long tid, final Master master) throws Exception {
- initializeThreadPool(master);
+ ExecutorService executor = getThreadPool(master);
final SiteConfiguration conf = ServerConfiguration.getSiteConfiguration();
VolumeManager fs = master.getFileSystem();
List<FileStatus> files = new ArrayList<FileStatus>();
@@ -533,7 +534,7 @@ class LoadFiles extends MasterRepo {
// Use the threadpool to assign files one-at-a-time to the server
final List<String> loaded = Collections.synchronizedList(new ArrayList<String>());
for (final String file : filesToLoad) {
- results.add(threadPool.submit(new Callable<List<String>>() {
+ results.add(executor.submit(new Callable<List<String>>() {
@Override
public List<String> call() {
List<String> failures = new ArrayList<String>();
[6/6] git commit: Merge branch '1.6.0-SNAPSHOT'
Posted by bh...@apache.org.
Merge branch '1.6.0-SNAPSHOT'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/feff9e62
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/feff9e62
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/feff9e62
Branch: refs/heads/master
Commit: feff9e62f7ccabc116900faf6f966a73f0ac68a7
Parents: 7b0e463 a4e5626
Author: Bill Havanki <bh...@cloudera.com>
Authored: Fri Mar 7 10:55:50 2014 -0500
Committer: Bill Havanki <bh...@cloudera.com>
Committed: Fri Mar 7 10:55:50 2014 -0500
----------------------------------------------------------------------
----------------------------------------------------------------------