/** * Throttle a request with a key argument if necessary. * @param key key used for the table request */ public void throttle(K key) { throttle(getCredits(key, null)); }
/** * Throttle a request with a collection of keys as the argument if necessary. * @param keys collection of keys used for the table request */ public void throttle(Collection<K> keys) { throttle(getCredits(keys)); }
/** * Throttle a request with a collection of keys as the argument if necessary. * @param keys collection of keys used for the table request */ public void throttle(Collection<K> keys) { throttle(getCredits(keys)); }
/** * Throttle a request with a collection of keys as the argument if necessary. * @param keys collection of keys used for the table request */ public void throttle(Collection<K> keys) { throttle(getCredits(keys)); }
/** * Throttle a request with both the key and value arguments if necessary. * @param key key used for the table request * @param value value used for the table request */ public void throttle(K key, V value) { throttle(getCredits(key, value)); }
/** * Throttle a request with both the key and value arguments if necessary. * @param key key used for the table request * @param value value used for the table request */ public void throttle(K key, V value) { throttle(getCredits(key, value)); }
/** * Throttle a request with a collection of keys as the argument if necessary. * @param keys collection of keys used for the table request */ public void throttle(Collection<K> keys) { throttle(getCredits(keys)); }
/** * Throttle a request with both the key and value arguments if necessary. * @param key key used for the table request * @param value value used for the table request */ public void throttle(K key, V value) { throttle(getCredits(key, value)); }
/** * Throttle a request with a key argument if necessary. * @param key key used for the table request */ public void throttle(K key) { throttle(getCredits(key, null)); }
/** * Throttle a request with a key argument if necessary. * @param key key used for the table request */ public void throttle(K key) { throttle(getCredits(key, null)); }
/** * Throttle a request with both the key and value arguments if necessary. * @param key key used for the table request * @param value value used for the table request */ public void throttle(K key, V value) { throttle(getCredits(key, value)); }
/** * Throttle a request with a key argument if necessary. * @param key key used for the table request */ public void throttle(K key) { throttle(getCredits(key, null)); }
/** * Throttle a request with a key argument if necessary. * @param key key used for the table request */ public void throttle(K key) { throttle(getCredits(key, null)); }
/** * Throttle a request with a collection of keys as the argument if necessary. * @param keys collection of keys used for the table request */ public void throttle(Collection<K> keys) { throttle(getCredits(keys)); }
/** * Throttle a request with both the key and value arguments if necessary. * @param key key used for the table request * @param value value used for the table request */ public void throttle(K key, V value) { throttle(getCredits(key, value)); }
@Test public void testCreditKeys() { TableRateLimiter<String, String> rateLimitHelper = getThrottler(); Assert.assertEquals(9, rateLimitHelper.getCredits(Arrays.asList("abc", "efg", "hij"))); }
@Test public void testCreditKeyValue() { TableRateLimiter<String, String> rateLimitHelper = getThrottler(); Assert.assertEquals(6, rateLimitHelper.getCredits("abc", "efg")); }
@Test public void testCreditKeyOnly() { TableRateLimiter<String, String> rateLimitHelper = getThrottler(); Assert.assertEquals(3, rateLimitHelper.getCredits("abc", null)); }