Skip to content

Commit

Permalink
Correcting usage: proxyUser to kerberosUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Soman committed Dec 6, 2012
1 parent 2965762 commit 577378e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Expand Up @@ -76,7 +76,7 @@ public class HdfsFetcher implements FileFetcher {
private DynamicThrottleLimit globalThrottleLimit = null;
private static final int NUM_RETRIES = 3;
private String keytabLocation = "";
private String proxyUser = "voldemrt";
private String kerberosUser = "voldemrt";
private VoldemortConfig voldemortConfig = null;

public HdfsFetcher(VoldemortConfig config) {
Expand All @@ -98,7 +98,7 @@ public HdfsFetcher(VoldemortConfig config, DynamicThrottleLimit dynThrottleLimit
config.getFetcherBufferSize(),
config.getMinBytesPerSecond(),
config.getReadOnlyKeytabPath(),
config.getReadOnlyKerberosProxyUser());
config.getReadOnlyKerberosUser());

this.voldemortConfig = config;

Expand All @@ -123,7 +123,7 @@ public HdfsFetcher(DynamicThrottleLimit dynThrottleLimit,
int bufferSize,
long minBytesPerSecond,
String keytabLocation,
String proxyUser) {
String kerberosUser) {
if(maxBytesPerSecond != null) {
this.maxBytesPerSecond = maxBytesPerSecond;
this.throttler = new EventThrottler(this.maxBytesPerSecond);
Expand All @@ -140,7 +140,7 @@ public HdfsFetcher(DynamicThrottleLimit dynThrottleLimit,
this.status = null;
this.minBytesPerSecond = minBytesPerSecond;
this.keytabLocation = keytabLocation;
this.proxyUser = proxyUser;
this.kerberosUser = kerberosUser;
}

public File fetch(String sourceFileUrl, String destinationFile) throws IOException {
Expand Down Expand Up @@ -170,9 +170,9 @@ public File fetch(String sourceFileUrl, String destinationFile) throws IOExcepti
*/
synchronized(this) {
if(this.keytabLocation.length() > 0) {
logger.info("keytab path = " + keytabLocation + " and proxy user = "
+ proxyUser);
UserGroupInformation.loginUserFromKeytab(proxyUser, keytabLocation);
logger.info("keytab path = " + keytabLocation + " and Kerberos user = "
+ kerberosUser);
UserGroupInformation.loginUserFromKeytab(kerberosUser, keytabLocation);
logger.info("I've logged in and am now Doasing as "
+ UserGroupInformation.getCurrentUser().getUserName());
try {
Expand Down Expand Up @@ -542,11 +542,11 @@ public static void main(String[] args) throws Exception {
String url = args[0];

String keytabLocation = "";
String proxyUser = "";
String kerberosUser = "";
String hadoopPath = "";
if(args.length >= 4) {
keytabLocation = args[1];
proxyUser = args[2];
kerberosUser = args[2];
hadoopPath = args[3];
}

Expand All @@ -571,8 +571,8 @@ public static void main(String[] args) throws Exception {
* Otherwise get the default filesystem object.
*/
if(keytabLocation.length() > 0) {
logger.debug("keytab path = " + keytabLocation + " and proxy user = " + proxyUser);
UserGroupInformation.loginUserFromKeytab(proxyUser, keytabLocation);
logger.debug("keytab path = " + keytabLocation + " and Kerberos user = " + kerberosUser);
UserGroupInformation.loginUserFromKeytab(kerberosUser, keytabLocation);
logger.debug("I've logged in and am now Doasing as "
+ UserGroupInformation.getCurrentUser().getUserName());
try {
Expand Down
12 changes: 6 additions & 6 deletions src/java/voldemort/server/VoldemortConfig.java
Expand Up @@ -109,7 +109,7 @@ public class VoldemortConfig implements Serializable {
private long reportingIntervalBytes;
private int fetcherBufferSize;
private String readOnlyKeytabPath;
private String readOnlyKerberosProxyUser;
private String readOnlyKerberosUser;
private String hadoopConfigPath;

private OpTimeMap testingSlowQueueingDelays;
Expand Down Expand Up @@ -275,7 +275,7 @@ public VoldemortConfig(Props props) {
this.readOnlyKeytabPath = props.getString("readonly.keytab.path",
this.metadataDirectory
+ "/voldemrt.headless.keytab");
this.readOnlyKerberosProxyUser = props.getString("readonly.kerberos.proxyuser", "voldemrt");
this.readOnlyKerberosUser = props.getString("readonly.kerberos.user", "voldemrt");
this.setHadoopConfigPath(props.getString("readonly.hadoop.config.path",
this.metadataDirectory + "/hadoop-conf"));

Expand Down Expand Up @@ -1599,12 +1599,12 @@ public void setReadOnlyKeytabPath(String readOnlyKeytabPath) {
this.readOnlyKeytabPath = readOnlyKeytabPath;
}

public String getReadOnlyKerberosProxyUser() {
return readOnlyKerberosProxyUser;
public String getReadOnlyKerberosUser() {
return readOnlyKerberosUser;
}

public void setReadOnlyKerberosProxyUser(String readOnlyKerberosProxyUser) {
this.readOnlyKerberosProxyUser = readOnlyKerberosProxyUser;
public void setReadOnlyKerberosUser(String readOnlyKerberosUser) {
this.readOnlyKerberosUser = readOnlyKerberosUser;
}

public String getHadoopConfigPath() {
Expand Down

0 comments on commit 577378e

Please sign in to comment.