@Test public void testUnescape() { AlluxioURI localUri1 = new AlluxioURI("/foo/alluxio/underFSStorage"); String localUriEscaped1 = MetricsSystem.escape(localUri1); String localUriUnescaped1 = MetricsSystem.unescape(localUriEscaped1); assertEquals(localUri1.toString(), localUriUnescaped1); AlluxioURI localUri2 = new AlluxioURI("/.alluxio.wololo/alluxio/underFSStorage"); String localUriEscaped2 = MetricsSystem.escape(localUri2); String localUriUnescaped2 = MetricsSystem.unescape(localUriEscaped2); assertEquals(localUri2.toString(), localUriUnescaped2); AlluxioURI localUri3 = new AlluxioURI("/%25alluxio%20user%2Ffoo%2Ebar/alluxio/underFSStorage"); String localUriEscaped3 = MetricsSystem.escape(localUri3); String localUriUnescaped3 = MetricsSystem.unescape(localUriEscaped3); assertEquals(localUri3.toString(), localUriUnescaped3); AlluxioURI localUri4 = new AlluxioURI("s3a: String localUriEscaped4 = MetricsSystem.escape(localUri4); String localUriUnescaped4 = MetricsSystem.unescape(localUriEscaped4); assertEquals(localUri4.toString(), localUriUnescaped4); }
public static String unescape(String uri) { return uri.replace("%2F", "/").replace("%2E", ".").replace("%25", "%"); }
MetricsSystem { public static String unescape(String uri) { return uri.replace("%2F", "/").replace("%2E", ".").replace("%25", "%"); } }
MetricsSystem { public static String unescape(String uri) { return uri.replace("%2F", "/").replace("%2E", ".").replace("%25", "%"); } private  MetricsSystem(); }
MetricsSystem { public static String unescape(String uri) { return uri.replace("%2F", "/").replace("%2E", ".").replace("%25", "%"); } private  MetricsSystem(); static void startSinks(String metricsConfFile); static synchronized void startSinksFromConfig(MetricsConfig config); static synchronized void stopSinks(); static synchronized int getNumSinks(); static String getMetricName(String name); static String getMasterMetricName(String name); static String getJobWorkerMetricName(String name); static void checkMinimalPollingPeriod(TimeUnit pollUnit, int pollPeriod); static String stripInstanceAndHost(String metricsName); static String escape(AlluxioURI uri); static String unescape(String uri); static Counter counter(String name); static Counter counterWithTags(String name, boolean shouldReport, String... tags); static Meter meter(String name); static Meter meterWithTags(String name, boolean shouldReport, String... tags); static Timer timer(String name); static synchronized void registerGaugeIfAbsent(String name, Gauge<T> metric); static List<alluxio.grpc.Metric> reportWorkerMetrics(); static List<alluxio.grpc.Metric> reportClientMetrics(); static Map<String, Set<Metric>> getMasterMetrics(Set<String> metricNames); @Nullable static Metric getMetricValue(String fullName); static Map<String, MetricValue> allMetrics(); @VisibleForTesting static void initShouldReportMetrics(InstanceType instanceType); static synchronized void resetAllMetrics(); @VisibleForTesting static void clearAllMetrics(); @VisibleForTesting static void resetCountersAndGauges(); }
MetricsSystem { public static String unescape(String uri) { return uri.replace("%2F", "/").replace("%2E", ".").replace("%25", "%"); } private  MetricsSystem(); static void startSinks(String metricsConfFile); static synchronized void startSinksFromConfig(MetricsConfig config); static synchronized void stopSinks(); static synchronized int getNumSinks(); static String getMetricName(String name); static String getMasterMetricName(String name); static String getJobWorkerMetricName(String name); static void checkMinimalPollingPeriod(TimeUnit pollUnit, int pollPeriod); static String stripInstanceAndHost(String metricsName); static String escape(AlluxioURI uri); static String unescape(String uri); static Counter counter(String name); static Counter counterWithTags(String name, boolean shouldReport, String... tags); static Meter meter(String name); static Meter meterWithTags(String name, boolean shouldReport, String... tags); static Timer timer(String name); static synchronized void registerGaugeIfAbsent(String name, Gauge<T> metric); static List<alluxio.grpc.Metric> reportWorkerMetrics(); static List<alluxio.grpc.Metric> reportClientMetrics(); static Map<String, Set<Metric>> getMasterMetrics(Set<String> metricNames); @Nullable static Metric getMetricValue(String fullName); static Map<String, MetricValue> allMetrics(); @VisibleForTesting static void initShouldReportMetrics(InstanceType instanceType); static synchronized void resetAllMetrics(); @VisibleForTesting static void clearAllMetrics(); @VisibleForTesting static void resetCountersAndGauges(); static final String CLUSTER; static final MetricRegistry METRIC_REGISTRY; static final String SINK_REGEX; }