@Test public void testEncryptedMerger() throws Throwable { jobConf.setBoolean(MRJobConfig.MR_ENCRYPTED_INTERMEDIATE_DATA, true); conf.setBoolean(MRJobConfig.MR_ENCRYPTED_INTERMEDIATE_DATA, true); Credentials credentials = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(new byte[16], credentials); UserGroupInformation.getCurrentUser().addCredentials(credentials); testInMemoryAndOnDiskMerger(); }
/** * Utility method to check if the Encrypted Spill Key needs to be set into the * user credentials of the user running the Map / Reduce Task * @param task The Map / Reduce task to set the Encrypted Spill information in * @throws Exception */ public static void setEncryptedSpillKeyIfRequired(Task task) throws Exception { if ((task != null) && (task.getEncryptedSpillKey() != null) && (task .getEncryptedSpillKey().length > 1)) { Credentials creds = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(task.getEncryptedSpillKey(), creds); UserGroupInformation.getCurrentUser().addCredentials(creds); } }
/** * Utility method to check if the Encrypted Spill Key needs to be set into the * user credentials of the user running the Map / Reduce Task * @param task The Map / Reduce task to set the Encrypted Spill information in * @throws Exception */ public static void setEncryptedSpillKeyIfRequired(Task task) throws Exception { if ((task != null) && (task.getEncryptedSpillKey() != null) && (task .getEncryptedSpillKey().length > 1)) { Credentials creds = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(task.getEncryptedSpillKey(), creds); UserGroupInformation.getCurrentUser().addCredentials(creds); } }
/** * Utility method to check if the Encrypted Spill Key needs to be set into the * user credentials of the user running the Map / Reduce Task * @param task The Map / Reduce task to set the Encrypted Spill information in * @throws Exception */ public static void setEncryptedSpillKeyIfRequired(Task task) throws Exception { if ((task != null) && (task.getEncryptedSpillKey() != null) && (task .getEncryptedSpillKey().length > 1)) { Credentials creds = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(task.getEncryptedSpillKey(), creds); UserGroupInformation.getCurrentUser().addCredentials(creds); } }
Credentials creds = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(keyGen.generateKey().getEncoded(), creds); UserGroupInformation.getCurrentUser().addCredentials(creds);
Credentials creds = UserGroupInformation.getCurrentUser().getCredentials(); TokenCache.setEncryptedSpillKey(keyGen.generateKey().getEncoded(), creds); UserGroupInformation.getCurrentUser().addCredentials(creds);