Java Code Examples for org.apache.hadoop.hdfs.DFSConfigKeys#DFS_NAMENODE_EDITS_PLUGIN_PREFIX
The following examples show how to use
org.apache.hadoop.hdfs.DFSConfigKeys#DFS_NAMENODE_EDITS_PLUGIN_PREFIX .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FSEditLog.java From hadoop with Apache License 2.0 | 6 votes |
/** * Retrieve the implementation class for a Journal scheme. * @param conf The configuration to retrieve the information from * @param uriScheme The uri scheme to look up. * @return the class of the journal implementation * @throws IllegalArgumentException if no class is configured for uri */ static Class<? extends JournalManager> getJournalClass(Configuration conf, String uriScheme) { String key = DFSConfigKeys.DFS_NAMENODE_EDITS_PLUGIN_PREFIX + "." + uriScheme; Class <? extends JournalManager> clazz = null; try { clazz = conf.getClass(key, null, JournalManager.class); } catch (RuntimeException re) { throw new IllegalArgumentException( "Invalid class specified for " + uriScheme, re); } if (clazz == null) { LOG.warn("No class configured for " +uriScheme + ", " + key + " is empty"); throw new IllegalArgumentException( "No class configured for " + uriScheme); } return clazz; }
Example 2
Source File: FSEditLog.java From big-c with Apache License 2.0 | 6 votes |
/** * Retrieve the implementation class for a Journal scheme. * @param conf The configuration to retrieve the information from * @param uriScheme The uri scheme to look up. * @return the class of the journal implementation * @throws IllegalArgumentException if no class is configured for uri */ static Class<? extends JournalManager> getJournalClass(Configuration conf, String uriScheme) { String key = DFSConfigKeys.DFS_NAMENODE_EDITS_PLUGIN_PREFIX + "." + uriScheme; Class <? extends JournalManager> clazz = null; try { clazz = conf.getClass(key, null, JournalManager.class); } catch (RuntimeException re) { throw new IllegalArgumentException( "Invalid class specified for " + uriScheme, re); } if (clazz == null) { LOG.warn("No class configured for " +uriScheme + ", " + key + " is empty"); throw new IllegalArgumentException( "No class configured for " + uriScheme); } return clazz; }