private boolean canProcessDictionary(Page page) { if (!this.processDictionary || channels.length > 1 || !(page.getBlock(channels[0]) instanceof DictionaryBlock)) { return false; } if (inputHashChannel.isPresent()) { Block inputHashBlock = page.getBlock(inputHashChannel.get()); DictionaryBlock inputDataBlock = (DictionaryBlock) page.getBlock(channels[0]); if (!(inputHashBlock instanceof DictionaryBlock)) { // data channel is dictionary encoded but hash channel is not return false; } if (!((DictionaryBlock) inputHashBlock).getDictionarySourceId().equals(inputDataBlock.getDictionarySourceId())) { // dictionarySourceIds of data block and hash block do not match return false; } } return true; }
DictionaryId newDictionaryId = randomDictionaryId(); for (DictionaryBlock dictionaryBlock : blocks) { if (!firstDictionaryBlock.getDictionarySourceId().equals(dictionaryBlock.getDictionarySourceId())) { throw new IllegalArgumentException("dictionarySourceIds must be the same");
private boolean canProcessDictionary(Page page) { boolean processDictionary = this.processDictionary && maskChannel < 0 && channels.length == 1 && page.getBlock(channels[0]) instanceof DictionaryBlock; if (processDictionary && inputHashChannel.isPresent()) { Block inputHashBlock = page.getBlock(inputHashChannel.get()); DictionaryBlock inputDataBlock = (DictionaryBlock) page.getBlock(channels[0]); verify(inputHashBlock instanceof DictionaryBlock, "data channel is dictionary encoded but hash channel is not"); verify(((DictionaryBlock) inputHashBlock).getDictionarySourceId().equals(inputDataBlock.getDictionarySourceId()), "dictionarySourceIds of data block and hash block do not match"); } return processDictionary; }
DictionaryId newDictionaryId = randomDictionaryId(); for (DictionaryBlock dictionaryBlock : blocks) { if (!firstDictionaryBlock.getDictionarySourceId().equals(dictionaryBlock.getDictionarySourceId())) { throw new IllegalArgumentException("dictionarySourceIds must be the same");