Tabnine Logo
IncorrectVersionException
Code IndexAdd Tabnine to your IDE (free)

How to use
IncorrectVersionException
in
org.apache.hadoop.hdfs.server.common

Best Java code snippets using org.apache.hadoop.hdfs.server.common.IncorrectVersionException (Showing top 20 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/**
 * Verify version.
 * @param version layout version
 * @throws IOException on layout version mismatch
 */
void verifyLayoutVersion(int version) throws IOException {
 if (version != HdfsServerConstants.NAMENODE_LAYOUT_VERSION)
  throw new IncorrectVersionException(
    HdfsServerConstants.NAMENODE_LAYOUT_VERSION, version, "data node");
}

origin: org.apache.hadoop/hadoop-hdfs

private void verifySoftwareVersion(DatanodeRegistration dnReg)
  throws IncorrectVersionException {
 String dnVersion = dnReg.getSoftwareVersion();
 if (VersionUtil.compareVersions(dnVersion, minimumDataNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumDataNodeVersion, dnVersion, "DataNode", "NameNode");
  LOG.warn(ive.getMessage() + " DN: " + dnReg);
  throw ive;
 }
 String nnVersion = VersionInfo.getVersion();
 if (!dnVersion.equals(nnVersion)) {
  String messagePrefix = "Reported DataNode version '" + dnVersion +
    "' of DN " + dnReg + " does not match NameNode version '" +
    nnVersion + "'";
  long nnCTime = nn.getFSImage().getStorage().getCTime();
  long dnCTime = dnReg.getStorageInfo().getCTime();
  if (nnCTime != dnCTime) {
   IncorrectVersionException ive = new IncorrectVersionException(
     messagePrefix + " and CTime of DN ('" + dnCTime +
     "') does not match CTime of NN ('" + nnCTime + "')");
   LOG.warn(ive.toString(), ive);
   throw ive;
  } else {
   LOG.info(messagePrefix +
     ". Note: This is normal during a rolling upgrade.");
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

private void checkNNVersion(NamespaceInfo nsInfo)
  throws IncorrectVersionException {
 // build and layout versions should match
 String nnVersion = nsInfo.getSoftwareVersion();
 String minimumNameNodeVersion = dnConf.getMinimumNameNodeVersion();
 if (VersionUtil.compareVersions(nnVersion, minimumNameNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumNameNodeVersion, nnVersion, "NameNode", "DataNode");
  LOG.warn(ive.getMessage());
  throw ive;
 }
 String dnVersion = VersionInfo.getVersion();
 if (!nnVersion.equals(dnVersion)) {
  LOG.info("Reported NameNode version '" + nnVersion + "' does not match " +
    "DataNode version '" + dnVersion + "' but is within acceptable " +
    "limits. Note: This is normal during a rolling upgrade.");
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

private void checkNNVersion(NamespaceInfo nsInfo)
  throws IncorrectVersionException {
 // build and layout versions should match
 String nnVersion = nsInfo.getSoftwareVersion();
 String minimumNameNodeVersion = dnConf.getMinimumNameNodeVersion();
 if (VersionUtil.compareVersions(nnVersion, minimumNameNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumNameNodeVersion, nnVersion, "NameNode", "DataNode");
  LOG.warn(ive.getMessage());
  throw ive;
 }
 String dnVersion = VersionInfo.getVersion();
 if (!nnVersion.equals(dnVersion)) {
  LOG.info("Reported NameNode version '" + nnVersion + "' does not match " +
    "DataNode version '" + dnVersion + "' but is within acceptable " +
    "limits. Note: This is normal during a rolling upgrade.");
 }
}
origin: org.apache.hadoop/hadoop-hdfs

/** Validate and set layout version from {@link Properties}*/
protected void setLayoutVersion(Properties props, StorageDirectory sd)
  throws IncorrectVersionException, InconsistentFSStateException {
 int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
 if (lv < getServiceLayoutVersion()) { // future version
  throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
    "storage directory " + sd.root.getAbsolutePath());
 }
 layoutVersion = lv;
}

origin: ch.cern.hadoop/hadoop-hdfs

private void verifySoftwareVersion(DatanodeRegistration dnReg)
  throws IncorrectVersionException {
 String dnVersion = dnReg.getSoftwareVersion();
 if (VersionUtil.compareVersions(dnVersion, minimumDataNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumDataNodeVersion, dnVersion, "DataNode", "NameNode");
  LOG.warn(ive.getMessage() + " DN: " + dnReg);
  throw ive;
 }
 String nnVersion = VersionInfo.getVersion();
 if (!dnVersion.equals(nnVersion)) {
  String messagePrefix = "Reported DataNode version '" + dnVersion +
    "' of DN " + dnReg + " does not match NameNode version '" +
    nnVersion + "'";
  long nnCTime = nn.getFSImage().getStorage().getCTime();
  long dnCTime = dnReg.getStorageInfo().getCTime();
  if (nnCTime != dnCTime) {
   IncorrectVersionException ive = new IncorrectVersionException(
     messagePrefix + " and CTime of DN ('" + dnCTime +
     "') does not match CTime of NN ('" + nnCTime + "')");
   LOG.warn(ive.toString(), ive);
   throw ive;
  } else {
   LOG.info(messagePrefix +
     ". Note: This is normal during a rolling upgrade.");
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

private void checkNNVersion(NamespaceInfo nsInfo)
  throws IncorrectVersionException {
 // build and layout versions should match
 String nnVersion = nsInfo.getSoftwareVersion();
 String minimumNameNodeVersion = dnConf.getMinimumNameNodeVersion();
 if (VersionUtil.compareVersions(nnVersion, minimumNameNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumNameNodeVersion, nnVersion, "NameNode", "DataNode");
  LOG.warn(ive.getMessage());
  throw ive;
 }
 String dnVersion = VersionInfo.getVersion();
 if (!nnVersion.equals(dnVersion)) {
  LOG.info("Reported NameNode version '" + nnVersion + "' does not match " +
    "DataNode version '" + dnVersion + "' but is within acceptable " +
    "limits. Note: This is normal during a rolling upgrade.");
 }
}
origin: org.apache.hadoop/hadoop-hdfs

void readProperties(StorageDirectory sd, StartupOption startupOption)
  throws IOException {
 Properties props = readPropertiesFile(sd.getVersionFile());
 if (props == null) {
  throw new IOException(
    "Properties not found  for storage directory " + sd);
 }
 if (HdfsServerConstants.RollingUpgradeStartupOption.ROLLBACK
   .matches(startupOption)) {
  int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
  if (lv > getServiceLayoutVersion()) {
   // we should not use a newer version for rollingUpgrade rollback
   throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
     "storage directory " + sd.getRoot().getAbsolutePath());
  }
  props.setProperty("layoutVersion",
    Integer.toString(HdfsServerConstants.NAMENODE_LAYOUT_VERSION));
 }
 setFieldsFromProperties(props, sd);
}
origin: io.prestosql.hadoop/hadoop-apache

private void verifySoftwareVersion(DatanodeRegistration dnReg)
  throws IncorrectVersionException {
 String dnVersion = dnReg.getSoftwareVersion();
 if (VersionUtil.compareVersions(dnVersion, minimumDataNodeVersion) < 0) {
  IncorrectVersionException ive = new IncorrectVersionException(
    minimumDataNodeVersion, dnVersion, "DataNode", "NameNode");
  LOG.warn(ive.getMessage() + " DN: " + dnReg);
  throw ive;
 }
 String nnVersion = VersionInfo.getVersion();
 if (!dnVersion.equals(nnVersion)) {
  String messagePrefix = "Reported DataNode version '" + dnVersion +
    "' of DN " + dnReg + " does not match NameNode version '" +
    nnVersion + "'";
  long nnCTime = nn.getFSImage().getStorage().getCTime();
  long dnCTime = dnReg.getStorageInfo().getCTime();
  if (nnCTime != dnCTime) {
   IncorrectVersionException ive = new IncorrectVersionException(
     messagePrefix + " and CTime of DN ('" + dnCTime +
     "') does not match CTime of NN ('" + nnCTime + "')");
   LOG.warn(ive.toString(), ive);
   throw ive;
  } else {
   LOG.info(messagePrefix +
     ". Note: This is normal during a rolling upgrade.");
  }
 }
}
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Verify version.
 * @param version layout version
 * @throws IOException on layout version mismatch
 */
void verifyLayoutVersion(int version) throws IOException {
 if (version != HdfsConstants.NAMENODE_LAYOUT_VERSION)
  throw new IncorrectVersionException(
    HdfsConstants.NAMENODE_LAYOUT_VERSION, version, "data node");
}

origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Verify version.
 * @param version layout version
 * @throws IOException on layout version mismatch
 */
void verifyLayoutVersion(int version) throws IOException {
 if (version != HdfsConstants.NAMENODE_LAYOUT_VERSION)
  throw new IncorrectVersionException(
    HdfsConstants.NAMENODE_LAYOUT_VERSION, version, "data node");
}

origin: org.jvnet.hudson.hadoop/hadoop-core

/**
 * Verify version.
 * 
 * @param version
 * @throws IOException
 */
public void verifyVersion(int version) throws IOException {
 if (version != LAYOUT_VERSION)
  throw new IncorrectVersionException(version, "data node");
}
origin: com.facebook.hadoop/hadoop-core

/**
 * Verify version.
 * 
 * @param reportedVersion version reported by datanode
 * @param expectedVersion version expected by namenode
 * @param annotation explanation of the given version
 * @throws IncorrectVersionException
 */
public void verifyVersion(int reportedVersion,
  int expectedVersion, String annotation) throws IOException {
 if (reportedVersion != expectedVersion)
  throw new IncorrectVersionException(
    reportedVersion, "data node " + annotation, expectedVersion);
}
origin: com.facebook.hadoop/hadoop-core

/** Validate and set layout version from {@link Properties}*/
protected void setLayoutVersion(Properties props, StorageDirectory sd)
  throws IncorrectVersionException, InconsistentFSStateException {
 int lv = Integer.parseInt(getProperty(props, sd, LAYOUT_VERSION));
 if (lv < FSConstants.LAYOUT_VERSION) { // future version
  throw new IncorrectVersionException(lv, "storage directory "
    + sd.root.getAbsolutePath());
 }
 layoutVersion = lv;
}

origin: io.prestosql.hadoop/hadoop-apache

/** Validate and set layout version from {@link Properties}*/
protected void setLayoutVersion(Properties props, StorageDirectory sd)
  throws IncorrectVersionException, InconsistentFSStateException {
 int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
 if (lv < getServiceLayoutVersion()) { // future version
  throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
    "storage directory " + sd.root.getAbsolutePath());
 }
 layoutVersion = lv;
}

origin: ch.cern.hadoop/hadoop-hdfs

/** Validate and set layout version from {@link Properties}*/
protected void setLayoutVersion(Properties props, StorageDirectory sd)
  throws IncorrectVersionException, InconsistentFSStateException {
 int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
 if (lv < getServiceLayoutVersion()) { // future version
  throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
    "storage directory " + sd.root.getAbsolutePath());
 }
 layoutVersion = lv;
}

origin: org.jvnet.hudson.hadoop/hadoop-core

                     "is incompatible with others.");
if (rv < FSConstants.LAYOUT_VERSION) // future version
 throw new IncorrectVersionException(rv, "storage directory " 
                   + sd.root.getCanonicalPath());
layoutVersion = rv;
origin: com.facebook.hadoop/hadoop-core

                     " but rt is " + rt);
if (rv < FSConstants.LAYOUT_VERSION) // future version
 throw new IncorrectVersionException(rv, "storage directory " 
                   + sd.root.getCanonicalPath());
layoutVersion = rv;
origin: io.prestosql.hadoop/hadoop-apache

void readProperties(StorageDirectory sd, StartupOption startupOption)
  throws IOException {
 Properties props = readPropertiesFile(sd.getVersionFile());
 if (HdfsServerConstants.RollingUpgradeStartupOption.ROLLBACK.matches
   (startupOption)) {
  int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
  if (lv > getServiceLayoutVersion()) {
   // we should not use a newer version for rollingUpgrade rollback
   throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
     "storage directory " + sd.getRoot().getAbsolutePath());
  }
  props.setProperty("layoutVersion",
    Integer.toString(HdfsConstants.NAMENODE_LAYOUT_VERSION));
 }
 setFieldsFromProperties(props, sd);
}
origin: ch.cern.hadoop/hadoop-hdfs

void readProperties(StorageDirectory sd, StartupOption startupOption)
  throws IOException {
 Properties props = readPropertiesFile(sd.getVersionFile());
 if (HdfsServerConstants.RollingUpgradeStartupOption.ROLLBACK.matches
   (startupOption)) {
  int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion"));
  if (lv > getServiceLayoutVersion()) {
   // we should not use a newer version for rollingUpgrade rollback
   throw new IncorrectVersionException(getServiceLayoutVersion(), lv,
     "storage directory " + sd.getRoot().getAbsolutePath());
  }
  props.setProperty("layoutVersion",
    Integer.toString(HdfsConstants.NAMENODE_LAYOUT_VERSION));
 }
 setFieldsFromProperties(props, sd);
}
org.apache.hadoop.hdfs.server.commonIncorrectVersionException

Javadoc

The exception is thrown when external version does not match current version of the appication.

Most used methods

  • <init>
  • getMessage
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JFrame (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
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