Search in sources :

Example 1 with DecryptionKeyRetrieverMock

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));
}
Also used : GroupReadSupport(org.apache.parquet.hadoop.example.GroupReadSupport) DecryptionKeyRetrieverMock(org.apache.parquet.crypto.DecryptionKeyRetrieverMock) FileDecryptionProperties(org.apache.parquet.crypto.FileDecryptionProperties)

Example 2 with DecryptionKeyRetrieverMock

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;
}
Also used : DecryptionKeyRetrieverMock(org.apache.parquet.crypto.DecryptionKeyRetrieverMock) FileDecryptionProperties(org.apache.parquet.crypto.FileDecryptionProperties)

Example 3 with DecryptionKeyRetrieverMock

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();
}
Also used : DecryptionKeyRetrieverMock(org.apache.parquet.crypto.DecryptionKeyRetrieverMock)

Aggregations

DecryptionKeyRetrieverMock (org.apache.parquet.crypto.DecryptionKeyRetrieverMock)3 FileDecryptionProperties (org.apache.parquet.crypto.FileDecryptionProperties)2 GroupReadSupport (org.apache.parquet.hadoop.example.GroupReadSupport)1