ACCUMULO-4131 Clean up UTF_8 constants
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/46958bf7 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/46958bf7 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/46958bf7 Branch: refs/heads/master Commit: 46958bf7bc160f35f0cea23ddc3ec946a1d5adbd Parents: 5125e4e Author: Christopher Tubbs <ctubb...@apache.org> Authored: Tue Feb 2 21:03:41 2016 -0500 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Tue Feb 2 21:03:41 2016 -0500 ---------------------------------------------------------------------- .../java/org/apache/accumulo/core/Constants.java | 10 ++++------ .../accumulo/core/util/ByteBufferUtilTest.java | 16 ++++++++-------- .../core/util/UnsynchronizedBufferTest.java | 10 +++++----- .../org/apache/accumulo/proxy/ProxyServerTest.java | 5 ++--- .../accumulo/server/util/FileSystemMonitorTest.java | 3 +-- .../vfs/providers/HdfsFileContentInfoFactory.java | 3 ++- .../classloader/vfs/providers/HdfsFileSystem.java | 3 ++- .../vfs/providers/HdfsRandomAccessContent.java | 4 ++-- .../apache/accumulo/harness/MiniClusterHarness.java | 5 +++-- .../apache/accumulo/test/ConditionalWriterIT.java | 6 +++--- .../apache/accumulo/test/functional/DeleteIT.java | 5 ++--- .../accumulo/test/functional/ReadWriteIT.java | 9 ++++----- .../apache/accumulo/test/functional/RestartIT.java | 13 +++++-------- .../accumulo/test/functional/RestartStressIT.java | 8 +++----- .../apache/accumulo/test/functional/SplitIT.java | 7 +++---- .../trace/instrument/receivers/ZooSpanClient.java | 3 +-- 16 files changed, 50 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/core/src/main/java/org/apache/accumulo/core/Constants.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/Constants.java b/core/src/main/java/org/apache/accumulo/core/Constants.java index 9897262..b4769cf 100644 --- a/core/src/main/java/org/apache/accumulo/core/Constants.java +++ b/core/src/main/java/org/apache/accumulo/core/Constants.java @@ -18,22 +18,20 @@ package org.apache.accumulo.core; import static com.google.common.base.Charsets.UTF_8; -import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import org.apache.accumulo.core.security.Authorizations; -import com.google.common.base.Charsets; - public class Constants { + /** - * @deprecated since 1.5.3, 1.6.2; statically import Guava's {@link Charsets#UTF_8} or Java 7's built-in StandardCharsets.UTF_8 or use - * {@link Charset#forName(String)} with "UTF-8" instead + * @deprecated since 1.5.3, 1.6.2; statically import Guava's {@link com.google.common.base.Charsets#UTF_8} or Java 7's built-in StandardCharsets.UTF_8 or use + * {@link java.nio.charset.Charset#forName(String)} with "UTF-8" instead */ @Deprecated - public static final Charset UTF8 = UTF_8; + public static final java.nio.charset.Charset UTF8 = UTF_8; public static final String VERSION = FilteredConstants.VERSION; // Zookeeper locations http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/core/src/test/java/org/apache/accumulo/core/util/ByteBufferUtilTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/ByteBufferUtilTest.java b/core/src/test/java/org/apache/accumulo/core/util/ByteBufferUtilTest.java index f4ca0e9..a21f598 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/ByteBufferUtilTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/ByteBufferUtilTest.java @@ -17,6 +17,8 @@ package org.apache.accumulo.core.util; +import static com.google.common.base.Charsets.UTF_8; + import java.nio.ByteBuffer; import java.util.Collections; import java.util.List; @@ -26,25 +28,23 @@ import org.apache.hadoop.io.Text; import org.junit.Assert; import org.junit.Test; -import com.google.common.base.Charsets; - public class ByteBufferUtilTest { private static void assertEquals(String expected, ByteBuffer bb) { Assert.assertEquals(new Text(expected), ByteBufferUtil.toText(bb)); - Assert.assertEquals(expected, new String(ByteBufferUtil.toBytes(bb), Charsets.UTF_8)); + Assert.assertEquals(expected, new String(ByteBufferUtil.toBytes(bb), UTF_8)); Assert.assertEquals(expected, ByteBufferUtil.toString(bb)); List<byte[]> bal = ByteBufferUtil.toBytesList(Collections.singletonList(bb)); Assert.assertEquals(1, bal.size()); - Assert.assertEquals(expected, new String(bal.get(0), Charsets.UTF_8)); + Assert.assertEquals(expected, new String(bal.get(0), UTF_8)); Assert.assertEquals(new ArrayByteSequence(expected), new ArrayByteSequence(bb)); } @Test public void testNonZeroArrayOffset() { - byte[] data = "0123456789".getBytes(Charsets.UTF_8); + byte[] data = "0123456789".getBytes(UTF_8); ByteBuffer bb1 = ByteBuffer.wrap(data, 3, 4); @@ -69,7 +69,7 @@ public class ByteBufferUtilTest { @Test public void testZeroArrayOffsetAndNonZeroPosition() { - byte[] data = "0123456789".getBytes(Charsets.UTF_8); + byte[] data = "0123456789".getBytes(UTF_8); ByteBuffer bb1 = ByteBuffer.wrap(data, 3, 4); assertEquals("3456", bb1); @@ -77,7 +77,7 @@ public class ByteBufferUtilTest { @Test public void testZeroArrayOffsetAndPosition() { - byte[] data = "0123456789".getBytes(Charsets.UTF_8); + byte[] data = "0123456789".getBytes(UTF_8); ByteBuffer bb1 = ByteBuffer.wrap(data, 0, 4); assertEquals("0123", bb1); } @@ -86,7 +86,7 @@ public class ByteBufferUtilTest { public void testDirectByteBuffer() { // allocate direct so it does not have a backing array ByteBuffer bb = ByteBuffer.allocateDirect(10); - bb.put("0123456789".getBytes(Charsets.UTF_8)); + bb.put("0123456789".getBytes(UTF_8)); bb.rewind(); assertEquals("0123456789", bb); http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/core/src/test/java/org/apache/accumulo/core/util/UnsynchronizedBufferTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/accumulo/core/util/UnsynchronizedBufferTest.java b/core/src/test/java/org/apache/accumulo/core/util/UnsynchronizedBufferTest.java index 6416219..64044f9 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/UnsynchronizedBufferTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/UnsynchronizedBufferTest.java @@ -16,6 +16,8 @@ */ package org.apache.accumulo.core.util; +import static com.google.common.base.Charsets.UTF_8; + import java.nio.ByteBuffer; import org.junit.Assert; @@ -23,8 +25,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import com.google.common.base.Charsets; - public class UnsynchronizedBufferTest { @Rule @@ -32,13 +32,13 @@ public class UnsynchronizedBufferTest { @Test public void testByteBufferConstructor() { - byte[] test = "0123456789".getBytes(Charsets.UTF_8); + byte[] test = "0123456789".getBytes(UTF_8); ByteBuffer bb1 = ByteBuffer.wrap(test); UnsynchronizedBuffer.Reader ub = new UnsynchronizedBuffer.Reader(bb1); byte[] buf = new byte[10]; ub.readBytes(buf); - Assert.assertEquals("0123456789", new String(buf, Charsets.UTF_8)); + Assert.assertEquals("0123456789", new String(buf, UTF_8)); ByteBuffer bb2 = ByteBuffer.wrap(test, 3, 5); @@ -46,7 +46,7 @@ public class UnsynchronizedBufferTest { buf = new byte[5]; // should read data from offset 3 where the byte buffer starts ub.readBytes(buf); - Assert.assertEquals("34567", new String(buf, Charsets.UTF_8)); + Assert.assertEquals("34567", new String(buf, UTF_8)); buf = new byte[6]; // the byte buffer has the extra byte, but should not be able to read it... http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/proxy/src/test/java/org/apache/accumulo/proxy/ProxyServerTest.java ---------------------------------------------------------------------- diff --git a/proxy/src/test/java/org/apache/accumulo/proxy/ProxyServerTest.java b/proxy/src/test/java/org/apache/accumulo/proxy/ProxyServerTest.java index f656c32..956044c 100644 --- a/proxy/src/test/java/org/apache/accumulo/proxy/ProxyServerTest.java +++ b/proxy/src/test/java/org/apache/accumulo/proxy/ProxyServerTest.java @@ -16,8 +16,9 @@ */ package org.apache.accumulo.proxy; +import static com.google.common.base.Charsets.UTF_8; + import java.nio.ByteBuffer; -import java.nio.charset.Charset; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,8 +37,6 @@ import org.junit.Test; */ public class ProxyServerTest { - private static final Charset UTF_8 = Charset.forName("UTF-8"); - @Test public void updateAndFlushClosesWriterOnExceptionFromAddCells() throws Exception { ProxyServer server = EasyMock.createMockBuilder(ProxyServer.class).addMockedMethod("getWriter", ByteBuffer.class, String.class, WriterOptions.class) http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/server/base/src/test/java/org/apache/accumulo/server/util/FileSystemMonitorTest.java ---------------------------------------------------------------------- diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/FileSystemMonitorTest.java b/server/base/src/test/java/org/apache/accumulo/server/util/FileSystemMonitorTest.java index ec389fd..5b5b7ac 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/util/FileSystemMonitorTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/util/FileSystemMonitorTest.java @@ -16,13 +16,13 @@ */ package org.apache.accumulo.server.util; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; -import java.nio.charset.Charset; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -34,7 +34,6 @@ import org.slf4j.LoggerFactory; public class FileSystemMonitorTest { private static final Logger log = LoggerFactory.getLogger(FileSystemMonitorTest.class); - private static final Charset UTF_8 = Charset.forName("UTF-8"); @Test public void testFilteredMountEntries() throws Exception { http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java ---------------------------------------------------------------------- diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java index 2621255..b1a4abe 100644 --- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java +++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileContentInfoFactory.java @@ -28,8 +28,9 @@ import org.apache.commons.vfs2.impl.DefaultFileContentInfo; * @since 2.1 */ public class HdfsFileContentInfoFactory implements FileContentInfoFactory { + private static final java.nio.charset.Charset UTF_8 = java.nio.charset.Charset.forName("UTF-8"); private static final String CONTENT = "text/plain"; - private static final String ENCODING = "UTF-8"; + private static final String ENCODING = UTF_8.name(); /** * Creates a FileContentInfo for a the given FileContent. http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java ---------------------------------------------------------------------- diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java index 7ad68f9..8d45555 100644 --- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java +++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java @@ -41,6 +41,7 @@ import org.apache.hadoop.fs.Path; * @since 2.1 */ public class HdfsFileSystem extends AbstractFileSystem { + private static final java.nio.charset.Charset UTF_8 = java.nio.charset.Charset.forName("UTF-8"); private static final Log log = LogFactory.getLog(HdfsFileSystem.class); private FileSystem fs; @@ -111,7 +112,7 @@ public class HdfsFileSystem extends AbstractFileSystem { if (null == file) { String path = null; try { - path = URLDecoder.decode(name.getPath(), "UTF-8"); + path = URLDecoder.decode(name.getPath(), UTF_8.name()); } catch (final UnsupportedEncodingException e) { path = name.getPath(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java ---------------------------------------------------------------------- diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java index a9bbe55..30140ba 100644 --- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java +++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsRandomAccessContent.java @@ -20,7 +20,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.nio.charset.Charset; import org.apache.commons.vfs2.RandomAccessContent; import org.apache.hadoop.fs.FSDataInputStream; @@ -34,6 +33,7 @@ import org.apache.hadoop.fs.Path; * @since 2.1 */ public class HdfsRandomAccessContent implements RandomAccessContent { + private static final java.nio.charset.Charset UTF_8 = java.nio.charset.Charset.forName("UTF-8"); private final FileSystem fs; private final Path path; private final FSDataInputStream fis; @@ -154,7 +154,7 @@ public class HdfsRandomAccessContent implements RandomAccessContent { */ @Override public String readLine() throws IOException { - BufferedReader d = new BufferedReader(new InputStreamReader(this.fis, Charset.forName("UTF-8"))); + BufferedReader d = new BufferedReader(new InputStreamReader(this.fis, UTF_8)); return d.readLine(); } http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java index abdb627..5fc8b94 100644 --- a/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java +++ b/test/src/test/java/org/apache/accumulo/harness/MiniClusterHarness.java @@ -16,6 +16,8 @@ */ package org.apache.accumulo.harness; +import static com.google.common.base.Charsets.UTF_8; + import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -32,7 +34,6 @@ import org.apache.accumulo.test.functional.NativeMapIT; import org.apache.accumulo.test.util.CertUtils; import org.apache.hadoop.conf.Configuration; -import com.google.common.base.Charsets; import com.google.common.base.Preconditions; /** @@ -73,7 +74,7 @@ public class MiniClusterHarness { Preconditions.checkNotNull(token); Preconditions.checkArgument(PasswordToken.class.isAssignableFrom(token.getClass())); - String passwd = new String(((PasswordToken) token).getPassword(), Charsets.UTF_8); + String passwd = new String(((PasswordToken) token).getPassword(), UTF_8); MiniAccumuloConfigImpl cfg = new MiniAccumuloConfigImpl(AccumuloClusterIT.createTestDir(testClassName + "_" + testMethodName), passwd); // Enable native maps by default http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java index d32bc43..1579b34 100644 --- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java +++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java @@ -17,6 +17,7 @@ package org.apache.accumulo.test; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -96,7 +97,6 @@ import org.junit.Assert; import org.junit.Assume; import org.junit.Test; -import com.google.common.base.Charsets; import com.google.common.collect.Iterables; /** @@ -519,7 +519,7 @@ public class ConditionalWriterIT extends AccumuloClusterIT { Value val = super.getTopValue(); long l = Long.parseLong(val.toString()); String newVal = (l + amount) + ""; - return new Value(newVal.getBytes(Charsets.UTF_8)); + return new Value(newVal.getBytes(UTF_8)); } @Override @@ -537,7 +537,7 @@ public class ConditionalWriterIT extends AccumuloClusterIT { Value val = super.getTopValue(); long l = Long.parseLong(val.toString()); String newVal = l * amount + ""; - return new Value(newVal.getBytes(Charsets.UTF_8)); + return new Value(newVal.getBytes(UTF_8)); } @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java index f7396b3..d3d8b79 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/DeleteIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import org.apache.accumulo.cluster.AccumuloCluster; @@ -29,8 +30,6 @@ import org.apache.accumulo.test.TestRandomDeletes; import org.apache.accumulo.test.VerifyIngest; import org.junit.Test; -import com.google.common.base.Charsets; - public class DeleteIT extends AccumuloClusterIT { @Override @@ -44,7 +43,7 @@ public class DeleteIT extends AccumuloClusterIT { String tableName = getUniqueNames(1)[0]; c.tableOperations().create(tableName); PasswordToken token = (PasswordToken) getToken(); - deleteTest(c, getCluster(), new String(token.getPassword(), Charsets.UTF_8), tableName); + deleteTest(c, getCluster(), new String(token.getPassword(), UTF_8), tableName); try { getCluster().getClusterControl().adminStopAll(); } finally { http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java index 17d6584..f0a37e4 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -72,8 +73,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Charsets; - public class ReadWriteIT extends AccumuloClusterIT { private static final Logger log = LoggerFactory.getLogger(ReadWriteIT.class); @@ -187,8 +186,8 @@ public class ReadWriteIT extends AccumuloClusterIT { try { return control.exec( TestMultiTableIngest.class, - args("--count", "" + ROWS, "-u", "root", "-i", instance, "-z", keepers, "-p", new String(((PasswordToken) getToken()).getPassword(), - Charsets.UTF_8), "--tablePrefix", prefix)); + args("--count", "" + ROWS, "-u", "root", "-i", instance, "-z", keepers, "-p", new String(((PasswordToken) getToken()).getPassword(), UTF_8), + "--tablePrefix", prefix)); } catch (IOException e) { log.error("Error running MultiTableIngest", e); return -1; @@ -202,7 +201,7 @@ public class ReadWriteIT extends AccumuloClusterIT { return control.exec( TestMultiTableIngest.class, args("--count", "" + ROWS, "--readonly", "-u", "root", "-i", instance, "-z", keepers, "-p", new String( - ((PasswordToken) getToken()).getPassword(), Charsets.UTF_8), "--tablePrefix", prefix)); + ((PasswordToken) getToken()).getPassword(), UTF_8), "--tablePrefix", prefix)); } catch (IOException e) { log.error("Error running MultiTableIngest", e); return -1; http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java index b498412..a95c8d0 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import java.io.IOException; @@ -54,8 +55,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Charsets; - public class RestartIT extends AccumuloClusterIT { private static final Logger log = LoggerFactory.getLogger(RestartIT.class); @@ -118,9 +117,8 @@ public class RestartIT extends AccumuloClusterIT { @Override public Integer call() { try { - return control.exec(TestIngest.class, - new String[] {"-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-i", cluster.getInstanceName(), "-z", - cluster.getZooKeepers(), "--rows", "" + OPTS.rows, "--table", tableName}); + return control.exec(TestIngest.class, new String[] {"-u", "root", "-p", new String(token.getPassword(), UTF_8), "-i", cluster.getInstanceName(), + "-z", cluster.getZooKeepers(), "--rows", "" + OPTS.rows, "--table", tableName}); } catch (IOException e) { log.error("Error running TestIngest", e); return -1; @@ -192,9 +190,8 @@ public class RestartIT extends AccumuloClusterIT { @Override public Integer call() { try { - return control.exec(TestIngest.class, - new String[] {"-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-i", cluster.getInstanceName(), "-z", - cluster.getZooKeepers(), "--rows", Integer.toString(VOPTS.rows), "--table", tableName}); + return control.exec(TestIngest.class, new String[] {"-u", "root", "-p", new String(token.getPassword(), UTF_8), "-i", cluster.getInstanceName(), + "-z", cluster.getZooKeepers(), "--rows", Integer.toString(VOPTS.rows), "--table", tableName}); } catch (Exception e) { log.error("Error running TestIngest", e); return -1; http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java index c4b3afd..57456b6 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/RestartStressIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import java.util.HashMap; @@ -44,8 +45,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Charsets; - public class RestartStressIT extends AccumuloClusterIT { private static final Logger log = LoggerFactory.getLogger(RestartStressIT.class); @@ -109,9 +108,8 @@ public class RestartStressIT extends AccumuloClusterIT { @Override public Integer call() { try { - return control.exec(TestIngest.class, - new String[] {"-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-i", cluster.getInstanceName(), "-z", - cluster.getZooKeepers(), "--rows", "" + IOPTS.rows, "--table", tableName}); + return control.exec(TestIngest.class, new String[] {"-u", "root", "-p", new String(token.getPassword(), UTF_8), "-i", cluster.getInstanceName(), + "-z", cluster.getZooKeepers(), "--rows", "" + IOPTS.rows, "--table", tableName}); } catch (Exception e) { log.error("Error running TestIngest", e); return -1; http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java index 2f010c0..910fcbc 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/SplitIT.java @@ -16,6 +16,7 @@ */ package org.apache.accumulo.test.functional; +import static com.google.common.base.Charsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -52,8 +53,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Charsets; - public class SplitIT extends AccumuloClusterIT { private static final Logger log = LoggerFactory.getLogger(SplitIT.class); @@ -158,7 +157,7 @@ public class SplitIT extends AccumuloClusterIT { assertEquals( 0, getCluster().getClusterControl().exec(CheckForMetadataProblems.class, - new String[] {"-i", cluster.getInstanceName(), "-u", "root", "-p", new String(token.getPassword(), Charsets.UTF_8), "-z", cluster.getZooKeepers()})); + new String[] {"-i", cluster.getInstanceName(), "-u", "root", "-p", new String(token.getPassword(), UTF_8), "-z", cluster.getZooKeepers()})); } @Test @@ -187,7 +186,7 @@ public class SplitIT extends AccumuloClusterIT { c.tableOperations().create(tableName); PasswordToken token = (PasswordToken) getToken(); c.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K"); - DeleteIT.deleteTest(c, getCluster(), new String(token.getPassword(), Charsets.UTF_8), tableName); + DeleteIT.deleteTest(c, getCluster(), new String(token.getPassword(), UTF_8), tableName); c.tableOperations().flush(tableName, null, null, true); for (int i = 0; i < 5; i++) { UtilWaitThread.sleep(10 * 1000); http://git-wip-us.apache.org/repos/asf/accumulo/blob/46958bf7/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java ---------------------------------------------------------------------- diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java index ce0a703..251c07b 100644 --- a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java +++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/ZooSpanClient.java @@ -17,7 +17,6 @@ package org.apache.accumulo.trace.instrument.receivers; import java.io.IOException; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -39,7 +38,7 @@ public class ZooSpanClient extends SendSpansViaThrift { private static final Logger log = Logger.getLogger(ZooSpanClient.class); private static final int TOTAL_TIME_WAIT_CONNECT_MS = 10 * 1000; private static final int TIME_WAIT_CONNECT_CHECK_MS = 100; - private static final Charset UTF_8 = Charset.forName("UTF-8"); + private static final java.nio.charset.Charset UTF_8 = java.nio.charset.Charset.forName("UTF-8"); ZooKeeper zoo = null; final String path;