本文整理汇总了Java中org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus类的典型用法代码示例。如果您正苦于以下问题:Java SaslStatus类的具体用法?Java SaslStatus怎么用?Java SaslStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SaslStatus类属于org.apache.hadoop.hbase.security.HBaseSaslRpcServer包,在下文中一共展示了SaslStatus类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRawSaslReply
import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; //导入依赖的package包/类
/**
* No protobuf encoding of raw sasl messages
*/
private void doRawSaslReply(SaslStatus status, Writable rv,
String errorClass, String error) throws IOException {
//In my testing, have noticed that sasl messages are usually
//in the ballpark of 100-200. That's why the initialcapacity is 256.
ByteBufferOutputStream saslResponse = new ByteBufferOutputStream(256);
DataOutputStream out = new DataOutputStream(saslResponse);
out.writeInt(status.state); // write status
if (status == SaslStatus.SUCCESS) {
rv.write(out);
} else {
WritableUtils.writeString(out, errorClass);
WritableUtils.writeString(out, error);
}
saslCall.setSaslTokenResponse(saslResponse.getByteBuffer());
saslCall.responder = responder;
saslCall.sendResponseIfReady();
}
示例2: readStatus
import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; //导入依赖的package包/类
private static void readStatus(DataInputStream inStream) throws IOException {
int id = inStream.readInt(); // read and discard dummy id
int status = inStream.readInt(); // read status
if (status != SaslStatus.SUCCESS.state) {
throw new RemoteException(WritableUtils.readString(inStream),
WritableUtils.readString(inStream));
}
}
示例3: doSaslReply
import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; //导入依赖的package包/类
private void doSaslReply(SaslStatus status, Writable rv,
String errorClass, String error) throws IOException {
saslCall.setResponse(rv,
status == SaslStatus.SUCCESS ? Status.SUCCESS : Status.ERROR,
errorClass, error);
saslCall.responder = responder;
saslCall.sendResponseIfReady();
}
示例4: readStatus
import org.apache.hadoop.hbase.security.HBaseSaslRpcServer.SaslStatus; //导入依赖的package包/类
private static void readStatus(DataInputStream inStream) throws IOException {
int status = inStream.readInt(); // read status
if (status != SaslStatus.SUCCESS.state) {
throw new RemoteException(WritableUtils.readString(inStream),
WritableUtils.readString(inStream));
}
}