Tabnine Logo
DNConf.getMinimumNameNodeVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getMinimumNameNodeVersion
method
in
org.apache.hadoop.hdfs.server.datanode.DNConf

Best Java code snippets using org.apache.hadoop.hdfs.server.datanode.DNConf.getMinimumNameNodeVersion (Showing top 5 results out of 315)

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: 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: ch.cern.hadoop/hadoop-hdfs

@Before
public void setUp() throws IOException {
 mockDnConf = mock(DNConf.class);
 doReturn(VersionInfo.getVersion()).when(mockDnConf).getMinimumNameNodeVersion();
 
 DataNode mockDN = mock(DataNode.class);
 doReturn(true).when(mockDN).shouldRun();
 doReturn(mockDnConf).when(mockDN).getDnConf();
 
 BPOfferService mockBPOS = mock(BPOfferService.class);
 doReturn(mockDN).when(mockBPOS).getDataNode();
 
 actor = new BPServiceActor(INVALID_ADDR, mockBPOS);
 fakeNsInfo = mock(NamespaceInfo.class);
 // Return a a good software version.
 doReturn(VersionInfo.getVersion()).when(fakeNsInfo).getSoftwareVersion();
 // Return a good layout version for now.
 doReturn(HdfsConstants.NAMENODE_LAYOUT_VERSION).when(fakeNsInfo)
   .getLayoutVersion();
 
 DatanodeProtocolClientSideTranslatorPB fakeDnProt = 
   mock(DatanodeProtocolClientSideTranslatorPB.class);
 when(fakeDnProt.versionRequest()).thenReturn(fakeNsInfo);
 actor.setNameNode(fakeDnProt);
}
origin: ch.cern.hadoop/hadoop-hdfs

@Test
public void testSoftwareVersionDifferences() throws Exception {
 // We expect no exception to be thrown when the software versions match.
 assertEquals(VersionInfo.getVersion(),
   actor.retrieveNamespaceInfo().getSoftwareVersion());
 
 // We expect no exception to be thrown when the min NN version is below the
 // reported NN version.
 doReturn("4.0.0").when(fakeNsInfo).getSoftwareVersion();
 doReturn("3.0.0").when(mockDnConf).getMinimumNameNodeVersion();
 assertEquals("4.0.0", actor.retrieveNamespaceInfo().getSoftwareVersion());
 
 // When the NN reports a version that's too low, throw an exception.
 doReturn("3.0.0").when(fakeNsInfo).getSoftwareVersion();
 doReturn("4.0.0").when(mockDnConf).getMinimumNameNodeVersion();
 try {
  actor.retrieveNamespaceInfo();
  fail("Should have thrown an exception for NN with too-low version");
 } catch (IncorrectVersionException ive) {
  GenericTestUtils.assertExceptionContains(
    "The reported NameNode version is too low", ive);
  LOG.info("Got expected exception", ive);
 }
}

org.apache.hadoop.hdfs.server.datanodeDNConfgetMinimumNameNodeVersion

Popular methods of DNConf

  • <init>
  • getBpReadyTimeout
  • getConf
    Returns the configuration.
  • getEncryptDataTransfer
    Returns true if encryption enabled for DataTransferProtocol.
  • getEncryptionAlgorithm
    Returns encryption algorithm configured for DataTransferProtocol, or null if not configured.
  • getIgnoreSecurePortsForTesting
    Returns true if configuration is set to skip checking for proper port configuration in a secured clu
  • getMaxLockedMemory
  • getSaslPropsResolver
    Returns the SaslPropertiesResolver configured for use with DataTransferProtocol, or null if not conf
  • getTrustedChannelResolver
    Returns the TrustedChannelResolver configured for use with DataTransferProtocol, or null if not conf
  • getXceiverStopTimeout
  • getTransferSocketRecvBufferSize
  • getTransferSocketSendBufferSize
  • getTransferSocketRecvBufferSize,
  • getTransferSocketSendBufferSize,
  • getAllowNonLocalLazyPersist,
  • getConnectToDnViaHostname,
  • getDataTransferServerTcpNoDelay,
  • getLifelineIntervalMs,
  • getMaxDataLength,
  • getSlowIoWarningThresholdMs,
  • getSocketTimeout

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best IntelliJ 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