Tabnine Logo
IncorrectVersionException.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.hadoop.hdfs.server.common.IncorrectVersionException.<init> (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

/** 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.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: 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: 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: 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: 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: 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);
}
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: com.facebook.hadoop/hadoop-core

 throw new IncorrectVersionException(command.getVersion(), 
   "UpgradeCommand", curUO.getVersion());
UpgradeCommand reply = curUO.processUpgradeCommand(command);
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.");
  }
 }
}
org.apache.hadoop.hdfs.server.commonIncorrectVersionException<init>

Popular methods of IncorrectVersionException

  • getMessage
  • toString

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • Kernel (java.awt.image)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collectors (java.util.stream)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
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