You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2015/10/14 21:38:26 UTC
accumulo git commit: ACCUMULO-4028 copy the list of online servers
once
Repository: accumulo
Updated Branches:
refs/heads/1.6 0212f2ff2 -> eacc27ac4
ACCUMULO-4028 copy the list of online servers once
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/eacc27ac
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/eacc27ac
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/eacc27ac
Branch: refs/heads/1.6
Commit: eacc27ac47db3417a9ae405a96f7da6db2e0955b
Parents: 0212f2f
Author: Eric C. Newton <er...@gmail.com>
Authored: Wed Oct 14 15:32:58 2015 -0400
Committer: Eric C. Newton <er...@gmail.com>
Committed: Wed Oct 14 15:32:58 2015 -0400
----------------------------------------------------------------------
.../java/org/apache/accumulo/master/tableOps/BulkImport.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/eacc27ac/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 5320aae..37edbc9 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
@@ -538,6 +538,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>());
+ final TServerInstance servers[] = master.onlineTabletServers().toArray(new TServerInstance[0]);
final Random random = new Random();
for (final String file : filesToLoad) {
results.add(executor.submit(new Callable<List<String>>() {
@@ -551,7 +552,6 @@ class LoadFiles extends MasterRepo {
// this is running on the master and there are lots of connections to tablet servers
// serving the metadata tablets
long timeInMillis = master.getConfiguration().getConfiguration().getTimeInMillis(Property.MASTER_BULK_TIMEOUT);
- TServerInstance servers[] = master.onlineTabletServers().toArray(new TServerInstance[0]);
server = servers[random.nextInt(servers.length)].getLocation().toString();
client = ThriftUtil.getTServerClient(server, master.getConfiguration().getConfiguration(), timeInMillis);
List<String> attempt = Collections.singletonList(file);
@@ -566,9 +566,7 @@ class LoadFiles extends MasterRepo {
} catch (Exception ex) {
log.error("rpc failed server:" + server + ", tid:" + tid + " " + ex);
} finally {
- if (client != null) {
- ThriftUtil.returnClient(client);
- }
+ ThriftUtil.returnClient(client);
}
return failures;
}