diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9354fb4ea2..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: java -before_script: ./build.sh pom.xml -script: export MAVEN_OPTS="-Xmx1024m" && mvn test --quiet -addons: - hostname: short-hostname -jdk: - - oraclejdk8 -notifications: - email: false diff --git a/screwdriver.yaml b/screwdriver.yaml new file mode 100644 index 0000000000..11a4352285 --- /dev/null +++ b/screwdriver.yaml @@ -0,0 +1,7 @@ +shared: + image: maven + +jobs: + main: + steps: + - run_arbitrary_script: apt-get update && apt-get install autoconf make -y && ./build.sh pom.xml && mvn clean test --quiet diff --git a/src/core/TSDB.java b/src/core/TSDB.java index 1a5683386f..9b3a872ba2 100644 --- a/src/core/TSDB.java +++ b/src/core/TSDB.java @@ -782,6 +782,7 @@ public Histogram getScanLatencyHistogram() { */ private static void collectUidStats(final UniqueId uid, final StatsCollector collector) { +System.out.println("Just testing prs."); collector.record("uid.cache-hit", uid.cacheHits(), "kind=" + uid.kind()); collector.record("uid.cache-miss", uid.cacheMisses(), "kind=" + uid.kind()); collector.record("uid.cache-size", uid.cacheSize(), "kind=" + uid.kind()); diff --git a/src/tools/CliUtils.java b/src/tools/CliUtils.java index f67c966dd4..17b74b0292 100644 --- a/src/tools/CliUtils.java +++ b/src/tools/CliUtils.java @@ -41,8 +41,6 @@ final class CliUtils { static final Method toBytes; /** Function used to convert a byte[] to a String. */ static final Method fromBytes; - /** Charset used to convert Strings to byte arrays and back. */ - static final Charset CHARSET; /** The single column family used by this class. */ static final byte[] ID_FAMILY; /** The single column family used by this class. */ @@ -58,9 +56,6 @@ final class CliUtils { // "THIS IS INTERNAL DO NOT USE". If only Java had C++'s "friend" or // a less stupid notion of a package. Field f; - f = uidclass.getDeclaredField("CHARSET"); - f.setAccessible(true); - CHARSET = (Charset) f.get(null); f = uidclass.getDeclaredField("ID_FAMILY"); f.setAccessible(true); ID_FAMILY = (byte[]) f.get(null); @@ -79,17 +74,17 @@ final class CliUtils { } } /** Qualifier for metrics meta data */ - static final byte[] METRICS_META = "metric_meta".getBytes(CHARSET); + static final byte[] METRICS_META = "metric_meta".getBytes(Const.ASCII_CHARSET); /** Qualifier for tagk meta data */ - static final byte[] TAGK_META = "tagk_meta".getBytes(CHARSET); + static final byte[] TAGK_META = "tagk_meta".getBytes(Const.ASCII_CHARSET); /** Qualifier for tagv meta data */ - static final byte[] TAGV_META = "tagv_meta".getBytes(CHARSET); + static final byte[] TAGV_META = "tagv_meta".getBytes(Const.ASCII_CHARSET); /** Qualifier for metrics UIDs */ - static final byte[] METRICS = "metrics".getBytes(CHARSET); + static final byte[] METRICS = "metrics".getBytes(Const.ASCII_CHARSET); /** Qualifier for tagk UIDs */ - static final byte[] TAGK = "tagk".getBytes(CHARSET); + static final byte[] TAGK = "tagk".getBytes(Const.ASCII_CHARSET); /** Qualifier for tagv UIDs */ - static final byte[] TAGV = "tagv".getBytes(CHARSET); + static final byte[] TAGV = "tagv".getBytes(Const.ASCII_CHARSET); /** * Returns the max metric ID from the UID table @@ -103,8 +98,8 @@ static long getMaxMetricID(final TSDB tsdb) { // first up, we need the max metric ID so we can split up the data table // amongst threads. final GetRequest get = new GetRequest(tsdb.uidTable(), new byte[] { 0 }); - get.family("id".getBytes(CHARSET)); - get.qualifier("metrics".getBytes(CHARSET)); + get.family("id".getBytes(Const.ASCII_CHARSET)); + get.qualifier("metrics".getBytes(Const.ASCII_CHARSET)); ArrayList row; try { row = tsdb.getClient().get(get).joinUninterruptibly(); diff --git a/src/tools/UidManager.java b/src/tools/UidManager.java index 5e4185d4f4..bcd01453f6 100644 --- a/src/tools/UidManager.java +++ b/src/tools/UidManager.java @@ -35,6 +35,7 @@ import org.hbase.async.PutRequest; import org.hbase.async.Scanner; +import net.opentsdb.core.Const; import net.opentsdb.core.TSDB; import net.opentsdb.meta.TSMeta; import net.opentsdb.uid.NoSuchUniqueId; @@ -300,7 +301,7 @@ private static int grep(final HBaseClient client, if (ignorecase) { regexp = "(?i)" + regexp; } - scanner.setKeyRegexp(regexp, CliUtils.CHARSET); + scanner.setKeyRegexp(regexp, Const.ASCII_CHARSET); boolean found = false; try { ArrayList> rows; diff --git a/src/tsd/RpcManager.java b/src/tsd/RpcManager.java index 86638c1a12..0e4046c993 100644 --- a/src/tsd/RpcManager.java +++ b/src/tsd/RpcManager.java @@ -252,11 +252,12 @@ private void initializeBuiltinRpcs(final String mode, final ImmutableMap.Builder telnet, final ImmutableMap.Builder http) { - final Boolean enableApi = tsdb.getConfig().getString("tsd.core.enable_api").equals("true"); - final Boolean enableUi = tsdb.getConfig().getString("tsd.core.enable_ui").equals("true"); - final Boolean enableDieDieDie = tsdb.getConfig().getString("tsd.no_diediedie").equals("false"); + final boolean enableApi = tsdb.getConfig().getBoolean("tsd.core.enable_api"); + final boolean enableUi = tsdb.getConfig().getBoolean("tsd.core.enable_ui"); + final boolean enableDieDieDie = tsdb.getConfig().getBoolean("tsd.no_diediedie"); - LOG.info("Mode: {}, HTTP UI Enabled: {}, HTTP API Enabled: {}", mode, enableUi, enableApi); + LOG.info("Mode: {}, HTTP UI Enabled: {}, HTTP API Enabled: {}", mode, + enableUi, enableApi); if (mode.equals("rw") || mode.equals("wo")) { final PutDataPointRpc put = new PutDataPointRpc(); diff --git a/src/uid/UniqueId.java b/src/uid/UniqueId.java index 22a384fc82..274ed04dee 100644 --- a/src/uid/UniqueId.java +++ b/src/uid/UniqueId.java @@ -12,7 +12,6 @@ // see . package net.opentsdb.uid; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -65,8 +64,6 @@ public enum UniqueIdType { TAGV } - /** Charset used to convert Strings to byte arrays and back. */ - private static final Charset CHARSET = Charset.forName("ISO-8859-1"); /** The single column family used by this class. */ private static final byte[] ID_FAMILY = toBytes("id"); /** The single column family used by this class. */ @@ -1260,11 +1257,11 @@ private void hbasePutWithRetry(final PutRequest put, short attempts, short wait) } private static byte[] toBytes(final String s) { - return s.getBytes(CHARSET); + return s.getBytes(Const.UTF8_CHARSET); } private static String fromBytes(final byte[] b) { - return new String(b, CHARSET); + return new String(b, Const.UTF8_CHARSET); } /** Returns a human readable string representation of the object. */ @@ -1588,21 +1585,21 @@ public Map call(final ArrayList row) // and the user hasn't put any metrics in, so log and return 0s LOG.info("Could not find the UID assignment row"); for (final byte[] kind : kinds) { - results.put(new String(kind, CHARSET), 0L); + results.put(new String(kind, Const.ASCII_CHARSET), 0L); } return results; } for (final KeyValue column : row) { - results.put(new String(column.qualifier(), CHARSET), + results.put(new String(column.qualifier(), Const.ASCII_CHARSET), Bytes.getLong(column.value())); } // if the user is starting with a fresh UID table, we need to account // for missing columns for (final byte[] kind : kinds) { - if (results.get(new String(kind, CHARSET)) == null) { - results.put(new String(kind, CHARSET), 0L); + if (results.get(new String(kind, Const.ASCII_CHARSET)) == null) { + results.put(new String(kind, Const.ASCII_CHARSET), 0L); } } return results; diff --git a/test/core/TestSpan.java b/test/core/TestSpan.java index b9c1b668f3..717201982d 100644 --- a/test/core/TestSpan.java +++ b/test/core/TestSpan.java @@ -73,7 +73,12 @@ public void before() throws Exception { when(RowKey.metricNameAsync(tsdb, HOUR1)) .thenReturn(Deferred.fromResult("sys.cpu.user")); } - + +@Test +public void failme() { + assertTrue(false); +} + @Test public void addRow() { final byte[] qual1 = { 0x00, 0x07 };