Java Code Examples for org.apache.hadoop.conf.Configuration.getEnum()

The following are Jave code examples for showing how to use getEnum() of the org.apache.hadoop.conf.Configuration class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: hadoop   File: SimulatedFSDataset.java   Source Code and License Vote up 6 votes
public SimulatedFSDataset(DataStorage storage, Configuration conf) {
  if (storage != null) {
    for (int i = 0; i < storage.getNumStorageDirs(); ++i) {
      storage.createStorageID(storage.getStorageDir(i), false);
    }
    this.datanodeUuid = storage.getDatanodeUuid();
  } else {
    this.datanodeUuid = "SimulatedDatanode-" + DataNode.generateUuid();
  }

  registerMBean(datanodeUuid);
  this.storage = new SimulatedStorage(
      conf.getLong(CONFIG_PROPERTY_CAPACITY, DEFAULT_CAPACITY),
      conf.getEnum(CONFIG_PROPERTY_STATE, DEFAULT_STATE));
  this.volume = new SimulatedVolume(this.storage);
}
 
Example 2
Project: hadoop-oss   File: ZlibFactory.java   Source Code and License Vote up 4 votes
public static CompressionStrategy getCompressionStrategy(Configuration conf) {
  return conf.getEnum("zlib.compress.strategy",
      CompressionStrategy.DEFAULT_STRATEGY);
}
 
Example 3
Project: hadoop-oss   File: ZlibFactory.java   Source Code and License Vote up 4 votes
public static CompressionLevel getCompressionLevel(Configuration conf) {
  return conf.getEnum("zlib.compress.level",
      CompressionLevel.DEFAULT_COMPRESSION);
}
 
Example 4
Project: hadoop   File: ZlibFactory.java   Source Code and License Vote up 4 votes
public static CompressionStrategy getCompressionStrategy(Configuration conf) {
  return conf.getEnum("zlib.compress.strategy",
      CompressionStrategy.DEFAULT_STRATEGY);
}
 
Example 5
Project: hadoop   File: ZlibFactory.java   Source Code and License Vote up 4 votes
public static CompressionLevel getCompressionLevel(Configuration conf) {
  return conf.getEnum("zlib.compress.level",
      CompressionLevel.DEFAULT_COMPRESSION);
}