Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIG-5442: Add only credentials from setStoreLocation to the Job Conf #40

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,7 @@ private LinkedList<POStore> processStores(TezOperator tezOp,
ArrayList<POStore> storeLocations = new ArrayList<POStore>();
for (POStore st : stores) {
storeLocations.add(st);
StoreFuncInterface sFunc = st.getStoreFunc();
sFunc.setStoreLocation(st.getSFile().getFileName(), job);
sFunc.addCredentials(job.getCredentials(), job.getConfiguration());
addCredentials(job, st);
}

Path tmpLocation = null;
Expand Down Expand Up @@ -1135,6 +1133,19 @@ private LinkedList<POStore> processStores(TezOperator tezOp,
return stores;
}

private static void addCredentials(Job job, POStore st) throws IOException {
StoreFuncInterface sFunc = st.getStoreFunc();
sFunc.addCredentials(job.getCredentials(), job.getConfiguration());

// Backward compatibility - before addCredentials API was introduced, credentials were set in setStoreLocation method
Job storeJob = new Job(job.getConfiguration());
sFunc.setStoreLocation(st.getSFile().getFileName(), storeJob);
// Should always be the same object - Just future proofing
if (job.getCredentials() != storeJob.getCredentials()) {
job.getCredentials().mergeAll(storeJob.getCredentials());
}
}

@SuppressWarnings("rawtypes")
private void setIntermediateOutputKeyValue(byte keyType, Configuration conf, TezOperator tezOp,
boolean isConnectedToPackage, boolean isMergedInput) throws JobCreationException, ExecException {
Expand Down