public List < String > mergeAndGetDictionary ( ) { final Set < String > mergedDictionary = new HashSet <> ( ) ; mergedDictionary . addAll ( keySerde . getDictionary ( ) ) ; for ( File dictFile : dictionaryFiles ) { try ( final MappingIterator < String > dictIterator = spillMapper . readValues ( spillMapper . getFactory ( ) . createParser ( new LZ4BlockInputStream ( new FileInputStream ( dictFile ) ) ) , spillMapper . getTypeFactory ( ) . constructType ( String . class ) ) ) { while ( dictIterator . hasNext ( ) ) { mergedDictionary . add ( dictIterator . next ( ) ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return new ArrayList <> ( mergedDictionary ) ; }
Returns a dictionary of string keys added to this grouper . Note that the dictionary of keySerde is spilled on local storage whenever the inner grouper is spilled . If there are spilled dictionaries this method loads them from disk and returns a merged dictionary .