Tabnine Logo
HdfsServerConstants$StartupOption.setClusterId
Code IndexAdd Tabnine to your IDE (free)

How to use
setClusterId
method
in
org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption

Best Java code snippets using org.apache.hadoop.hdfs.server.common.HdfsServerConstants$StartupOption.setClusterId (Showing top 16 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

 return null;
startOpt.setClusterId(clusterId);
if (i + 2 < argsLen) {
 i += 2;
 startOpt.setClusterId(args[i]);
} else {
 LOG.error("Must specify a valid cluster ID after the "
origin: org.apache.hadoop/hadoop-hdfs

 LayoutVersion.Feature.FEDERATION, layoutVersion)) {
if (startOpt.getClusterId() == null) {
 startOpt.setClusterId(newClusterID());
origin: ch.cern.hadoop/hadoop-hdfs

 return null;
startOpt.setClusterId(clusterId);
if (i + 2 < argsLen) {
 i += 2;
 startOpt.setClusterId(args[i]);
} else {
 LOG.error("Must specify a valid cluster ID after the "
origin: ch.cern.hadoop/hadoop-hdfs

 StartupOption.FORMAT.setClusterId(clusterId);
} else {
 StartupOption.FORMAT.setClusterId(nn.getClusterId());
origin: io.prestosql.hadoop/hadoop-apache

 return null;
startOpt.setClusterId(clusterId);
if (i + 2 < argsLen) {
 i += 2;
 startOpt.setClusterId(args[i]);
} else {
 LOG.error("Must specify a valid cluster ID after the "
origin: ch.cern.hadoop/hadoop-hdfs

Configuration nn2 = cluster.getConfiguration(1);
StartupOption.FORMAT.setClusterId("cluster-2");
DFSTestUtil.formatNameNode(nn1);
MiniDFSCluster.copyNameDirs(FSNamesystem.getNamespaceDirs(nn1),
origin: ch.cern.hadoop/hadoop-hdfs

operation.setClusterId(clusterId);
origin: ch.cern.hadoop/hadoop-hdfs

StartupOption.FORMAT.setClusterId("DifferentCID");
cluster.addNameNode(conf, 9948);
NameNode nn4 = cluster.getNameNode(3);
origin: ch.cern.hadoop/hadoop-hdfs

 LayoutVersion.Feature.FEDERATION, layoutVersion)) {
if (startOpt.getClusterId() == null) {
 startOpt.setClusterId(newClusterID());
origin: io.prestosql.hadoop/hadoop-apache

 LayoutVersion.Feature.FEDERATION, layoutVersion)) {
if (startOpt.getClusterId() == null) {
 startOpt.setClusterId(newClusterID());
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testFormatClusterIdOption() throws IOException {
 
 // 1. should format without cluster id
 //StartupOption.FORMAT.setClusterId("");
 NameNode.format(config);
 // see if cluster id not empty.
 String cid = getClusterId(config);
 assertTrue("Didn't get new ClusterId", (cid != null && !cid.equals("")) );
 // 2. successful format with given clusterid
 StartupOption.FORMAT.setClusterId("mycluster");
 NameNode.format(config);
 // see if cluster id matches with given clusterid.
 cid = getClusterId(config);
 assertTrue("ClusterId didn't match", cid.equals("mycluster"));
 // 3. format without any clusterid again. It should generate new
 //clusterid.
 StartupOption.FORMAT.setClusterId("");
 NameNode.format(config);
 String newCid = getClusterId(config);
 assertFalse("ClusterId should not be the same", newCid.equals(cid));
}
origin: ch.cern.hadoop/hadoop-hdfs

 /**
  * Tests the upgrade from one version of Federation to another Federation
  * version Test with correct clusterid case: -upgrade -clusterid <cid>
  * Expected to reuse existing clusterid and ignore user given clusterid
  * 
  * @throws Exception
  */
 @Test
 public void testStartupOptUpgradeFromFederationWithCID()
   throws Exception {
  startOpt.setClusterId("currentcid");
  storage.setClusterID("currentcid");
  layoutVersion = Feature.FEDERATION.getInfo().getLayoutVersion();
  storage.processStartupOptionsForUpgrade(startOpt, layoutVersion);
  assertEquals("Clusterid should match with the existing one",
    "currentcid", storage.getClusterID());
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Tests the upgrade from one version of Federation to another Federation
 * version Test with wrong clusterid case: -upgrade -clusterid <cid> 
 * Expected to reuse existing clusterid and ignore user given clusterid
 * 
 * @throws Exception
 */
@Test
public void testStartupOptUpgradeFromFederationWithWrongCID()
  throws Exception {
 startOpt.setClusterId("wrong-cid");
 storage.setClusterID("currentcid");
 layoutVersion = Feature.FEDERATION.getInfo().getLayoutVersion();
 storage.processStartupOptionsForUpgrade(startOpt, layoutVersion);
 assertEquals("Clusterid should match with the existing one",
   "currentcid", storage.getClusterID());
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Tests the upgrade from version 0.22 to Federation version Test with
 * clusterid case: -upgrade -clusterid <cid> 
 * Expected to reuse user given clusterid
 * 
 * @throws Exception
 */
@Test
public void testStartupOptUpgradeFrom22WithCID() throws Exception {
 startOpt.setClusterId("cid");
 layoutVersion = Feature.RESERVED_REL22.getInfo().getLayoutVersion();
 storage.processStartupOptionsForUpgrade(startOpt, layoutVersion);
 assertEquals("Clusterid should match with the given clusterid",
   "cid", storage.getClusterID());
}
origin: ch.cern.hadoop/hadoop-hdfs

@Before
public void setUp() throws Exception {
 conf = new HdfsConfiguration();
 startOpt.setClusterId(null);
 storage = new NNStorage(conf,
  Collections.<URI>emptyList(),
  Collections.<URI>emptyList());
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * when formatting a namenode - we must provide clusterid.
 * @param conf
 * @throws IOException
 */
public static void formatNameNode(Configuration conf) throws IOException {
 String clusterId = StartupOption.FORMAT.getClusterId();
 if(clusterId == null || clusterId.isEmpty())
  StartupOption.FORMAT.setClusterId("testClusterID");
 // Use a copy of conf as it can be altered by namenode during format.
 NameNode.format(new Configuration(conf));
}
org.apache.hadoop.hdfs.server.commonHdfsServerConstants$StartupOptionsetClusterId

Popular methods of HdfsServerConstants$StartupOption

  • getClusterId
  • getEnum
  • getName
  • getRollingUpgradeStartupOption
  • setForceFormat
  • setInteractiveFormat
  • createRecoveryContext
  • getForce
  • getForceFormat
  • getInteractiveFormat
  • name
  • setForce
  • name,
  • setForce,
  • setRollingUpgradeStartupOption,
  • toNodeRole,
  • toString,
  • valueOf

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JCheckBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now