@Test public void testEscape() { AlluxioURI localUri1 = new AlluxioURI("/foo/alluxio/underFSStorage"); String localUriEscaped1 = MetricsSystem.escape(localUri1); assertEquals("%2Ffoo%2Falluxio%2FunderFSStorage", localUriEscaped1); AlluxioURI localUri2 = new AlluxioURI("/.alluxio.wololo/alluxio/underFSStorage"); String localUriEscaped2 = MetricsSystem.escape(localUri2); assertEquals("%2F%2Ealluxio%2Ewololo%2Falluxio%2FunderFSStorage", localUriEscaped2); AlluxioURI localUri3 = new AlluxioURI("/%25alluxio%20user%2Ffoo%2Ebar/alluxio/underFSStorage"); String localUriEscaped3 = MetricsSystem.escape(localUri3); assertEquals("%2F%2525alluxio%2520user%252Ffoo%252Ebar%2Falluxio%2FunderFSStorage", localUriEscaped3); AlluxioURI localUri4 = new AlluxioURI("s3a: String localUriEscaped4 = MetricsSystem.escape(localUri4); assertEquals("s3a:%2F%2Ftest%2FTasks+Export+%25282017–11–05+06%253A10+PM%252Ecsv", localUriEscaped4); }
public static String escape(AlluxioURI uri) { return CACHED_ESCAPED_PATH.computeIfAbsent(uri, u -> u.toString().replace("%", "%25") .replace("/", "%2F").replace(".", "%2E")); }
MetricsSystem { public static String escape(AlluxioURI uri) { return CACHED_ESCAPED_PATH.computeIfAbsent(uri, u -> u.toString().replace("%", "%25") .replace("/", "%2F").replace(".", "%2E")); } }
MetricsSystem { public static String escape(AlluxioURI uri) { return CACHED_ESCAPED_PATH.computeIfAbsent(uri, u -> u.toString().replace("%", "%25") .replace("/", "%2F").replace(".", "%2E")); } private  MetricsSystem(); }
MetricsSystem { public static String escape(AlluxioURI uri) { return CACHED_ESCAPED_PATH.computeIfAbsent(uri, u -> u.toString().replace("%", "%25") .replace("/", "%2F").replace(".", "%2E")); } 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 escape(AlluxioURI uri) { return CACHED_ESCAPED_PATH.computeIfAbsent(uri, u -> u.toString().replace("%", "%25") .replace("/", "%2F").replace(".", "%2E")); } 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; }