public static void main(String[] args) { System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c")); System.out.println(Hexa32.toString32(100000001L)); } }
private void transfer(TraceContext ctx, HttpURLConnection urlCon, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } try { urlCon.setRequestProperty(conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); urlCon.setRequestProperty(conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); urlCon.setRequestProperty(conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); urlCon.setRequestProperty(conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); urlCon.setRequestProperty(B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid)); urlCon.setRequestProperty(B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid)); urlCon.setRequestProperty(B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid)); PluginHttpCallTrace.call(ctx, urlCon); } catch (Throwable t) { } } }
public String toBearerToken() { return "V1." + token + "." + Hexa32.toString32(serverId) + "." + userId; }
public static UserToken fromBearerToken(String token) { String arr[] = StringUtils.split(token, ".", 4); return new UserToken(arr[3], arr[1], (int) Hexa32.toLong32(arr[2])); }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SpanContainerPack "); sb.append(" gxid=").append(Hexa32.toString32(gxid)); sb.append(" spanCount=").append(Hexa32.toString32(spanCount)); return sb.toString(); }
/** * get thread detail of the object's threadId * * @param objHash * @param threadId * @param txidName This value is for valuable service related information. (like service name & a sql that currently running) * @param txid This value has higher priority than txidName.(txidName is String type from Hexa32.toString32(txid) / txid is long type) * @param serverId optional if web instance just connected one collector server. * @return */ @GET @Path("/thread/{threadId}/ofObject/{objHash}") @Consumes(MediaType.APPLICATION_JSON) public CommonResultView<ActiveThread> retrieveActiveThread( @PathParam("objHash") @Valid @NotNull final int objHash, @PathParam("threadId") @Valid @NotNull final long threadId, @QueryParam("txidName") final String txidName, @QueryParam("txid") long txid, @QueryParam("serverId") final int serverId) { if (txid == 0L && StringUtils.isNotBlank(txidName)) { txid = Hexa32.toLong32(txidName); } Server server = ServerManager.getInstance().getServerIfNullDefault(serverId); ActiveThread activeThread = activeServiceService.retrieveActiveThread(objHash, threadId, txid, server); return CommonResultView.success(activeThread); } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SpanContainerPack "); sb.append(" gxid=").append(Hexa32.toString32(gxid)); sb.append(" spanCount=").append(Hexa32.toString32(spanCount)); return sb.toString(); }
public static void main(String[] args) { System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c")); System.out.println(Hexa32.toString32(100000001L)); System.out.println(Long.toHexString(792539709424970410L)); System.out.println("================================================="); System.out.println(Long.toHexString(-342343233040343034L)); System.out.println(UnsignedLongs.toString(-342343233040343034L, 16)); System.out.println(UnsignedLongs.parseUnsignedLong("fb3fc0a4b35f2006", 16)); System.out.println("================================================="); System.out.println(HexCodec.lowerHexToUnsignedLong("fb3fc0a4b35f2006")); } }
private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { try { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } httpclient.addHeader(req, conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); httpclient.addHeader(req, conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid)); httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid)); httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid)); PluginHttpCallTrace.call(ctx, httpclient, req); } catch (Exception e) { } } }
String value = re.getText(key); if (StringUtil.isNotEmpty(value)) { int resultKey = (int) Hexa32.toLong32(key); cache(resultKey, value);
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SpanContainerPack "); sb.append(" gxid=").append(Hexa32.toString32(gxid)); sb.append(" spanCount=").append(Hexa32.toString32(spanCount)); return sb.toString(); }
public static void main(String[] args) { System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c")); System.out.println(Hexa32.toString32(100000001L)); System.out.println(Long.toHexString(792539709424970410L)); System.out.println("================================================="); System.out.println(Long.toHexString(-342343233040343034L)); System.out.println(UnsignedLongs.toString(-342343233040343034L, 16)); System.out.println(UnsignedLongs.parseUnsignedLong("fb3fc0a4b35f2006", 16)); System.out.println("================================================="); System.out.println(HexCodec.lowerHexToUnsignedLong("fb3fc0a4b35f2006")); } }
private void transfer(IHttpClient httpclient, TraceContext ctx, Object req, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { try { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } httpclient.addHeader(req, conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); httpclient.addHeader(req, conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid)); httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid)); httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid)); PluginHttpCallTrace.call(ctx, httpclient, req); } catch (Exception e) { } } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SpanContainerPack "); sb.append(" gxid=").append(Hexa32.toString32(gxid)); sb.append(" spanCount=").append(Hexa32.toString32(spanCount)); return sb.toString(); }
public static void main(String[] args) { System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c")); System.out.println(Hexa32.toString32(100000001L)); System.out.println(Long.toHexString(792539709424970410L)); System.out.println("================================================="); System.out.println(Long.toHexString(-342343233040343034L)); System.out.println(UnsignedLongs.toString(-342343233040343034L, 16)); System.out.println(UnsignedLongs.parseUnsignedLong("fb3fc0a4b35f2006", 16)); System.out.println("================================================="); System.out.println(HexCodec.lowerHexToUnsignedLong("fb3fc0a4b35f2006")); } }
private void transfer(IHttpClient httpclient, TraceContext ctx, Object host, Object req, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { try { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } httpclient.addHeader(req, conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); httpclient.addHeader(req, conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid)); httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid)); httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid)); PluginHttpCallTrace.call(ctx, req); } catch (Exception e) { Logger.println("A178", e); ok = false; } } } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(xtype); sb.append(" ").append(Hexa32.toString32(hash)); sb.append(" ").append(text); return sb.toString(); }
public static void main(String[] args) { System.out.println(Hexa32.toLong32("z6eq8mqkdkpt7c")); System.out.println(Hexa32.toString32(100000001L)); System.out.println(Long.toHexString(792539709424970410L)); System.out.println("================================================="); System.out.println(Long.toHexString(-342343233040343034L)); System.out.println(UnsignedLongs.toString(-342343233040343034L, 16)); System.out.println(UnsignedLongs.parseUnsignedLong("fb3fc0a4b35f2006", 16)); System.out.println("================================================="); System.out.println(HexCodec.lowerHexToUnsignedLong("fb3fc0a4b35f2006")); } }
private void transfer(IHttpClient httpclient, TraceContext ctx, Object host, Object req, long calleeTxid) { Configure conf = Configure.getInstance(); if (conf.trace_interservice_enabled) { try { if (ctx.gxid == 0) { ctx.gxid = ctx.txid; } httpclient.addHeader(req, conf._trace_interservice_gxid_header_key, Hexa32.toString32(ctx.gxid)); httpclient.addHeader(req, conf._trace_interservice_caller_header_key, Hexa32.toString32(ctx.txid)); httpclient.addHeader(req, conf._trace_interservice_callee_header_key, Hexa32.toString32(calleeTxid)); httpclient.addHeader(req, conf._trace_interservice_caller_obj_header_key, String.valueOf(conf.getObjHash())); httpclient.addHeader(req, B3Constant.B3_HEADER_TRACEID, Hexa32.toUnsignedLongHex(ctx.gxid)); httpclient.addHeader(req, B3Constant.B3_HEADER_PARENTSPANID, Hexa32.toUnsignedLongHex(ctx.txid)); httpclient.addHeader(req, B3Constant.B3_HEADER_SPANID, Hexa32.toUnsignedLongHex(calleeTxid)); //httpclient.addHeader(oRtn, B3Constant.B3_HEADER_SAMPLED, "1"); omit means defer PluginHttpCallTrace.call(ctx, req); } catch (Throwable e) { Logger.println("A001", e); ok = false; } } } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(xtype); sb.append(" ").append(Hexa32.toString32(hash)); sb.append(" ").append(text); return sb.toString(); }