use of org.apache.parquet.crypto.DecryptionKeyRetrieverMock in project parquet-mr by apache.
the class TestBloomFiltering method readUsers.
private List<PhoneBookWriter.User> readUsers(FilterPredicate filter, boolean useOtherFiltering, boolean useBloomFilter) throws IOException {
FileDecryptionProperties fileDecryptionProperties = null;
if (isEncrypted) {
DecryptionKeyRetrieverMock decryptionKeyRetrieverMock = new DecryptionKeyRetrieverMock().putKey(FOOTER_ENCRYPTION_KEY_ID, FOOTER_ENCRYPTION_KEY).putKey(COLUMN_ENCRYPTION_KEY1_ID, COLUMN_ENCRYPTION_KEY1).putKey(COLUMN_ENCRYPTION_KEY2_ID, COLUMN_ENCRYPTION_KEY2);
fileDecryptionProperties = FileDecryptionProperties.builder().withKeyRetriever(decryptionKeyRetrieverMock).build();
}
return PhoneBookWriter.readUsers(ParquetReader.builder(new GroupReadSupport(), file).withFilter(FilterCompat.get(filter)).withDecryption(fileDecryptionProperties).useDictionaryFilter(useOtherFiltering).useStatsFilter(useOtherFiltering).useRecordFilter(useOtherFiltering).useBloomFilter(useBloomFilter).useColumnIndexFilter(useOtherFiltering));
}
use of org.apache.parquet.crypto.DecryptionKeyRetrieverMock in project parquet-mr by apache.
the class TestColumnIndexFiltering method getFileDecryptionProperties.
private FileDecryptionProperties getFileDecryptionProperties() {
FileDecryptionProperties decryptionProperties = null;
if (isEncrypted) {
DecryptionKeyRetrieverMock decryptionKeyRetrieverMock = new DecryptionKeyRetrieverMock().putKey(FOOTER_ENCRYPTION_KEY_ID, FOOTER_ENCRYPTION_KEY).putKey(COLUMN_ENCRYPTION_KEY1_ID, COLUMN_ENCRYPTION_KEY1).putKey(COLUMN_ENCRYPTION_KEY2_ID, COLUMN_ENCRYPTION_KEY2);
decryptionProperties = FileDecryptionProperties.builder().withKeyRetriever(decryptionKeyRetrieverMock).build();
}
return decryptionProperties;
}
use of org.apache.parquet.crypto.DecryptionKeyRetrieverMock in project parquet-mr by apache.
the class SchemaCryptoPropertiesFactory method getFileDecryptionProperties.
@Override
public FileDecryptionProperties getFileDecryptionProperties(Configuration hadoopConfig, Path filePath) throws ParquetCryptoRuntimeException {
DecryptionKeyRetrieverMock keyRetriever = new DecryptionKeyRetrieverMock();
keyRetriever.putKey("footkey", FOOTER_KEY);
keyRetriever.putKey("col", COL_KEY);
return FileDecryptionProperties.builder().withPlaintextFilesAllowed().withKeyRetriever(keyRetriever).build();
}
Aggregations