You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sh...@apache.org on 2014/01/02 22:02:39 UTC
[2/3] SENTRY-81: Thrift API status should be an object with status
code (Brock Noland via Shreepadma Venugopalan)
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryPrivilegeResponse.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryPrivilegeResponse.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryPrivilegeResponse.java
index 528323b..76f8049 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryPrivilegeResponse.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryPrivilegeResponse.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<TCreateSentryPrivilegeResponse, TCreateSentryPrivilegeResponse._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCreateSentryPrivilegeResponse");
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)1);
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -42,11 +42,11 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
schemes.put(TupleScheme.class, new TCreateSentryPrivilegeResponseTupleSchemeFactory());
}
- private boolean success; // required
+ private TSentryResponseStatus status; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)1, "success");
+ STATUS((short)1, "status");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -61,8 +61,8 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
- case 1: // SUCCESS
- return SUCCESS;
+ case 1: // STATUS
+ return STATUS;
default:
return null;
}
@@ -103,13 +103,11 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
}
// isset id assignments
- private static final int __SUCCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSentryResponseStatus.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCreateSentryPrivilegeResponse.class, metaDataMap);
}
@@ -118,19 +116,19 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
}
public TCreateSentryPrivilegeResponse(
- boolean success)
+ TSentryResponseStatus status)
{
this();
- this.success = success;
- setSuccessIsSet(true);
+ this.status = status;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TCreateSentryPrivilegeResponse(TCreateSentryPrivilegeResponse other) {
- __isset_bitfield = other.__isset_bitfield;
- this.success = other.success;
+ if (other.isSetStatus()) {
+ this.status = new TSentryResponseStatus(other.status);
+ }
}
public TCreateSentryPrivilegeResponse deepCopy() {
@@ -139,39 +137,39 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
@Override
public void clear() {
- setSuccessIsSet(false);
- this.success = false;
+ this.status = null;
}
- public boolean isSuccess() {
- return this.success;
+ public TSentryResponseStatus getStatus() {
+ return this.status;
}
- public void setSuccess(boolean success) {
- this.success = success;
- setSuccessIsSet(true);
+ public void setStatus(TSentryResponseStatus status) {
+ this.status = status;
}
- public void unsetSuccess() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ public void unsetStatus() {
+ this.status = null;
}
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
}
- public void setSuccessIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case SUCCESS:
+ case STATUS:
if (value == null) {
- unsetSuccess();
+ unsetStatus();
} else {
- setSuccess((Boolean)value);
+ setStatus((TSentryResponseStatus)value);
}
break;
@@ -180,8 +178,8 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
public Object getFieldValue(_Fields field) {
switch (field) {
- case SUCCESS:
- return Boolean.valueOf(isSuccess());
+ case STATUS:
+ return getStatus();
}
throw new IllegalStateException();
@@ -194,8 +192,8 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
}
switch (field) {
- case SUCCESS:
- return isSetSuccess();
+ case STATUS:
+ return isSetStatus();
}
throw new IllegalStateException();
}
@@ -213,12 +211,12 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
if (that == null)
return false;
- boolean this_present_success = true;
- boolean that_present_success = true;
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
return false;
- if (this.success != that.success)
+ if (!this.status.equals(that.status))
return false;
}
@@ -229,10 +227,10 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
- boolean present_success = true;
- builder.append(present_success);
- if (present_success)
- builder.append(success);
+ boolean present_status = true && (isSetStatus());
+ builder.append(present_status);
+ if (present_status)
+ builder.append(status);
return builder.toHashCode();
}
@@ -245,12 +243,12 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
int lastComparison = 0;
TCreateSentryPrivilegeResponse typedOther = (TCreateSentryPrivilegeResponse)other;
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
if (lastComparison != 0) {
return lastComparison;
}
@@ -275,8 +273,12 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
StringBuilder sb = new StringBuilder("TCreateSentryPrivilegeResponse(");
boolean first = true;
- sb.append("success:");
- sb.append(this.success);
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
first = false;
sb.append(")");
return sb.toString();
@@ -284,11 +286,14 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
public void validate() throws org.apache.thrift.TException {
// check for required fields
- if (!isSetSuccess()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'success' is unset! Struct:" + toString());
+ if (!isSetStatus()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
}
// check for sub-struct validity
+ if (status != null) {
+ status.validate();
+ }
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -301,8 +306,6 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -327,10 +330,11 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
break;
}
switch (schemeField.id) {
- case 1: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ case 1: // STATUS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -348,9 +352,11 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeBool(struct.success);
- oprot.writeFieldEnd();
+ if (struct.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ struct.status.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -368,14 +374,15 @@ public class TCreateSentryPrivilegeResponse implements org.apache.thrift.TBase<T
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TCreateSentryPrivilegeResponse struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeBool(struct.success);
+ struct.status.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryPrivilegeResponse struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryRoleResponse.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryRoleResponse.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryRoleResponse.java
index d1fee99..f4a54b4 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryRoleResponse.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TCreateSentryRoleResponse.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreateSentryRoleResponse, TCreateSentryRoleResponse._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCreateSentryRoleResponse");
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)1);
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -42,11 +42,11 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
schemes.put(TupleScheme.class, new TCreateSentryRoleResponseTupleSchemeFactory());
}
- private boolean success; // required
+ private TSentryResponseStatus status; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)1, "success");
+ STATUS((short)1, "status");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -61,8 +61,8 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
- case 1: // SUCCESS
- return SUCCESS;
+ case 1: // STATUS
+ return STATUS;
default:
return null;
}
@@ -103,13 +103,11 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
}
// isset id assignments
- private static final int __SUCCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSentryResponseStatus.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCreateSentryRoleResponse.class, metaDataMap);
}
@@ -118,19 +116,19 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
}
public TCreateSentryRoleResponse(
- boolean success)
+ TSentryResponseStatus status)
{
this();
- this.success = success;
- setSuccessIsSet(true);
+ this.status = status;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TCreateSentryRoleResponse(TCreateSentryRoleResponse other) {
- __isset_bitfield = other.__isset_bitfield;
- this.success = other.success;
+ if (other.isSetStatus()) {
+ this.status = new TSentryResponseStatus(other.status);
+ }
}
public TCreateSentryRoleResponse deepCopy() {
@@ -139,39 +137,39 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
@Override
public void clear() {
- setSuccessIsSet(false);
- this.success = false;
+ this.status = null;
}
- public boolean isSuccess() {
- return this.success;
+ public TSentryResponseStatus getStatus() {
+ return this.status;
}
- public void setSuccess(boolean success) {
- this.success = success;
- setSuccessIsSet(true);
+ public void setStatus(TSentryResponseStatus status) {
+ this.status = status;
}
- public void unsetSuccess() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ public void unsetStatus() {
+ this.status = null;
}
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
}
- public void setSuccessIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case SUCCESS:
+ case STATUS:
if (value == null) {
- unsetSuccess();
+ unsetStatus();
} else {
- setSuccess((Boolean)value);
+ setStatus((TSentryResponseStatus)value);
}
break;
@@ -180,8 +178,8 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
public Object getFieldValue(_Fields field) {
switch (field) {
- case SUCCESS:
- return Boolean.valueOf(isSuccess());
+ case STATUS:
+ return getStatus();
}
throw new IllegalStateException();
@@ -194,8 +192,8 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
}
switch (field) {
- case SUCCESS:
- return isSetSuccess();
+ case STATUS:
+ return isSetStatus();
}
throw new IllegalStateException();
}
@@ -213,12 +211,12 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
if (that == null)
return false;
- boolean this_present_success = true;
- boolean that_present_success = true;
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
return false;
- if (this.success != that.success)
+ if (!this.status.equals(that.status))
return false;
}
@@ -229,10 +227,10 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
- boolean present_success = true;
- builder.append(present_success);
- if (present_success)
- builder.append(success);
+ boolean present_status = true && (isSetStatus());
+ builder.append(present_status);
+ if (present_status)
+ builder.append(status);
return builder.toHashCode();
}
@@ -245,12 +243,12 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
int lastComparison = 0;
TCreateSentryRoleResponse typedOther = (TCreateSentryRoleResponse)other;
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
if (lastComparison != 0) {
return lastComparison;
}
@@ -275,8 +273,12 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
StringBuilder sb = new StringBuilder("TCreateSentryRoleResponse(");
boolean first = true;
- sb.append("success:");
- sb.append(this.success);
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
first = false;
sb.append(")");
return sb.toString();
@@ -284,11 +286,14 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
public void validate() throws org.apache.thrift.TException {
// check for required fields
- if (!isSetSuccess()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'success' is unset! Struct:" + toString());
+ if (!isSetStatus()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
}
// check for sub-struct validity
+ if (status != null) {
+ status.validate();
+ }
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -301,8 +306,6 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -327,10 +330,11 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
break;
}
switch (schemeField.id) {
- case 1: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ case 1: // STATUS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -348,9 +352,11 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeBool(struct.success);
- oprot.writeFieldEnd();
+ if (struct.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ struct.status.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -368,14 +374,15 @@ public class TCreateSentryRoleResponse implements org.apache.thrift.TBase<TCreat
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleResponse struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeBool(struct.success);
+ struct.status.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleResponse struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TListSentryRolesResponse.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TListSentryRolesResponse.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TListSentryRolesResponse.java
index e669797..60660d6 100644
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TListSentryRolesResponse.java
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TListSentryRolesResponse.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSentryRolesResponse, TListSentryRolesResponse._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TListSentryRolesResponse");
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)1);
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField ROLES_FIELD_DESC = new org.apache.thrift.protocol.TField("roles", org.apache.thrift.protocol.TType.SET, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
@@ -43,12 +43,12 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
schemes.put(TupleScheme.class, new TListSentryRolesResponseTupleSchemeFactory());
}
- private boolean success; // required
+ private TSentryResponseStatus status; // required
private Set<TSentryRole> roles; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)1, "success"),
+ STATUS((short)1, "status"),
ROLES((short)2, "roles");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -64,8 +64,8 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
- case 1: // SUCCESS
- return SUCCESS;
+ case 1: // STATUS
+ return STATUS;
case 2: // ROLES
return ROLES;
default:
@@ -108,13 +108,11 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
}
// isset id assignments
- private static final int __SUCCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSentryResponseStatus.class)));
tmpMap.put(_Fields.ROLES, new org.apache.thrift.meta_data.FieldMetaData("roles", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSentryRole.class))));
@@ -126,12 +124,11 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
}
public TListSentryRolesResponse(
- boolean success,
+ TSentryResponseStatus status,
Set<TSentryRole> roles)
{
this();
- this.success = success;
- setSuccessIsSet(true);
+ this.status = status;
this.roles = roles;
}
@@ -139,8 +136,9 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
* Performs a deep copy on <i>other</i>.
*/
public TListSentryRolesResponse(TListSentryRolesResponse other) {
- __isset_bitfield = other.__isset_bitfield;
- this.success = other.success;
+ if (other.isSetStatus()) {
+ this.status = new TSentryResponseStatus(other.status);
+ }
if (other.isSetRoles()) {
Set<TSentryRole> __this__roles = new HashSet<TSentryRole>();
for (TSentryRole other_element : other.roles) {
@@ -156,31 +154,31 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
@Override
public void clear() {
- setSuccessIsSet(false);
- this.success = false;
+ this.status = null;
this.roles = null;
}
- public boolean isSuccess() {
- return this.success;
+ public TSentryResponseStatus getStatus() {
+ return this.status;
}
- public void setSuccess(boolean success) {
- this.success = success;
- setSuccessIsSet(true);
+ public void setStatus(TSentryResponseStatus status) {
+ this.status = status;
}
- public void unsetSuccess() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ public void unsetStatus() {
+ this.status = null;
}
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
}
- public void setSuccessIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
}
public int getRolesSize() {
@@ -223,11 +221,11 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case SUCCESS:
+ case STATUS:
if (value == null) {
- unsetSuccess();
+ unsetStatus();
} else {
- setSuccess((Boolean)value);
+ setStatus((TSentryResponseStatus)value);
}
break;
@@ -244,8 +242,8 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
public Object getFieldValue(_Fields field) {
switch (field) {
- case SUCCESS:
- return Boolean.valueOf(isSuccess());
+ case STATUS:
+ return getStatus();
case ROLES:
return getRoles();
@@ -261,8 +259,8 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
}
switch (field) {
- case SUCCESS:
- return isSetSuccess();
+ case STATUS:
+ return isSetStatus();
case ROLES:
return isSetRoles();
}
@@ -282,12 +280,12 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
if (that == null)
return false;
- boolean this_present_success = true;
- boolean that_present_success = true;
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
return false;
- if (this.success != that.success)
+ if (!this.status.equals(that.status))
return false;
}
@@ -307,10 +305,10 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
- boolean present_success = true;
- builder.append(present_success);
- if (present_success)
- builder.append(success);
+ boolean present_status = true && (isSetStatus());
+ builder.append(present_status);
+ if (present_status)
+ builder.append(status);
boolean present_roles = true && (isSetRoles());
builder.append(present_roles);
@@ -328,12 +326,12 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
int lastComparison = 0;
TListSentryRolesResponse typedOther = (TListSentryRolesResponse)other;
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
if (lastComparison != 0) {
return lastComparison;
}
@@ -368,8 +366,12 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
StringBuilder sb = new StringBuilder("TListSentryRolesResponse(");
boolean first = true;
- sb.append("success:");
- sb.append(this.success);
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
first = false;
if (!first) sb.append(", ");
sb.append("roles:");
@@ -385,8 +387,8 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
public void validate() throws org.apache.thrift.TException {
// check for required fields
- if (!isSetSuccess()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'success' is unset! Struct:" + toString());
+ if (!isSetStatus()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
}
if (!isSetRoles()) {
@@ -394,6 +396,9 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
}
// check for sub-struct validity
+ if (status != null) {
+ status.validate();
+ }
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -406,8 +411,6 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
@@ -432,10 +435,11 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
break;
}
switch (schemeField.id) {
- case 1: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ case 1: // STATUS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -472,9 +476,11 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeBool(struct.success);
- oprot.writeFieldEnd();
+ if (struct.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ struct.status.write(oprot);
+ oprot.writeFieldEnd();
+ }
if (struct.roles != null) {
oprot.writeFieldBegin(ROLES_FIELD_DESC);
{
@@ -504,7 +510,7 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesResponse struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeBool(struct.success);
+ struct.status.write(oprot);
{
oprot.writeI32(struct.roles.size());
for (TSentryRole _iter20 : struct.roles)
@@ -517,8 +523,9 @@ public class TListSentryRolesResponse implements org.apache.thrift.TBase<TListSe
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesResponse struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
+ struct.status = new TSentryResponseStatus();
+ struct.status.read(iprot);
+ struct.setStatusIsSet(true);
{
org.apache.thrift.protocol.TSet _set21 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.roles = new HashSet<TSentryRole>(2*_set21.size);
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryAlreadyExistsException.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryAlreadyExistsException.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryAlreadyExistsException.java
deleted file mode 100644
index 59a8b54..0000000
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryAlreadyExistsException.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.0)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.sentry.policystore.api;
-
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TSentryAlreadyExistsException extends TException implements org.apache.thrift.TBase<TSentryAlreadyExistsException, TSentryAlreadyExistsException._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSentryAlreadyExistsException");
-
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TSentryAlreadyExistsExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TSentryAlreadyExistsExceptionTupleSchemeFactory());
- }
-
- private String message; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MESSAGE((short)1, "message");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // MESSAGE
- return MESSAGE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSentryAlreadyExistsException.class, metaDataMap);
- }
-
- public TSentryAlreadyExistsException() {
- }
-
- public TSentryAlreadyExistsException(
- String message)
- {
- this();
- this.message = message;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TSentryAlreadyExistsException(TSentryAlreadyExistsException other) {
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public TSentryAlreadyExistsException deepCopy() {
- return new TSentryAlreadyExistsException(this);
- }
-
- @Override
- public void clear() {
- this.message = null;
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MESSAGE:
- return getMessage();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TSentryAlreadyExistsException)
- return this.equals((TSentryAlreadyExistsException)that);
- return false;
- }
-
- public boolean equals(TSentryAlreadyExistsException that) {
- if (that == null)
- return false;
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
-
- boolean present_message = true && (isSetMessage());
- builder.append(present_message);
- if (present_message)
- builder.append(message);
-
- return builder.toHashCode();
- }
-
- public int compareTo(TSentryAlreadyExistsException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
- TSentryAlreadyExistsException typedOther = (TSentryAlreadyExistsException)other;
-
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("TSentryAlreadyExistsException(");
- boolean first = true;
-
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class TSentryAlreadyExistsExceptionStandardSchemeFactory implements SchemeFactory {
- public TSentryAlreadyExistsExceptionStandardScheme getScheme() {
- return new TSentryAlreadyExistsExceptionStandardScheme();
- }
- }
-
- private static class TSentryAlreadyExistsExceptionStandardScheme extends StandardScheme<TSentryAlreadyExistsException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TSentryAlreadyExistsException struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, TSentryAlreadyExistsException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TSentryAlreadyExistsExceptionTupleSchemeFactory implements SchemeFactory {
- public TSentryAlreadyExistsExceptionTupleScheme getScheme() {
- return new TSentryAlreadyExistsExceptionTupleScheme();
- }
- }
-
- private static class TSentryAlreadyExistsExceptionTupleScheme extends TupleScheme<TSentryAlreadyExistsException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TSentryAlreadyExistsException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetMessage()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TSentryAlreadyExistsException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryNoSuchObjectException.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryNoSuchObjectException.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryNoSuchObjectException.java
deleted file mode 100644
index dea44c3..0000000
--- a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryNoSuchObjectException.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.0)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.sentry.policystore.api;
-
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class TSentryNoSuchObjectException extends TException implements org.apache.thrift.TBase<TSentryNoSuchObjectException, TSentryNoSuchObjectException._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSentryNoSuchObjectException");
-
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TSentryNoSuchObjectExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TSentryNoSuchObjectExceptionTupleSchemeFactory());
- }
-
- private String message; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MESSAGE((short)1, "message");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // MESSAGE
- return MESSAGE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSentryNoSuchObjectException.class, metaDataMap);
- }
-
- public TSentryNoSuchObjectException() {
- }
-
- public TSentryNoSuchObjectException(
- String message)
- {
- this();
- this.message = message;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TSentryNoSuchObjectException(TSentryNoSuchObjectException other) {
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public TSentryNoSuchObjectException deepCopy() {
- return new TSentryNoSuchObjectException(this);
- }
-
- @Override
- public void clear() {
- this.message = null;
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MESSAGE:
- return getMessage();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TSentryNoSuchObjectException)
- return this.equals((TSentryNoSuchObjectException)that);
- return false;
- }
-
- public boolean equals(TSentryNoSuchObjectException that) {
- if (that == null)
- return false;
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
-
- boolean present_message = true && (isSetMessage());
- builder.append(present_message);
- if (present_message)
- builder.append(message);
-
- return builder.toHashCode();
- }
-
- public int compareTo(TSentryNoSuchObjectException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
- TSentryNoSuchObjectException typedOther = (TSentryNoSuchObjectException)other;
-
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("TSentryNoSuchObjectException(");
- boolean first = true;
-
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class TSentryNoSuchObjectExceptionStandardSchemeFactory implements SchemeFactory {
- public TSentryNoSuchObjectExceptionStandardScheme getScheme() {
- return new TSentryNoSuchObjectExceptionStandardScheme();
- }
- }
-
- private static class TSentryNoSuchObjectExceptionStandardScheme extends StandardScheme<TSentryNoSuchObjectException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TSentryNoSuchObjectException struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, TSentryNoSuchObjectException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TSentryNoSuchObjectExceptionTupleSchemeFactory implements SchemeFactory {
- public TSentryNoSuchObjectExceptionTupleScheme getScheme() {
- return new TSentryNoSuchObjectExceptionTupleScheme();
- }
- }
-
- private static class TSentryNoSuchObjectExceptionTupleScheme extends TupleScheme<TSentryNoSuchObjectException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TSentryNoSuchObjectException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetMessage()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TSentryNoSuchObjectException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryResponseStatus.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryResponseStatus.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryResponseStatus.java
new file mode 100644
index 0000000..01b9afc
--- /dev/null
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryResponseStatus.java
@@ -0,0 +1,608 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.sentry.policystore.api;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TSentryResponseStatus implements org.apache.thrift.TBase<TSentryResponseStatus, TSentryResponseStatus._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSentryResponseStatus");
+
+ private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField STACK_FIELD_DESC = new org.apache.thrift.protocol.TField("stack", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TSentryResponseStatusStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TSentryResponseStatusTupleSchemeFactory());
+ }
+
+ private TSentryStatus value; // required
+ private String message; // required
+ private String stack; // optional
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see TSentryStatus
+ */
+ VALUE((short)1, "value"),
+ MESSAGE((short)2, "message"),
+ STACK((short)3, "stack");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // VALUE
+ return VALUE;
+ case 2: // MESSAGE
+ return MESSAGE;
+ case 3: // STACK
+ return STACK;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private _Fields optionals[] = {_Fields.STACK};
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TSentryStatus.class)));
+ tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.STACK, new org.apache.thrift.meta_data.FieldMetaData("stack", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSentryResponseStatus.class, metaDataMap);
+ }
+
+ public TSentryResponseStatus() {
+ }
+
+ public TSentryResponseStatus(
+ TSentryStatus value,
+ String message)
+ {
+ this();
+ this.value = value;
+ this.message = message;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TSentryResponseStatus(TSentryResponseStatus other) {
+ if (other.isSetValue()) {
+ this.value = other.value;
+ }
+ if (other.isSetMessage()) {
+ this.message = other.message;
+ }
+ if (other.isSetStack()) {
+ this.stack = other.stack;
+ }
+ }
+
+ public TSentryResponseStatus deepCopy() {
+ return new TSentryResponseStatus(this);
+ }
+
+ @Override
+ public void clear() {
+ this.value = null;
+ this.message = null;
+ this.stack = null;
+ }
+
+ /**
+ *
+ * @see TSentryStatus
+ */
+ public TSentryStatus getValue() {
+ return this.value;
+ }
+
+ /**
+ *
+ * @see TSentryStatus
+ */
+ public void setValue(TSentryStatus value) {
+ this.value = value;
+ }
+
+ public void unsetValue() {
+ this.value = null;
+ }
+
+ /** Returns true if field value is set (has been assigned a value) and false otherwise */
+ public boolean isSetValue() {
+ return this.value != null;
+ }
+
+ public void setValueIsSet(boolean value) {
+ if (!value) {
+ this.value = null;
+ }
+ }
+
+ public String getMessage() {
+ return this.message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public void unsetMessage() {
+ this.message = null;
+ }
+
+ /** Returns true if field message is set (has been assigned a value) and false otherwise */
+ public boolean isSetMessage() {
+ return this.message != null;
+ }
+
+ public void setMessageIsSet(boolean value) {
+ if (!value) {
+ this.message = null;
+ }
+ }
+
+ public String getStack() {
+ return this.stack;
+ }
+
+ public void setStack(String stack) {
+ this.stack = stack;
+ }
+
+ public void unsetStack() {
+ this.stack = null;
+ }
+
+ /** Returns true if field stack is set (has been assigned a value) and false otherwise */
+ public boolean isSetStack() {
+ return this.stack != null;
+ }
+
+ public void setStackIsSet(boolean value) {
+ if (!value) {
+ this.stack = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case VALUE:
+ if (value == null) {
+ unsetValue();
+ } else {
+ setValue((TSentryStatus)value);
+ }
+ break;
+
+ case MESSAGE:
+ if (value == null) {
+ unsetMessage();
+ } else {
+ setMessage((String)value);
+ }
+ break;
+
+ case STACK:
+ if (value == null) {
+ unsetStack();
+ } else {
+ setStack((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case VALUE:
+ return getValue();
+
+ case MESSAGE:
+ return getMessage();
+
+ case STACK:
+ return getStack();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case VALUE:
+ return isSetValue();
+ case MESSAGE:
+ return isSetMessage();
+ case STACK:
+ return isSetStack();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TSentryResponseStatus)
+ return this.equals((TSentryResponseStatus)that);
+ return false;
+ }
+
+ public boolean equals(TSentryResponseStatus that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_value = true && this.isSetValue();
+ boolean that_present_value = true && that.isSetValue();
+ if (this_present_value || that_present_value) {
+ if (!(this_present_value && that_present_value))
+ return false;
+ if (!this.value.equals(that.value))
+ return false;
+ }
+
+ boolean this_present_message = true && this.isSetMessage();
+ boolean that_present_message = true && that.isSetMessage();
+ if (this_present_message || that_present_message) {
+ if (!(this_present_message && that_present_message))
+ return false;
+ if (!this.message.equals(that.message))
+ return false;
+ }
+
+ boolean this_present_stack = true && this.isSetStack();
+ boolean that_present_stack = true && that.isSetStack();
+ if (this_present_stack || that_present_stack) {
+ if (!(this_present_stack && that_present_stack))
+ return false;
+ if (!this.stack.equals(that.stack))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_value = true && (isSetValue());
+ builder.append(present_value);
+ if (present_value)
+ builder.append(value.getValue());
+
+ boolean present_message = true && (isSetMessage());
+ builder.append(present_message);
+ if (present_message)
+ builder.append(message);
+
+ boolean present_stack = true && (isSetStack());
+ builder.append(present_stack);
+ if (present_stack)
+ builder.append(stack);
+
+ return builder.toHashCode();
+ }
+
+ public int compareTo(TSentryResponseStatus other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TSentryResponseStatus typedOther = (TSentryResponseStatus)other;
+
+ lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetValue()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMessage()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStack()).compareTo(typedOther.isSetStack());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStack()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stack, typedOther.stack);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TSentryResponseStatus(");
+ boolean first = true;
+
+ sb.append("value:");
+ if (this.value == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.value);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("message:");
+ if (this.message == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.message);
+ }
+ first = false;
+ if (isSetStack()) {
+ if (!first) sb.append(", ");
+ sb.append("stack:");
+ if (this.stack == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.stack);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetValue()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' is unset! Struct:" + toString());
+ }
+
+ if (!isSetMessage()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TSentryResponseStatusStandardSchemeFactory implements SchemeFactory {
+ public TSentryResponseStatusStandardScheme getScheme() {
+ return new TSentryResponseStatusStandardScheme();
+ }
+ }
+
+ private static class TSentryResponseStatusStandardScheme extends StandardScheme<TSentryResponseStatus> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TSentryResponseStatus struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // VALUE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.value = TSentryStatus.findByValue(iprot.readI32());
+ struct.setValueIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // MESSAGE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.message = iprot.readString();
+ struct.setMessageIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // STACK
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.stack = iprot.readString();
+ struct.setStackIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TSentryResponseStatus struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.value != null) {
+ oprot.writeFieldBegin(VALUE_FIELD_DESC);
+ oprot.writeI32(struct.value.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.message != null) {
+ oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+ oprot.writeString(struct.message);
+ oprot.writeFieldEnd();
+ }
+ if (struct.stack != null) {
+ if (struct.isSetStack()) {
+ oprot.writeFieldBegin(STACK_FIELD_DESC);
+ oprot.writeString(struct.stack);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TSentryResponseStatusTupleSchemeFactory implements SchemeFactory {
+ public TSentryResponseStatusTupleScheme getScheme() {
+ return new TSentryResponseStatusTupleScheme();
+ }
+ }
+
+ private static class TSentryResponseStatusTupleScheme extends TupleScheme<TSentryResponseStatus> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TSentryResponseStatus struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeI32(struct.value.getValue());
+ oprot.writeString(struct.message);
+ BitSet optionals = new BitSet();
+ if (struct.isSetStack()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetStack()) {
+ oprot.writeString(struct.stack);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TSentryResponseStatus struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.value = TSentryStatus.findByValue(iprot.readI32());
+ struct.setValueIsSet(true);
+ struct.message = iprot.readString();
+ struct.setMessageIsSet(true);
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.stack = iprot.readString();
+ struct.setStackIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/2a1ceb57/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryStatus.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryStatus.java b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryStatus.java
new file mode 100644
index 0000000..10b42d0
--- /dev/null
+++ b/sentry-provider/sentry-provider-db/src/gen/thrift/gen-javabean/org/apache/sentry/policystore/api/TSentryStatus.java
@@ -0,0 +1,51 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.sentry.policystore.api;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum TSentryStatus implements org.apache.thrift.TEnum {
+ OK(0),
+ ALREADY_EXISTS(1),
+ NO_SUCH_OBJECT(2),
+ RUNTIME_ERROR(3);
+
+ private final int value;
+
+ private TSentryStatus(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static TSentryStatus findByValue(int value) {
+ switch (value) {
+ case 0:
+ return OK;
+ case 1:
+ return ALREADY_EXISTS;
+ case 2:
+ return NO_SUCH_OBJECT;
+ case 3:
+ return RUNTIME_ERROR;
+ default:
+ return null;
+ }
+ }
+}