当前位置: 首页>>代码示例>>Java>>正文


Java Stanza.getValue方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.util.XMLUtils.Stanza.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Stanza.getValue方法的具体用法?Java Stanza.getValue怎么用?Java Stanza.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.util.XMLUtils.Stanza的用法示例。


在下文中一共展示了Stanza.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delegationTokenFromXml

import org.apache.hadoop.hdfs.util.XMLUtils.Stanza; //导入方法依赖的package包/类
public static DelegationTokenIdentifier delegationTokenFromXml(Stanza st)
    throws InvalidXmlException {
  String kind = st.getValue("KIND");
  if (!kind.equals(DelegationTokenIdentifier.
      HDFS_DELEGATION_KIND.toString())) {
    throw new InvalidXmlException("can't understand " +
      "DelegationTokenIdentifier KIND " + kind);
  }
  int seqNum = Integer.parseInt(st.getValue("SEQUENCE_NUMBER"));
  String owner = st.getValue("OWNER");
  String renewer = st.getValue("RENEWER");
  String realuser = st.getValue("REALUSER");
  long issueDate = Long.parseLong(st.getValue("ISSUE_DATE"));
  long maxDate = Long.parseLong(st.getValue("MAX_DATE"));
  int masterKeyId = Integer.parseInt(st.getValue("MASTER_KEY_ID"));
  DelegationTokenIdentifier token =
      new DelegationTokenIdentifier(new Text(owner),
          new Text(renewer), new Text(realuser));
  token.setSequenceNumber(seqNum);
  token.setIssueDate(issueDate);
  token.setMaxDate(maxDate);
  token.setMasterKeyId(masterKeyId);
  return token;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:FSEditLogOp.java

示例2: fromXml

import org.apache.hadoop.hdfs.util.XMLUtils.Stanza; //导入方法依赖的package包/类
@Override void fromXml(Stanza st) throws InvalidXmlException {
  this.length = Integer.parseInt(st.getValue("LENGTH"));
  this.src = st.getValue("SRC");
  this.dst = st.getValue("DST");
  this.timestamp = Long.parseLong(st.getValue("TIMESTAMP"));
  String opts = st.getValue("OPTIONS");
  String o[] = opts.split("\\|");
  this.options = new Rename[o.length];
  for (int i = 0; i < o.length; i++) {
    if (o[i].equals(""))
      continue;
    try {
      this.options[i] = Rename.valueOf(o[i]);
    } finally {
      if (this.options[i] == null) {
        System.err.println("error parsing Rename value: \"" + o[i] + "\"");
      }
    }
  }
  readRpcIdsFromXml(st);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:FSEditLogOp.java

示例3: readCachePoolInfo

import org.apache.hadoop.hdfs.util.XMLUtils.Stanza; //导入方法依赖的package包/类
public static CachePoolInfo readCachePoolInfo(Stanza st)
    throws InvalidXmlException {
  String poolName = st.getValue("POOLNAME");
  CachePoolInfo info = new CachePoolInfo(poolName);
  if (st.hasChildren("OWNERNAME")) {
    info.setOwnerName(st.getValue("OWNERNAME"));
  }
  if (st.hasChildren("GROUPNAME")) {
    info.setGroupName(st.getValue("GROUPNAME"));
  }
  if (st.hasChildren("MODE")) {
    info.setMode(FSEditLogOp.fsPermissionFromXml(st));
  }
  if (st.hasChildren("LIMIT")) {
    info.setLimit(Long.parseLong(st.getValue("LIMIT")));
  }
  if (st.hasChildren("MAXRELATIVEEXPIRY")) {
    info.setMaxRelativeExpiryMs(
        Long.parseLong(st.getValue("MAXRELATIVEEXPIRY")));
  }
  return info;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:FSImageSerialization.java

示例4: fromXml

import org.apache.hadoop.hdfs.util.XMLUtils.Stanza; //导入方法依赖的package包/类
@Override 
void fromXml(Stanza st) throws InvalidXmlException {
  this.length = Integer.parseInt(st.getValue("LENGTH"));
  this.inodeId = Long.parseLong(st.getValue("INODEID"));
  this.path = st.getValue("PATH");
  this.replication = Short.valueOf(st.getValue("REPLICATION"));
  this.mtime = Long.parseLong(st.getValue("MTIME"));
  this.atime = Long.parseLong(st.getValue("ATIME"));
  this.blockSize = Long.parseLong(st.getValue("BLOCKSIZE"));

  this.clientName = st.getValue("CLIENT_NAME");
  this.clientMachine = st.getValue("CLIENT_MACHINE");
  this.overwrite = Boolean.parseBoolean(st.getValueOrNull("OVERWRITE"));
  if (st.hasChildren("BLOCK")) {
    List<Stanza> blocks = st.getChildren("BLOCK");
    this.blocks = new Block[blocks.size()];
    for (int i = 0; i < blocks.size(); i++) {
      this.blocks[i] = FSEditLogOp.blockFromXml(blocks.get(i));
    }
  } else {
    this.blocks = new Block[0];
  }
  this.permissions = permissionStatusFromXml(st);
  aclEntries = readAclEntriesFromXml(st);
  readRpcIdsFromXml(st);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:FSEditLogOp.java

示例5: permissionStatusFromXml

import org.apache.hadoop.hdfs.util.XMLUtils.Stanza; //导入方法依赖的package包/类
public static PermissionStatus permissionStatusFromXml(Stanza st)
    throws InvalidXmlException {
  Stanza status = st.getChildren("PERMISSION_STATUS").get(0);
  String username = status.getValue("USERNAME");
  String groupname = status.getValue("GROUPNAME");
  FsPermission mode = fsPermissionFromXml(status);
  return new PermissionStatus(username, groupname, mode);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:FSEditLogOp.java


注:本文中的org.apache.hadoop.hdfs.util.XMLUtils.Stanza.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。