org.apache.hadoop.yarn.server.records.Version.getMinorVersion()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.hadoop.yarn.server.records.Version.getMinorVersion()方法的一些代码示例,展示了Version.getMinorVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getMinorVersion()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.records.Version
类名称:Version
方法名:getMinorVersion

Version.getMinorVersion介绍

暂无

代码示例

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-common

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + getMajorVersion();
 result = prime * result + getMinorVersion();
 return result;
}

代码示例来源:origin: io.hops/hadoop-yarn-server-common

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + getMajorVersion();
 result = prime * result + getMinorVersion();
 return result;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-common

@Override
public int hashCode() {
 final int prime = 31;
 int result = 1;
 result = prime * result + getMajorVersion();
 result = prime * result + getMinorVersion();
 return result;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-common

public String toString() {
 return getMajorVersion() + "." + getMinorVersion();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-common

public String toString() {
 return getMajorVersion() + "." + getMinorVersion();
}

代码示例来源:origin: io.hops/hadoop-yarn-server-common

public String toString() {
 return getMajorVersion() + "." + getMinorVersion();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-common

@Override
 public boolean equals(Object obj) {
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;
  Version other = (Version) obj;
  if (this.getMajorVersion() == other.getMajorVersion()
    && this.getMinorVersion() == other.getMinorVersion()) {
   return true;
  } else {
   return false;
  }
 }
}

代码示例来源:origin: io.hops/hadoop-yarn-server-common

@Override
 public boolean equals(Object obj) {
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;
  Version other = (Version) obj;
  if (this.getMajorVersion() == other.getMajorVersion()
    && this.getMinorVersion() == other.getMinorVersion()) {
   return true;
  } else {
   return false;
  }
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-common

@Override
 public boolean equals(Object obj) {
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;
  Version other = (Version) obj;
  if (this.getMajorVersion() == other.getMajorVersion()
    && this.getMinorVersion() == other.getMinorVersion()) {
   return true;
  } else {
   return false;
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-applicationhistoryservice

@Test
public void testCheckVersion() throws IOException {
 RollingLevelDBTimelineStore dbStore = (RollingLevelDBTimelineStore) store;
 // default version
 Version defaultVersion = dbStore.getCurrentVersion();
 Assert.assertEquals(defaultVersion, dbStore.loadVersion());
 // compatible version
 Version compatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion(),
    defaultVersion.getMinorVersion() + 2);
 dbStore.storeVersion(compatibleVersion);
 Assert.assertEquals(compatibleVersion, dbStore.loadVersion());
 restartTimelineStore();
 dbStore = (RollingLevelDBTimelineStore) store;
 // overwrite the compatible version
 Assert.assertEquals(defaultVersion, dbStore.loadVersion());
 // incompatible version
 Version incompatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion() + 1,
    defaultVersion.getMinorVersion());
 dbStore.storeVersion(incompatibleVersion);
 try {
  restartTimelineStore();
  Assert.fail("Incompatible version, should expect fail here.");
 } catch (ServiceStateException e) {
  Assert.assertTrue("Exception message mismatch",
    e.getMessage().contains("Incompatible version for timeline store"));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-applicationhistoryservice

@Test
public void testCheckVersion() throws IOException {
 LeveldbTimelineStore dbStore = (LeveldbTimelineStore) store;
 // default version
 Version defaultVersion = dbStore.getCurrentVersion();
 Assert.assertEquals(defaultVersion, dbStore.loadVersion());
 // compatible version
 Version compatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion(),
    defaultVersion.getMinorVersion() + 2);
 dbStore.storeVersion(compatibleVersion);
 Assert.assertEquals(compatibleVersion, dbStore.loadVersion());
 restartTimelineStore();
 dbStore = (LeveldbTimelineStore) store;
 // overwrite the compatible version
 Assert.assertEquals(defaultVersion, dbStore.loadVersion());
 // incompatible version
 Version incompatibleVersion = Version.newInstance(
   defaultVersion.getMajorVersion() + 1, defaultVersion.getMinorVersion());
 dbStore.storeVersion(incompatibleVersion);
 try {
  restartTimelineStore();
  Assert.fail("Incompatible version, should expect fail here.");
 } catch (ServiceStateException e) {
  Assert.assertTrue("Exception message mismatch",
    e.getMessage().contains("Incompatible version for timeline store"));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-applicationhistoryservice

defaultVersion.getMinorVersion() + 2);
store.storeVersion(compatibleVersion);
Assert.assertEquals(compatibleVersion, store.loadVersion());
    defaultVersion.getMinorVersion());
store.storeVersion(incompatibleVersion);
store.stop();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

public void testCheckVersion(RMStateStoreHelper stateStoreHelper)
  throws Exception {
 RMStateStore store = stateStoreHelper.getRMStateStore();
 store.setRMDispatcher(new TestDispatcher());
 // default version
 Version defaultVersion = stateStoreHelper.getCurrentVersion();
 store.checkVersion();
 Assert.assertEquals(defaultVersion, store.loadVersion());
 // compatible version
 Version compatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion(),
    defaultVersion.getMinorVersion() + 2);
 stateStoreHelper.writeVersion(compatibleVersion);
 Assert.assertEquals(compatibleVersion, store.loadVersion());
 store.checkVersion();
 // overwrite the compatible version
 Assert.assertEquals(defaultVersion, store.loadVersion());
 // incompatible version
 Version incompatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion() + 2,
    defaultVersion.getMinorVersion());
 stateStoreHelper.writeVersion(incompatibleVersion);
 try {
  store.checkVersion();
  Assert.fail("Invalid version, should fail.");
 } catch (Throwable t) {
  Assert.assertTrue(t instanceof RMStateVersionIncompatibleException);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public void testCheckVersion(RMStateStoreHelper stateStoreHelper)
  throws Exception {
 RMStateStore store = stateStoreHelper.getRMStateStore();
 store.setRMDispatcher(new TestDispatcher());
 // default version
 Version defaultVersion = stateStoreHelper.getCurrentVersion();
 store.checkVersion();
 Assert.assertEquals(defaultVersion, store.loadVersion());
 // compatible version
 Version compatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion(),
    defaultVersion.getMinorVersion() + 2);
 stateStoreHelper.writeVersion(compatibleVersion);
 Assert.assertEquals(compatibleVersion, store.loadVersion());
 store.checkVersion();
 // overwrite the compatible version
 Assert.assertEquals(defaultVersion, store.loadVersion());
 // incompatible version
 Version incompatibleVersion =
   Version.newInstance(defaultVersion.getMajorVersion() + 2,
    defaultVersion.getMinorVersion());
 stateStoreHelper.writeVersion(incompatibleVersion);
 try {
  store.checkVersion();
  Assert.fail("Invalid version, should fail.");
 } catch (Throwable t) {
  Assert.assertTrue(t instanceof RMStateVersionIncompatibleException);
 }
}

相关文章