本文整理汇总了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);
}
示例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]);
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}