Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Creating constants for the default kerberos principal and keytab path
  • Loading branch information
Chinmay Soman committed Dec 7, 2012
1 parent ef5420f commit fbe6718
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -66,7 +66,7 @@ public class HdfsFetcher implements FileFetcher {
private static final Logger logger = Logger.getLogger(HdfsFetcher.class);

private static String keytabPath = "";
private static String kerberosPrincipal = "voldemrt";
private static String kerberosPrincipal = VoldemortConfig.DEFAULT_KERBEROS_PRINCIPAL;

private final Long maxBytesPerSecond, reportingIntervalBytes;
private final int bufferSize;
Expand All @@ -76,8 +76,6 @@ public class HdfsFetcher implements FileFetcher {
private long minBytesPerSecond = 0;
private DynamicThrottleLimit globalThrottleLimit = null;
private static final int NUM_RETRIES = 3;
private String keytabLocation = "";
private String kerberosUser = "voldemrt";
private VoldemortConfig voldemortConfig = null;

public static final String FS_DEFAULT_NAME = "fs.default.name";
Expand Down
9 changes: 7 additions & 2 deletions src/java/voldemort/server/VoldemortConfig.java
Expand Up @@ -57,6 +57,10 @@ public class VoldemortConfig implements Serializable {
public static final long REPORTING_INTERVAL_BYTES = 25 * 1024 * 1024;
public static final int DEFAULT_BUFFER_SIZE = 64 * 1024;

// Kerberos support for read-only fetches (constants)
public static String DEFAULT_KERBEROS_PRINCIPAL = "voldemrt";
public static String DEFAULT_KEYTAB_PATH = "/voldemrt.headless.keytab";

private int nodeId;

private String voldemortHome;
Expand Down Expand Up @@ -274,8 +278,9 @@ public VoldemortConfig(Props props) {
DEFAULT_BUFFER_SIZE);
this.readOnlyKeytabPath = props.getString("readonly.keytab.path",
this.metadataDirectory
+ "/voldemrt.headless.keytab");
this.readOnlyKerberosUser = props.getString("readonly.kerberos.user", "voldemrt");
+ VoldemortConfig.DEFAULT_KEYTAB_PATH);
this.readOnlyKerberosUser = props.getString("readonly.kerberos.user",
VoldemortConfig.DEFAULT_KERBEROS_PRINCIPAL);
this.setHadoopConfigPath(props.getString("readonly.hadoop.config.path",
this.metadataDirectory + "/hadoop-conf"));

Expand Down

0 comments on commit fbe6718

Please sign in to comment.