use of org.apache.carbondata.core.localdictionary.dictionaryholder.MapBasedDictionaryStore in project carbondata by apache.
the class TestDictionaryStore method testDictionaryStoreWithMoreThanThreshold.
@Test
public void testDictionaryStoreWithMoreThanThreshold() {
DictionaryStore dictionaryStore = new MapBasedDictionaryStore(10);
boolean isException = false;
for (int i = 0; i < 15; i++) {
try {
dictionaryStore.putIfAbsent((i + "").getBytes());
} catch (DictionaryThresholdReachedException e) {
isException = true;
break;
}
}
Assert.assertTrue(isException);
Assert.assertTrue(dictionaryStore.isThresholdReached());
}
use of org.apache.carbondata.core.localdictionary.dictionaryholder.MapBasedDictionaryStore in project carbondata by apache.
the class TestDictionaryStore method testDictionaryStoreWithinThreshold.
@Test
public void testDictionaryStoreWithinThreshold() {
DictionaryStore dictionaryStore = new MapBasedDictionaryStore(10);
for (int i = 0; i < 10; i++) {
try {
dictionaryStore.putIfAbsent((i + "").getBytes());
Assert.assertTrue(true);
} catch (DictionaryThresholdReachedException e) {
Assert.assertTrue(false);
break;
}
}
}
Aggregations