Repository: accumulo Updated Branches: refs/heads/master dd420f631 -> b34df1aba
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/master Commit: eacc27ac47db3417a9ae405a96f7da6db2e0955b Parents: 0212f2f Author: Eric C. Newton <eric.new...@gmail.com> Authored: Wed Oct 14 15:32:58 2015 -0400 Committer: Eric C. Newton <eric.new...@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; }