Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E016C100EB for ; Fri, 20 Dec 2013 04:06:41 +0000 (UTC) Received: (qmail 83971 invoked by uid 500); 20 Dec 2013 04:06:40 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 83833 invoked by uid 500); 20 Dec 2013 04:06:38 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 83805 invoked by uid 99); 20 Dec 2013 04:06:35 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Dec 2013 04:06:35 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 203511EDC1; Fri, 20 Dec 2013 04:06:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Fri, 20 Dec 2013 04:06:35 -0000 Message-Id: In-Reply-To: <7d614bf7fd104b4883c23b90daa0286f@git.apache.org> References: <7d614bf7fd104b4883c23b90daa0286f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] git commit: ACCUMULO-1593 Applying Ted's patch to ensure UTF-8 String encoding applied to instance id pulled from ZK. ACCUMULO-1593 Applying Ted's patch to ensure UTF-8 String encoding applied to instance id pulled from ZK. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/041b482f Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/041b482f Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/041b482f Branch: refs/heads/1.5.1-SNAPSHOT Commit: 041b482f672bf6a147ac8c9d1646c5aee705d270 Parents: 5a421c7 Author: Josh Elser Authored: Thu Dec 19 22:23:03 2013 -0500 Committer: Josh Elser Committed: Thu Dec 19 22:23:03 2013 -0500 ---------------------------------------------------------------------- src/core/src/main/java/org/apache/accumulo/core/Constants.java | 3 +++ .../java/org/apache/accumulo/core/client/ZooKeeperInstance.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/041b482f/src/core/src/main/java/org/apache/accumulo/core/Constants.java ---------------------------------------------------------------------- diff --git a/src/core/src/main/java/org/apache/accumulo/core/Constants.java b/src/core/src/main/java/org/apache/accumulo/core/Constants.java index c85649d..6578101 100644 --- a/src/core/src/main/java/org/apache/accumulo/core/Constants.java +++ b/src/core/src/main/java/org/apache/accumulo/core/Constants.java @@ -16,6 +16,8 @@ */ package org.apache.accumulo.core; +import java.nio.charset.Charset; + import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.data.Key; @@ -28,6 +30,7 @@ import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; public class Constants { + public static final Charset UTF8 = Charset.forName("UTF-8"); public static final String VERSION = "1.4.5-SNAPSHOT"; public static final int DATA_VERSION = 4; public static final int PREV_DATA_VERSION = 3; http://git-wip-us.apache.org/repos/asf/accumulo/blob/041b482f/src/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java ---------------------------------------------------------------------- diff --git a/src/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java b/src/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java index 4cd4972..fcadd38 100644 --- a/src/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java +++ b/src/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java @@ -150,7 +150,7 @@ public class ZooKeeperInstance implements Instance { throw new RuntimeException("Instance name " + instanceName + " does not exist in zookeeper. Run \"accumulo org.apache.accumulo.server.util.ListInstances\" to see a list."); } - instanceId = new String(iidb); + instanceId = new String(iidb, Constants.UTF8); } if (zooCache.get(Constants.ZROOT + "/" + instanceId) == null) { @@ -260,7 +260,8 @@ public class ZooKeeperInstance implements Instance { ArgumentChecker.notNull(zooCache, instanceId); for (String name : zooCache.getChildren(Constants.ZROOT + Constants.ZINSTANCES)) { String instanceNamePath = Constants.ZROOT + Constants.ZINSTANCES + "/" + name; - UUID iid = UUID.fromString(new String(zooCache.get(instanceNamePath))); + byte[] bytes = zooCache.get(instanceNamePath); + UUID iid = UUID.fromString(new String(bytes, Constants.UTF8)); if (iid.equals(instanceId)) { return name; }