TracingHelper { <T> T[] limitKeys(T[] keys) { if (keys != null && keys.length > maxKeysLength) { return Arrays.copyOfRange(keys, 0, maxKeysLength); } return keys; } TracingHelper(TracingConfiguration tracingConfiguration); Span buildSpan(String operationName, byte[][] keys); Span buildSpan(String operationName); Span buildSpan(String operationName, Object key); Span buildSpan(String operationName, byte[] key); Span buildSpan(String operationName, Object[] keys); static void onError(Throwable throwable, Span span); static String nullable(Object object); static String toString(Map<String, V> map); static String toString(byte[][] array); static String collectionToString(Collection<?> collection); static String toString(Collection<byte[]> collection); static String toString(List<String> list); static String toStringMap(Map<byte[], byte[]> map); static String toStringMap2(Map<byte[], V> map); static String mapToString(Map<K, V> map); T decorate(Span span, Supplier<T> supplier); void decorate(Span span, Action action); void decorateThrowing(Span span, ThrowingAction<T> action); V decorateThrowing(Span span, ThrowingSupplier<T, V> supplier); T doInScope(String command, byte[] key, Supplier<T> supplier); T doInScope(String command, Supplier<T> supplier); void doInScope(String command, byte[] key, Runnable runnable); void doInScope(String command, Runnable runnable); T doInScope(String command, byte[][] keys, Supplier<T> supplier); static final String COMPONENT_NAME; static final String DB_TYPE; }
@Test public void limitKeys() { TracingHelper helper = new TracingHelper(new TracingConfiguration.Builder(mockTracer) .withKeysMaxLength(2).build()); Object[] keys = {"one", "two", "three"}; assertEquals(2, helper.limitKeys(keys).length); }