@Test public void testTraceIdToId() { long ff = ZipkinSofaTracerSpanRemoteReporter.traceIdToId("FF"); Assert.assertTrue(ff == 255); long decimal88 = ZipkinSofaTracerSpanRemoteReporter.traceIdToId("8"); Assert.assertTrue(decimal88 == 8); }
public static long traceIdToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); int length = hexString.length(); if (length < 1) { throw new IllegalArgumentException("Malformed id(length must be more than zero): " + hexString); } if (length <= 8) { return Long.parseLong(hexString, 16); } else if (hexString.endsWith(processId)) { return Long.parseLong(hexString.substring(8, hexString.lastIndexOf(processId)), 10); } else { return Long.parseLong(hexString.substring(8), 10); } }
ZipkinSofaTracerSpanRemoteReporter implements SpanReportListener, Flushable, Closeable { public static long traceIdToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); int length = hexString.length(); if (length < 1) { throw new IllegalArgumentException("Malformed id(length must be more than zero): " + hexString); } if (length <= 8) { return Long.parseLong(hexString, 16); } else if (hexString.endsWith(processId)) { return Long.parseLong(hexString.substring(8, hexString.lastIndexOf(processId)), 10); } else { return Long.parseLong(hexString.substring(8), 10); } } }
ZipkinSofaTracerSpanRemoteReporter implements SpanReportListener, Flushable, Closeable { public static long traceIdToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); int length = hexString.length(); if (length < 1) { throw new IllegalArgumentException("Malformed id(length must be more than zero): " + hexString); } if (length <= 8) { return Long.parseLong(hexString, 16); } else if (hexString.endsWith(processId)) { return Long.parseLong(hexString.substring(8, hexString.lastIndexOf(processId)), 10); } else { return Long.parseLong(hexString.substring(8), 10); } } ZipkinSofaTracerSpanRemoteReporter(RestTemplate restTemplate, String baseUrl); }
ZipkinSofaTracerSpanRemoteReporter implements SpanReportListener, Flushable, Closeable { public static long traceIdToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); int length = hexString.length(); if (length < 1) { throw new IllegalArgumentException("Malformed id(length must be more than zero): " + hexString); } if (length <= 8) { return Long.parseLong(hexString, 16); } else if (hexString.endsWith(processId)) { return Long.parseLong(hexString.substring(8, hexString.lastIndexOf(processId)), 10); } else { return Long.parseLong(hexString.substring(8), 10); } } ZipkinSofaTracerSpanRemoteReporter(RestTemplate restTemplate, String baseUrl); @Override void onSpanReport(SofaTracerSpan span); @Override void flush(); @Override void close(); static long traceIdToId(String hexString); }
ZipkinSofaTracerSpanRemoteReporter implements SpanReportListener, Flushable, Closeable { public static long traceIdToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); int length = hexString.length(); if (length < 1) { throw new IllegalArgumentException("Malformed id(length must be more than zero): " + hexString); } if (length <= 8) { return Long.parseLong(hexString, 16); } else if (hexString.endsWith(processId)) { return Long.parseLong(hexString.substring(8, hexString.lastIndexOf(processId)), 10); } else { return Long.parseLong(hexString.substring(8), 10); } } ZipkinSofaTracerSpanRemoteReporter(RestTemplate restTemplate, String baseUrl); @Override void onSpanReport(SofaTracerSpan span); @Override void flush(); @Override void close(); static long traceIdToId(String hexString);  }