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


Java XDR.writeInt方法代码示例

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


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

示例1: testGetport

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
static void testGetport() {
  XDR xdr_out = new XDR();

  createPortmapXDRheader(xdr_out, 3);

  xdr_out.writeInt(100003);
  xdr_out.writeInt(3);
  xdr_out.writeInt(6);
  xdr_out.writeInt(0);

  XDR request2 = new XDR();

  createPortmapXDRheader(xdr_out, 3);
  request2.writeInt(100003);
  request2.writeInt(3);
  request2.writeInt(6);
  request2.writeInt(0);

  testRequest(xdr_out, request2);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestUdpServer.java

示例2: write

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public void write(XDR xdr) {
  // mStamp + mHostName.length + mHostName + mUID + mGID + mAuxGIDs.count
  mCredentialsLength = 20 + mHostName.getBytes(Charsets.UTF_8).length;
  // mAuxGIDs
  if (mAuxGIDs != null && mAuxGIDs.length > 0) {
    mCredentialsLength += mAuxGIDs.length * 4;
  }
  xdr.writeInt(mCredentialsLength);
  
  xdr.writeInt(mStamp);
  xdr.writeString(mHostName);
  xdr.writeInt(mUID);
  xdr.writeInt(mGID);
  
  if((mAuxGIDs == null) || (mAuxGIDs.length == 0)) {
    xdr.writeInt(0);
  } else {
    xdr.writeInt(mAuxGIDs.length);
    for (int i = 0; i < mAuxGIDs.length; i++) {
      xdr.writeInt(mAuxGIDs[i]);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:CredentialsSys.java

示例3: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
public void serialize(XDR xdr) {
  xdr.writeInt(type);
  xdr.writeInt(mode);
  xdr.writeInt(nlink);
  xdr.writeInt(uid);
  xdr.writeInt(gid);
  xdr.writeLongAsHyper(size);
  xdr.writeLongAsHyper(used);
  xdr.writeInt(rdev.getSpecdata1());
  xdr.writeInt(rdev.getSpecdata2());
  xdr.writeLongAsHyper(fsid);
  xdr.writeLongAsHyper(fileId);
  atime.serialize(xdr);
  mtime.serialize(xdr);
  ctime.serialize(xdr);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:Nfs3FileAttributes.java

示例4: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public XDR serialize(XDR out, int xid, Verifier verifier) {
  super.serialize(out, xid, verifier);
  out.writeBoolean(true);
  postOpAttr.serialize(out);

  if (getStatus() == Nfs3Status.NFS3_OK) {
    out.writeInt(rtmax);
    out.writeInt(rtpref);
    out.writeInt(rtmult);
    out.writeInt(wtmax);
    out.writeInt(wtpref);
    out.writeInt(wtmult);
    out.writeInt(dtpref);
    out.writeLongAsHyper(maxFileSize);
    timeDelta.serialize(out);
    out.writeInt(properties);
 }
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:FSINFO3Response.java

示例5: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public XDR serialize(XDR out, int xid, Verifier verifier) {
  super.serialize(out, xid, verifier);
  out.writeBoolean(true);
  postOpAttr.serialize(out);

  if (getStatus() == Nfs3Status.NFS3_OK) {
    out.writeInt(linkMax);
    out.writeInt(nameMax);
    out.writeBoolean(noTrunc);
    out.writeBoolean(chownRestricted);
    out.writeBoolean(caseInsensitive);
    out.writeBoolean(casePreserving);
  }
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:PATHCONF3Response.java

示例6: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public XDR serialize(XDR out, int xid, Verifier verifier) {
  super.serialize(out, xid, verifier);
  if (this.getStatus() == Nfs3Status.NFS3_OK) {
    out.writeBoolean(true);
    postOpAttr.serialize(out);
    out.writeInt(access);
  } else {
    out.writeBoolean(false);
  }
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ACCESS3Response.java

示例7: writeFlavorAndCredentials

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
/**
 * Write AuthFlavor and the credentials to the XDR
 */
public static void writeFlavorAndCredentials(Credentials cred, XDR xdr) {
  if (cred instanceof CredentialsNone) {
    xdr.writeInt(AuthFlavor.AUTH_NONE.getValue());
  } else if (cred instanceof CredentialsSys) {
    xdr.writeInt(AuthFlavor.AUTH_SYS.getValue());
  } else if (cred instanceof CredentialsGSS) {
    xdr.writeInt(AuthFlavor.RPCSEC_GSS.getValue());
  } else {
    throw new UnsupportedOperationException("Cannot recognize the verifier");
  }
  cred.write(xdr);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:Credentials.java

示例8: writeFlavorAndVerifier

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
/**
 * Write AuthFlavor and the verifier to the XDR
 */
public static void writeFlavorAndVerifier(Verifier verifier, XDR xdr) {
  if (verifier instanceof VerifierNone) {
    xdr.writeInt(AuthFlavor.AUTH_NONE.getValue());
  } else if (verifier instanceof VerifierGSS) {
    xdr.writeInt(AuthFlavor.RPCSEC_GSS.getValue());
  } else {
    throw new UnsupportedOperationException("Cannot recognize the verifier");
  }
  verifier.write(xdr);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:Verifier.java

示例9: writeMNTResponse

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
/** Response for RPC call {@link MountInterface.MNTPROC#MNT} */
public static XDR writeMNTResponse(int status, XDR xdr, int xid,
    byte[] handle) {
  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  xdr.writeInt(status);
  if (status == MNT_OK) {
    xdr.writeVariableOpaque(handle);
    // Only MountV3 returns a list of supported authFlavors
    xdr.writeInt(1);
    xdr.writeInt(AuthFlavor.AUTH_SYS.getValue());
  }
  return xdr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:MountResponse.java

示例10: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public XDR serialize(XDR out, int xid, Verifier verifier) {
  super.serialize(out, xid, verifier);
  fileWcc.serialize(out);
  if (getStatus() == Nfs3Status.NFS3_OK) {
    out.writeInt(count);
    out.writeInt(stableHow.getValue());
    out.writeLongAsHyper(verifer);
  }
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:WRITE3Response.java

示例11: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
/**
 * Write the response, along with the rpc header (including verifier), to the
 * XDR.
 */
public XDR serialize(XDR out, int xid, Verifier verifier) {
  RpcAcceptedReply reply = RpcAcceptedReply.getAcceptInstance(xid, verifier);
  reply.write(out);
  out.writeInt(this.getStatus());
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:NFS3Response.java

示例12: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public void serialize(XDR xdr) {
  handle.serialize(xdr);
  xdr.writeInt(name.getBytes(Charsets.UTF_8).length);
  xdr.writeFixedOpaque(name.getBytes(Charsets.UTF_8));
  symAttr.serialize(xdr);
  xdr.writeInt(symData.getBytes(Charsets.UTF_8).length);
  xdr.writeFixedOpaque(symData.getBytes(Charsets.UTF_8));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:SYMLINK3Request.java

示例13: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public void serialize(XDR xdr) {
  handle.serialize(xdr);
  xdr.writeLongAsHyper(offset);
  xdr.writeInt(count);
  xdr.writeInt(stableHow.getValue());
  xdr.writeInt(count);
  xdr.writeFixedOpaque(data.array(), count);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:WRITE3Request.java

示例14: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
public void serialize(XDR xdr) {
  if (!updateFields.contains(SetAttrField.MODE)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    xdr.writeInt(mode);
  }
  if (!updateFields.contains(SetAttrField.UID)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    xdr.writeInt(uid);
  }
  if (!updateFields.contains(SetAttrField.GID)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    xdr.writeInt(gid);
  }
  if (!updateFields.contains(SetAttrField.SIZE)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    xdr.writeLongAsHyper(size);
  }
  if (!updateFields.contains(SetAttrField.ATIME)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    atime.serialize(xdr);
  }
  if (!updateFields.contains(SetAttrField.MTIME)) {
    xdr.writeBoolean(false);
  } else {
    xdr.writeBoolean(true);
    mtime.serialize(xdr);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:39,代码来源:SetAttr3.java

示例15: serialize

import org.apache.hadoop.oncrpc.XDR; //导入方法依赖的package包/类
@Override
public void serialize(XDR xdr) {
  handle.serialize(xdr);
  xdr.writeInt(name.length());
  xdr.writeFixedOpaque(name.getBytes(Charsets.UTF_8), name.length());
  xdr.writeInt(mode);
  objAttr.serialize(xdr);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:CREATE3Request.java


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