@Test public void testGetCustomTracingAnnotationsWithNone() { String url = "localhost;TenantId=abc;"; Map<String, String> customAnnotations = JDBCUtil.getAnnotations(url, new Properties()); assertTrue(customAnnotations.isEmpty()); }
public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) { Preconditions.checkNotNull(url); Preconditions.checkNotNull(info); Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info); Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size()); for (Map.Entry<String, String> prop : combinedProperties.entrySet()) { if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) && prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) { result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue()); } } return result; }
JDBCUtil { public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) { Preconditions.checkNotNull(url); Preconditions.checkNotNull(info); Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info); Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size()); for (Map.Entry<String, String> prop : combinedProperties.entrySet()) { if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) && prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) { result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue()); } } return result; } }
JDBCUtil { public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) { Preconditions.checkNotNull(url); Preconditions.checkNotNull(info); Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info); Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size()); for (Map.Entry<String, String> prop : combinedProperties.entrySet()) { if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) && prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) { result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue()); } } return result; } private  JDBCUtil(); }
JDBCUtil { public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) { Preconditions.checkNotNull(url); Preconditions.checkNotNull(info); Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info); Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size()); for (Map.Entry<String, String> prop : combinedProperties.entrySet()) { if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) && prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) { result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue()); } } return result; } private  JDBCUtil(); static String findProperty(String url, Properties info, String propName); static String removeProperty(String url, String propName); static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info); static Long getCurrentSCN(String url, Properties info); static Long getBuildIndexSCN(String url, Properties info); static int getMutateBatchSize(String url, Properties info, ReadOnlyProps props); static long getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props); static @Nullable PName getTenantId(String url, Properties info); static boolean getAutoCommit(String url, Properties info, boolean defaultValue); static Consistency getConsistencyLevel(String url, Properties info, String defaultValue); static boolean isCollectingRequestLevelMetricsEnabled(String url, Properties overrideProps, ReadOnlyProps queryServicesProps); static String getSchema(String url, Properties info, String defaultValue); }
JDBCUtil { public static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info) { Preconditions.checkNotNull(url); Preconditions.checkNotNull(info); Map<String, String> combinedProperties = getCombinedConnectionProperties(url, info); Map<String, String> result = newHashMapWithExpectedSize(combinedProperties.size()); for (Map.Entry<String, String> prop : combinedProperties.entrySet()) { if (prop.getKey().startsWith(ANNOTATION_ATTRIB_PREFIX) && prop.getKey().length() > ANNOTATION_ATTRIB_PREFIX.length()) { result.put(prop.getKey().substring(ANNOTATION_ATTRIB_PREFIX.length()), prop.getValue()); } } return result; } private  JDBCUtil(); static String findProperty(String url, Properties info, String propName); static String removeProperty(String url, String propName); static Map<String, String> getAnnotations(@NotNull String url, @NotNull Properties info); static Long getCurrentSCN(String url, Properties info); static Long getBuildIndexSCN(String url, Properties info); static int getMutateBatchSize(String url, Properties info, ReadOnlyProps props); static long getMutateBatchSizeBytes(String url, Properties info, ReadOnlyProps props); static @Nullable PName getTenantId(String url, Properties info); static boolean getAutoCommit(String url, Properties info, boolean defaultValue); static Consistency getConsistencyLevel(String url, Properties info, String defaultValue); static boolean isCollectingRequestLevelMetricsEnabled(String url, Properties overrideProps, ReadOnlyProps queryServicesProps); static String getSchema(String url, Properties info, String defaultValue);  }