HttpTracerUtils { public static void parseTraceKey(Map<String, String> tracerMap, String key, String value) { String lowKey = key.substring(PREFIX.length()); String realKey = TRACER_KEY_MAP.get(lowKey); tracerMap.put(realKey == null ? lowKey : realKey, value); }  static boolean isTracerKey(String key); static void parseTraceKey(Map<String, String> tracerMap, String key, String value);  }
@Test public void parseTraceKey() { Map<String, String> map = new HashMap<String, String>(); HttpTracerUtils.parseTraceKey(map, RemotingConstants.RPC_TRACE_NAME + ".xx", "11"); Assert.assertEquals("11", map.get("xx")); HttpTracerUtils.parseTraceKey(map, RemotingConstants.RPC_TRACE_NAME + "." + RemotingConstants.RPC_ID_KEY, "11"); Assert.assertEquals("11", map.get(RemotingConstants.RPC_ID_KEY)); HttpTracerUtils.parseTraceKey(map, RemotingConstants.RPC_TRACE_NAME + "." + RemotingConstants.RPC_ID_KEY.toLowerCase(), "11"); Assert.assertEquals("11", map.get(RemotingConstants.RPC_ID_KEY)); }