Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 71639200B74 for ; Mon, 25 Jul 2016 03:26:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 70372160A95; Mon, 25 Jul 2016 01:26:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B5220160A93 for ; Mon, 25 Jul 2016 03:26:38 +0200 (CEST) Received: (qmail 28009 invoked by uid 500); 25 Jul 2016 01:26:37 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 27695 invoked by uid 99); 25 Jul 2016 01:26:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2016 01:26:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2AA8AE2F11; Mon, 25 Jul 2016 01:26:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stefania@apache.org To: commits@cassandra.apache.org Date: Mon, 25 Jul 2016 01:26:40 -0000 Message-Id: <9e6edb913d9249ab996059c921b49e71@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/10] cassandra git commit: cqlsh copyutil should get host metadata by connected address archived-at: Mon, 25 Jul 2016 01:26:39 -0000 cqlsh copyutil should get host metadata by connected address patch by Stefania Alborghetti; reviewed by Paulo Motta for CASSANDRA-11979 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b92ab60f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b92ab60f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b92ab60f Branch: refs/heads/trunk Commit: b92ab60f7254a49573574d083279b47a1a8bfa14 Parents: 3a7cfbd Author: Stefania Alborghetti Authored: Thu Jul 21 11:08:24 2016 +0800 Committer: Stefania Alborghetti Committed: Mon Jul 25 09:21:15 2016 +0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + pylib/cqlshlib/copyutil.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b92ab60f/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index cf09719..ebebbdc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.8 + * cqlsh copyutil should get host metadata by connected address (CASSANDRA-11979) * Fixed cqlshlib.test.remove_test_db (CASSANDRA-12214) * Synchronize ThriftServer::stop() (CASSANDRA-12105) * Use dedicated thread for JMX notifications (CASSANDRA-12146) http://git-wip-us.apache.org/repos/asf/cassandra/blob/b92ab60f/pylib/cqlshlib/copyutil.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py index c7a0e30..14172ef 100644 --- a/pylib/cqlshlib/copyutil.py +++ b/pylib/cqlshlib/copyutil.py @@ -205,7 +205,7 @@ class CopyTask(object): self.ks = ks self.table = table self.table_meta = self.shell.get_table_meta(self.ks, self.table) - self.local_dc = shell.conn.metadata.get_host(shell.hostname).datacenter + self.host = shell.conn.get_control_connection_host() self.fname = safe_normpath(fname) self.protocol_version = protocol_version self.config_file = config_file @@ -435,11 +435,11 @@ class CopyTask(object): return dict(ks=self.ks, table=self.table, - local_dc=self.local_dc, + local_dc=self.host.datacenter, columns=self.columns, options=self.options, connect_timeout=shell.conn.connect_timeout, - hostname=shell.hostname, + hostname=self.host.address, port=shell.port, ssl=shell.ssl, auth_provider=shell.auth_provider, @@ -634,8 +634,8 @@ class ExportTask(CopyTask): we use the cqlsh session host. """ shell = self.shell - hostname = shell.hostname - local_dc = self.local_dc + hostname = self.host.address + local_dc = self.host.datacenter ranges = dict() min_token = self.get_min_token() begin_token = self.begin_token