congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NamenodeProtocol.versionRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
versionRequest
method
in
org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol

Best Java code snippets using org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol.versionRequest (Showing top 14 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

private static NamespaceInfo handshake(NamenodeProtocol namenode)
throws IOException, SocketTimeoutException {
 NamespaceInfo nsInfo;
 nsInfo = namenode.versionRequest();  // throws SocketTimeoutException 
 String errorMsg = null;
 // verify build version
 if( ! nsInfo.getBuildVersion().equals( Storage.getBuildVersion())) {
  errorMsg = "Incompatible build versions: active name-node BV = " 
   + nsInfo.getBuildVersion() + "; backup node BV = "
   + Storage.getBuildVersion();
  LOG.error(errorMsg);
  throw new IOException(errorMsg);
 }
 assert HdfsServerConstants.NAMENODE_LAYOUT_VERSION == nsInfo.getLayoutVersion() :
  "Active and backup node layout versions must be the same. Expected: "
  + HdfsServerConstants.NAMENODE_LAYOUT_VERSION + " actual "+ nsInfo.getLayoutVersion();
 return nsInfo;
}
origin: org.apache.hadoop/hadoop-hdfs

public NameNodeConnector(String name, URI nameNodeUri, Path idPath,
             List<Path> targetPaths, Configuration conf,
             int maxNotChangedIterations)
  throws IOException {
 this.nameNodeUri = nameNodeUri;
 this.idPath = idPath;
 this.targetPaths = targetPaths == null || targetPaths.isEmpty() ? Arrays
   .asList(new Path("/")) : targetPaths;
 this.maxNotChangedIterations = maxNotChangedIterations;
 this.namenode = NameNodeProxies.createProxy(conf, nameNodeUri,
   NamenodeProtocol.class).getProxy();
 this.client = NameNodeProxies.createProxy(conf, nameNodeUri,
   ClientProtocol.class, fallbackToSimpleAuth).getProxy();
 this.fs = (DistributedFileSystem)FileSystem.get(nameNodeUri, conf);
 final NamespaceInfo namespaceinfo = namenode.versionRequest();
 this.blockpoolID = namespaceinfo.getBlockPoolID();
 final FsServerDefaults defaults = fs.getServerDefaults(new Path("/"));
 this.keyManager = new KeyManager(blockpoolID, namenode,
   defaults.getEncryptDataTransfer(), conf);
 // if it is for test, we do not create the id file
 if (checkOtherInstanceRunning) {
  out = checkAndMarkRunning();
  if (out == null) {
   // Exit if there is another one running.
   throw new IOException("Another " + name + " is running.");
  }
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
public VersionResponseProto versionRequest(RpcController controller,
  VersionRequestProto request) throws ServiceException {
 NamespaceInfo info;
 try {
  info = impl.versionRequest();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 return VersionResponseProto.newBuilder()
   .setInfo(PBHelper.convert(info)).build();
}
origin: org.apache.hadoop/hadoop-hdfs

nsInfo = proxy.versionRequest();
isUpgradeFinalized = proxy.isUpgradeFinalized();
break;
origin: ch.cern.hadoop/hadoop-hdfs

private void getBlockPoolId(DistributedFileSystem unused)
 throws IOException {
 final NamespaceInfo nsInfo = nameNodeProto.versionRequest();
 bpid = nsInfo.getBlockPoolID();
}
origin: ch.cern.hadoop/hadoop-hdfs

private static NamespaceInfo handshake(NamenodeProtocol namenode)
throws IOException, SocketTimeoutException {
 NamespaceInfo nsInfo;
 nsInfo = namenode.versionRequest();  // throws SocketTimeoutException 
 String errorMsg = null;
 // verify build version
 if( ! nsInfo.getBuildVersion().equals( Storage.getBuildVersion())) {
  errorMsg = "Incompatible build versions: active name-node BV = " 
   + nsInfo.getBuildVersion() + "; backup node BV = "
   + Storage.getBuildVersion();
  LOG.error(errorMsg);
  throw new IOException(errorMsg);
 }
 assert HdfsConstants.NAMENODE_LAYOUT_VERSION == nsInfo.getLayoutVersion() :
  "Active and backup node layout versions must be the same. Expected: "
  + HdfsConstants.NAMENODE_LAYOUT_VERSION + " actual "+ nsInfo.getLayoutVersion();
 return nsInfo;
}
origin: ch.cern.hadoop/hadoop-hdfs

public NameNodeConnector(String name, URI nameNodeUri, Path idPath,
             List<Path> targetPaths, Configuration conf,
             int maxNotChangedIterations)
  throws IOException {
 this.nameNodeUri = nameNodeUri;
 this.idPath = idPath;
 this.targetPaths = targetPaths == null || targetPaths.isEmpty() ? Arrays
   .asList(new Path("/")) : targetPaths;
 this.maxNotChangedIterations = maxNotChangedIterations;
 this.namenode = NameNodeProxies.createProxy(conf, nameNodeUri,
   NamenodeProtocol.class).getProxy();
 this.client = NameNodeProxies.createProxy(conf, nameNodeUri,
   ClientProtocol.class, fallbackToSimpleAuth).getProxy();
 this.fs = (DistributedFileSystem)FileSystem.get(nameNodeUri, conf);
 final NamespaceInfo namespaceinfo = namenode.versionRequest();
 this.blockpoolID = namespaceinfo.getBlockPoolID();
 final FsServerDefaults defaults = fs.getServerDefaults(new Path("/"));
 this.keyManager = new KeyManager(blockpoolID, namenode,
   defaults.getEncryptDataTransfer(), conf);
 // if it is for test, we do not create the id file
 out = checkAndMarkRunning();
 if (out == null) {
  // Exit if there is another one running.
  throw new IOException("Another " + name + " is running.");
 }
}
origin: io.prestosql.hadoop/hadoop-apache

public NameNodeConnector(String name, URI nameNodeUri, Path idPath,
             List<Path> targetPaths, Configuration conf,
             int maxNotChangedIterations)
  throws IOException {
 this.nameNodeUri = nameNodeUri;
 this.idPath = idPath;
 this.targetPaths = targetPaths == null || targetPaths.isEmpty() ? Arrays
   .asList(new Path("/")) : targetPaths;
 this.maxNotChangedIterations = maxNotChangedIterations;
 this.namenode = NameNodeProxies.createProxy(conf, nameNodeUri,
   NamenodeProtocol.class).getProxy();
 this.client = NameNodeProxies.createProxy(conf, nameNodeUri,
   ClientProtocol.class, fallbackToSimpleAuth).getProxy();
 this.fs = (DistributedFileSystem)FileSystem.get(nameNodeUri, conf);
 final NamespaceInfo namespaceinfo = namenode.versionRequest();
 this.blockpoolID = namespaceinfo.getBlockPoolID();
 final FsServerDefaults defaults = fs.getServerDefaults(new Path("/"));
 this.keyManager = new KeyManager(blockpoolID, namenode,
   defaults.getEncryptDataTransfer(), conf);
 // if it is for test, we do not create the id file
 out = checkAndMarkRunning();
 if (out == null) {
  // Exit if there is another one running.
  throw new IOException("Another " + name + " is running.");
 }
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
public VersionResponseProto versionRequest(RpcController controller,
  VersionRequestProto request) throws ServiceException {
 NamespaceInfo info;
 try {
  info = impl.versionRequest();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 return VersionResponseProto.newBuilder()
   .setInfo(PBHelper.convert(info)).build();
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
public VersionResponseProto versionRequest(RpcController controller,
  VersionRequestProto request) throws ServiceException {
 NamespaceInfo info;
 try {
  info = impl.versionRequest();
 } catch (IOException e) {
  throw new ServiceException(e);
 }
 return VersionResponseProto.newBuilder()
   .setInfo(PBHelper.convert(info)).build();
}
origin: io.prestosql.hadoop/hadoop-apache

private static NamespaceInfo handshake(NamenodeProtocol namenode)
throws IOException, SocketTimeoutException {
 NamespaceInfo nsInfo;
 nsInfo = namenode.versionRequest();  // throws SocketTimeoutException 
 String errorMsg = null;
 // verify build version
 if( ! nsInfo.getBuildVersion().equals( Storage.getBuildVersion())) {
  errorMsg = "Incompatible build versions: active name-node BV = " 
   + nsInfo.getBuildVersion() + "; backup node BV = "
   + Storage.getBuildVersion();
  LOG.error(errorMsg);
  throw new IOException(errorMsg);
 }
 assert HdfsConstants.NAMENODE_LAYOUT_VERSION == nsInfo.getLayoutVersion() :
  "Active and backup node layout versions must be the same. Expected: "
  + HdfsConstants.NAMENODE_LAYOUT_VERSION + " actual "+ nsInfo.getLayoutVersion();
 return nsInfo;
}
origin: ch.cern.hadoop/hadoop-hdfs

boolean isUpgradeFinalized;
try {
 nsInfo = proxy.versionRequest();
 isUpgradeFinalized = proxy.isUpgradeFinalized();
} catch (IOException ioe) {
origin: io.prestosql.hadoop/hadoop-apache

boolean isUpgradeFinalized;
try {
 nsInfo = proxy.versionRequest();
 isUpgradeFinalized = proxy.isUpgradeFinalized();
} catch (IOException ioe) {
origin: ch.cern.hadoop/hadoop-hdfs

void register() throws IOException {
 // get versions from the namenode
 nsInfo = nameNodeProto.versionRequest();
 dnRegistration = new DatanodeRegistration(
   new DatanodeID(DNS.getDefaultIP("default"),
     DNS.getDefaultHost("default", "default"),
     DataNode.generateUuid(), getNodePort(dnIdx),
     DFSConfigKeys.DFS_DATANODE_HTTP_DEFAULT_PORT,
     DFSConfigKeys.DFS_DATANODE_HTTPS_DEFAULT_PORT,
     DFSConfigKeys.DFS_DATANODE_IPC_DEFAULT_PORT),
   new DataStorage(nsInfo),
   new ExportedBlockKeys(), VersionInfo.getVersion());
 // register datanode
 dnRegistration = dataNodeProto.registerDatanode(dnRegistration);
 dnRegistration.setNamespaceInfo(nsInfo);
 //first block reports
 storage = new DatanodeStorage(DatanodeStorage.generateUuid());
 final StorageBlockReport[] reports = {
   new StorageBlockReport(storage, BlockListAsLongs.EMPTY)
 };
 dataNodeProto.blockReport(dnRegistration, bpid, reports,
     new BlockReportContext(1, 0, System.nanoTime()));
}
org.apache.hadoop.hdfs.server.protocolNamenodeProtocolversionRequest

Javadoc

Request name-node version and storage information.

Popular methods of NamenodeProtocol

  • getBlocks
    Get a list of blocks belonging to datanode whose total size equals size.
  • rollEditLog
    Closes the current edit log and opens a new one. The call fails if the file system is in SafeMode.
  • getBlockKeys
    Get the current block keys
  • getEditLogManifest
    Return a structure containing details about all edit logs available to be fetched from the NameNode.
  • endCheckpoint
    A request to the active name-node to finalize previously started checkpoint.
  • errorReport
    Report to the active name-node an error occurred on a subordinate node. Depending on the error code
  • getMostRecentCheckpointTxId
    Get the transaction ID of the most recent checkpoint.
  • getTransactionID
  • isUpgradeFinalized
  • registerSubordinateNamenode
    Register a subordinate name-node like backup node.
  • startCheckpoint
    A request to the active name-node to start a checkpoint. The name-node should decide whether to admi
  • getEditLogSize
    Get the size of the current edit log (in bytes).
  • startCheckpoint,
  • getEditLogSize,
  • rollFsImage,
  • getNextSPSPath,
  • isRollingUpgrade

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • From CI to AI: The AI layer in your organization
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