Examples of NamespaceInfo


Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

  }

  // TODO: move to a common with DataNode util class
  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.fatal(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;
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

  }
 
  NamespaceInfo getNamespaceInfo() {
    readLock();
    try {
      return new NamespaceInfo(dir.fsImage.getStorage().getNamespaceID(),
          getClusterId(), getBlockPoolId(),
          dir.fsImage.getStorage().getCTime(),
          upgradeManager.getUpgradeVersion());
    } finally {
      readUnlock();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

    return ret;
  }

  public static NamespaceInfo convert(NamespaceInfoProto info) {
    StorageInfoProto storage = info.getStorageInfo();
    return new NamespaceInfo(storage.getNamespceID(), storage.getClusterID(),
        info.getBlockPoolID(), storage.getCTime(), info.getBuildVersion(),
        info.getSoftwareVersion());
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

    this.client =
      NameNodeProxies.createProxy(conf, nameNodeUri, ClientProtocol.class)
        .getProxy();
    this.fs = FileSystem.get(nameNodeUri, conf);

    final NamespaceInfo namespaceinfo = namenode.versionRequest();
    this.blockpoolID = namespaceinfo.getBlockPoolID();

    final ExportedBlockKeys keys = namenode.getBlockKeys();
    this.isBlockTokenEnabled = keys.isBlockTokenEnabled();
    if (isBlockTokenEnabled) {
      long blockKeyUpdateInterval = keys.getKeyUpdateInterval();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

    }
  }
 
  public static NamespaceInfo newNamespaceInfo()
      throws UnknownHostException {
    return new NamespaceInfo(newNamespaceID(), newClusterID(),
        newBlockPoolID(), 0L);
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

    inspectStorageDirs(inspector);
    return inspector;
  }

  public NamespaceInfo getNamespaceInfo() {
    return new NamespaceInfo(
        getNamespaceID(),
        getClusterID(),
        getBlockPoolID(),
        getCTime());
  }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

        VersionProto vp = builder.build();

        // There's only one version at the moment
        assert vp.getLayoutVersion() == BKJM_LAYOUT_VERSION;

        NamespaceInfo readns = PBHelper.convert(vp.getNamespaceInfo());

        if (nsInfo.getNamespaceID() != readns.getNamespaceID() ||
            !nsInfo.clusterID.equals(readns.getClusterID()) ||
            !nsInfo.getBlockPoolID().equals(readns.getBlockPoolID())) {
          String err = String.format("Environment mismatch. Running process %s"
                                     +", stored in ZK %s", nsInfo, readns);
          LOG.error(err);
          throw new IOException(err);
        }
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

      boolean closeOnFinish, AbortSpec... abortAtRolls) throws IOException {
    List<AbortSpec> aborts = new ArrayList<AbortSpec>(Arrays.asList(abortAtRolls));
    NNStorage storage = new NNStorage(new Configuration(),
                                      Collections.<URI>emptyList(),
                                      editUris);
    storage.format(new NamespaceInfo());
    FSEditLog editlog = getFSEditLog(storage);   
    // open the edit log and add two transactions
    // logGenerationStamp is used, simply because it doesn't
    // require complex arguments.
    editlog.initJournalsForWrite();
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.protocol.NamespaceInfo

  public static FSNamesystem getFSNamesystem() {
    return fsNamesystemObject;
  }

  synchronized NamespaceInfo getNamespaceInfo() {
    return new NamespaceInfo(dir.fsImage.getNamespaceID(),
                             dir.fsImage.getCTime(),
                             getDistributedUpgradeVersion());
  }
View Full Code Here

Examples of org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceInfo

  public String computeErrorMessage(List namespaceInfoList, URIResolver idResolver) {
    String result = null;
    Hashtable prefixTable = new Hashtable();
    Hashtable uriTable = new Hashtable();
    for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
      NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
      nsInfo.normalize();

      String urikey = nsInfo.uri != null ? nsInfo.uri : ""; //$NON-NLS-1$
      NamespaceInfo nsInfo2 = null;
      if ((nsInfo2 = (NamespaceInfo) uriTable.get(urikey)) != null) {
        if ((nsInfo.uri != null) && nsInfo.uri.equals(nsInfo2.uri)) {
          result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME + "'" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
        }
        else {
          result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME;
        }
        break;
      }
      else {
        uriTable.put(urikey, nsInfo);
      }

      if (nsInfo.uri != null) {
        String key = nsInfo.prefix != null ? nsInfo.prefix : ""; //$NON-NLS-1$
        if (prefixTable.get(key) != null) {
          if (nsInfo.prefix != null) {
            result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX + "'" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$
            break;
          }
          else {
            result = XMLUIMessages._UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX;
            break;
          }
        }
        else {
          prefixTable.put(key, nsInfo);
        }

        if ((nsInfo.locationHint != null) && (idResolver != null)) {
          String grammarURI = idResolver.resolve(null, nsInfo.locationHint, nsInfo.locationHint);
          if (!URIHelper.isReadableURI(grammarURI, false)) {
            result = XMLUIMessages._UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED + " '" + nsInfo.locationHint + "'"; //$NON-NLS-1$ //$NON-NLS-2$
            break;
          }
        }
        if ((idResolver != null) && (nsInfo.locationHint == null) && !nsInfo.uri.equals(DOMNamespaceInfoManager.XSI_URI)) {
          result = XMLUIMessages._UI_WARNING_LOCATION_HINT_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
          break;
        }
      }
      else {
        if (nsInfo.prefix != null) {
          result = XMLUIMessages._UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED + " '" + nsInfo.prefix + "'"; //$NON-NLS-1$ //$NON-NLS-2$
          break;
        }
      }
    }
    // additional tests
    if (result == null) {
      for (Iterator iterator = namespaceInfoList.iterator(); iterator.hasNext();) {
        NamespaceInfo nsInfo = (NamespaceInfo) iterator.next();
        nsInfo.normalize();
        if ((nsInfo.uri != null) && nsInfo.isPrefixRequired && (nsInfo.prefix == null)) {
          result = XMLUIMessages._UI_WARNING_PREFIX_NOT_SPECIFIED + " '" + nsInfo.uri + "'"; //$NON-NLS-1$ //$NON-NLS-2$
          break;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.