From 4cac0239599d16dbe18ed8623bb89885d9a9bec6 Mon Sep 17 00:00:00 2001 From: Kevin Rathbun Date: Fri, 9 Jan 2026 10:39:50 -0500 Subject: [PATCH 1/2] Fix exception bug with executeFateOperation ThriftPropertyException was declared as thrown by FateServiceHandler.executeFateOperation but not by manager.thrift.executeFateOperation, resulting in the client receiving an exception without info about the cause. --- .../core/manager/thrift/FateService.java | 132 ++++++++++++++++-- core/src/main/thrift/manager.thrift | 1 + 2 files changed, 125 insertions(+), 8 deletions(-) diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java index c9c06480c5c..b1da81397c6 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java @@ -31,7 +31,7 @@ public interface Iface { public long beginFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; - public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; + public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException; public java.lang.String waitForFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; @@ -109,7 +109,7 @@ public long recv_beginFateOperation() throws org.apache.accumulo.core.clientImpl } @Override - public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException + public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException { send_executeFateOperation(tinfo, credentials, opid, op, arguments, options, autoClean); recv_executeFateOperation(); @@ -128,7 +128,7 @@ public void send_executeFateOperation(org.apache.accumulo.core.trace.thrift.TInf sendBase("executeFateOperation", args); } - public void recv_executeFateOperation() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException + public void recv_executeFateOperation() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException { executeFateOperation_result result = new executeFateOperation_result(); receiveBase(result, "executeFateOperation"); @@ -141,6 +141,9 @@ public void recv_executeFateOperation() throws org.apache.accumulo.core.clientIm if (result.tnase != null) { throw result.tnase; } + if (result.tpe != null) { + throw result.tpe; + } return; } @@ -340,7 +343,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa } @Override - public Void getResult() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { + public Void getResult() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); } @@ -562,6 +565,8 @@ public executeFateOperation_result getResult(I iface, executeFateOperation_args result.tope = tope; } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { result.tnase = tnase; + } catch (ThriftPropertyException tpe) { + result.tpe = tpe; } return result; } @@ -813,6 +818,10 @@ public void onError(java.lang.Exception e) { result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e; result.setTnaseIsSet(true); msg = result; + } else if (e instanceof ThriftPropertyException) { + result.tpe = (ThriftPropertyException) e; + result.setTpeIsSet(true); + msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); fb.close(); @@ -3291,6 +3300,7 @@ public static class executeFateOperation_result implements org.apache.thrift.TBa private static final org.apache.thrift.protocol.TField SEC_FIELD_DESC = new org.apache.thrift.protocol.TField("sec", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tope", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TNASE_FIELD_DESC = new org.apache.thrift.protocol.TField("tnase", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tpe", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new executeFateOperation_resultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new executeFateOperation_resultTupleSchemeFactory(); @@ -3298,12 +3308,14 @@ public static class executeFateOperation_result implements org.apache.thrift.TBa public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec; // required public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException tope; // required public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase; // required + public @org.apache.thrift.annotation.Nullable ThriftPropertyException tpe; // 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 { SEC((short)1, "sec"), TOPE((short)2, "tope"), - TNASE((short)3, "tnase"); + TNASE((short)3, "tnase"), + TPE((short)4, "tpe"); private static final java.util.Map byName = new java.util.HashMap(); @@ -3325,6 +3337,8 @@ public static _Fields findByThriftId(int fieldId) { return TOPE; case 3: // TNASE return TNASE; + case 4: // TPE + return TPE; default: return null; } @@ -3377,6 +3391,8 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException.class))); tmpMap.put(_Fields.TNASE, new org.apache.thrift.meta_data.FieldMetaData("tnase", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException.class))); + tmpMap.put(_Fields.TPE, new org.apache.thrift.meta_data.FieldMetaData("tpe", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftPropertyException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeFateOperation_result.class, metaDataMap); } @@ -3387,12 +3403,14 @@ public executeFateOperation_result() { public executeFateOperation_result( org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException tope, - org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) + org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase, + ThriftPropertyException tpe) { this(); this.sec = sec; this.tope = tope; this.tnase = tnase; + this.tpe = tpe; } /** @@ -3408,6 +3426,9 @@ public executeFateOperation_result(executeFateOperation_result other) { if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } + if (other.isSetTpe()) { + this.tpe = new ThriftPropertyException(other.tpe); + } } @Override @@ -3420,6 +3441,7 @@ public void clear() { this.sec = null; this.tope = null; this.tnase = null; + this.tpe = null; } @org.apache.thrift.annotation.Nullable @@ -3497,6 +3519,31 @@ public void setTnaseIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable + public ThriftPropertyException getTpe() { + return this.tpe; + } + + public executeFateOperation_result setTpe(@org.apache.thrift.annotation.Nullable ThriftPropertyException tpe) { + this.tpe = tpe; + return this; + } + + public void unsetTpe() { + this.tpe = null; + } + + /** Returns true if field tpe is set (has been assigned a value) and false otherwise */ + public boolean isSetTpe() { + return this.tpe != null; + } + + public void setTpeIsSet(boolean value) { + if (!value) { + this.tpe = null; + } + } + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -3524,6 +3571,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; + case TPE: + if (value == null) { + unsetTpe(); + } else { + setTpe((ThriftPropertyException)value); + } + break; + } } @@ -3540,6 +3595,9 @@ public java.lang.Object getFieldValue(_Fields field) { case TNASE: return getTnase(); + case TPE: + return getTpe(); + } throw new java.lang.IllegalStateException(); } @@ -3558,6 +3616,8 @@ public boolean isSet(_Fields field) { return isSetTope(); case TNASE: return isSetTnase(); + case TPE: + return isSetTpe(); } throw new java.lang.IllegalStateException(); } @@ -3602,6 +3662,15 @@ public boolean equals(executeFateOperation_result that) { return false; } + boolean this_present_tpe = true && this.isSetTpe(); + boolean that_present_tpe = true && that.isSetTpe(); + if (this_present_tpe || that_present_tpe) { + if (!(this_present_tpe && that_present_tpe)) + return false; + if (!this.tpe.equals(that.tpe)) + return false; + } + return true; } @@ -3621,6 +3690,10 @@ public int hashCode() { if (isSetTnase()) hashCode = hashCode * 8191 + tnase.hashCode(); + hashCode = hashCode * 8191 + ((isSetTpe()) ? 131071 : 524287); + if (isSetTpe()) + hashCode = hashCode * 8191 + tpe.hashCode(); + return hashCode; } @@ -3662,6 +3735,16 @@ public int compareTo(executeFateOperation_result other) { return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetTpe(), other.isSetTpe()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTpe()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tpe, other.tpe); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -3708,6 +3791,14 @@ public java.lang.String toString() { sb.append(this.tnase); } first = false; + if (!first) sb.append(", "); + sb.append("tpe:"); + if (this.tpe == null) { + sb.append("null"); + } else { + sb.append(this.tpe); + } + first = false; sb.append(")"); return sb.toString(); } @@ -3780,6 +3871,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, executeFateOperatio org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // TPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tpe = new ThriftPropertyException(); + struct.tpe.read(iprot); + struct.setTpeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -3811,6 +3911,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, executeFateOperati struct.tnase.write(oprot); oprot.writeFieldEnd(); } + if (struct.tpe != null) { + oprot.writeFieldBegin(TPE_FIELD_DESC); + struct.tpe.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -3839,7 +3944,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, executeFateOperatio if (struct.isSetTnase()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetTpe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetSec()) { struct.sec.write(oprot); } @@ -3849,12 +3957,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, executeFateOperatio if (struct.isSetTnase()) { struct.tnase.write(oprot); } + if (struct.isSetTpe()) { + struct.tpe.write(oprot); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, executeFateOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); struct.sec.read(iprot); @@ -3870,6 +3981,11 @@ public void read(org.apache.thrift.protocol.TProtocol prot, executeFateOperation struct.tnase.read(iprot); struct.setTnaseIsSet(true); } + if (incoming.get(3)) { + struct.tpe = new ThriftPropertyException(); + struct.tpe.read(iprot); + struct.setTpeIsSet(true); + } } } diff --git a/core/src/main/thrift/manager.thrift b/core/src/main/thrift/manager.thrift index 139e55fc1e4..a3044d34609 100644 --- a/core/src/main/thrift/manager.thrift +++ b/core/src/main/thrift/manager.thrift @@ -127,6 +127,7 @@ service FateService { 1:client.ThriftSecurityException sec 2:client.ThriftTableOperationException tope 3:client.ThriftNotActiveServiceException tnase + 4:ThriftPropertyException tpe ) // wait for completion of the operation and get the returned exception, if any From 6e72b84325b5e2556b4f0cb3ee562cdc0428f10f Mon Sep 17 00:00:00 2001 From: Kevin Rathbun Date: Thu, 15 Jan 2026 16:10:17 -0500 Subject: [PATCH 2/2] Revert thrift changes, remove ThriftPropertyException from... being thrown by executeFateOperation, replaced with ThriftTableOperationException --- .../core/manager/thrift/FateService.java | 132 ++---------------- core/src/main/thrift/manager.thrift | 1 - .../accumulo/manager/FateServiceHandler.java | 9 +- 3 files changed, 13 insertions(+), 129 deletions(-) diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java index b1da81397c6..c9c06480c5c 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/FateService.java @@ -31,7 +31,7 @@ public interface Iface { public long beginFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; - public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException; + public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; public java.lang.String waitForFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; @@ -109,7 +109,7 @@ public long recv_beginFateOperation() throws org.apache.accumulo.core.clientImpl } @Override - public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException + public void executeFateOperation(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, long opid, FateOperation op, java.util.List arguments, java.util.Map options, boolean autoClean) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { send_executeFateOperation(tinfo, credentials, opid, op, arguments, options, autoClean); recv_executeFateOperation(); @@ -128,7 +128,7 @@ public void send_executeFateOperation(org.apache.accumulo.core.trace.thrift.TInf sendBase("executeFateOperation", args); } - public void recv_executeFateOperation() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException + public void recv_executeFateOperation() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { executeFateOperation_result result = new executeFateOperation_result(); receiveBase(result, "executeFateOperation"); @@ -141,9 +141,6 @@ public void recv_executeFateOperation() throws org.apache.accumulo.core.clientIm if (result.tnase != null) { throw result.tnase; } - if (result.tpe != null) { - throw result.tpe; - } return; } @@ -343,7 +340,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa } @Override - public Void getResult() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, ThriftPropertyException, org.apache.thrift.TException { + public Void getResult() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); } @@ -565,8 +562,6 @@ public executeFateOperation_result getResult(I iface, executeFateOperation_args result.tope = tope; } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { result.tnase = tnase; - } catch (ThriftPropertyException tpe) { - result.tpe = tpe; } return result; } @@ -818,10 +813,6 @@ public void onError(java.lang.Exception e) { result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e; result.setTnaseIsSet(true); msg = result; - } else if (e instanceof ThriftPropertyException) { - result.tpe = (ThriftPropertyException) e; - result.setTpeIsSet(true); - msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); fb.close(); @@ -3300,7 +3291,6 @@ public static class executeFateOperation_result implements org.apache.thrift.TBa private static final org.apache.thrift.protocol.TField SEC_FIELD_DESC = new org.apache.thrift.protocol.TField("sec", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tope", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TNASE_FIELD_DESC = new org.apache.thrift.protocol.TField("tnase", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tpe", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new executeFateOperation_resultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new executeFateOperation_resultTupleSchemeFactory(); @@ -3308,14 +3298,12 @@ public static class executeFateOperation_result implements org.apache.thrift.TBa public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec; // required public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException tope; // required public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase; // required - public @org.apache.thrift.annotation.Nullable ThriftPropertyException tpe; // 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 { SEC((short)1, "sec"), TOPE((short)2, "tope"), - TNASE((short)3, "tnase"), - TPE((short)4, "tpe"); + TNASE((short)3, "tnase"); private static final java.util.Map byName = new java.util.HashMap(); @@ -3337,8 +3325,6 @@ public static _Fields findByThriftId(int fieldId) { return TOPE; case 3: // TNASE return TNASE; - case 4: // TPE - return TPE; default: return null; } @@ -3391,8 +3377,6 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException.class))); tmpMap.put(_Fields.TNASE, new org.apache.thrift.meta_data.FieldMetaData("tnase", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException.class))); - tmpMap.put(_Fields.TPE, new org.apache.thrift.meta_data.FieldMetaData("tpe", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftPropertyException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeFateOperation_result.class, metaDataMap); } @@ -3403,14 +3387,12 @@ public executeFateOperation_result() { public executeFateOperation_result( org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException tope, - org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase, - ThriftPropertyException tpe) + org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { this(); this.sec = sec; this.tope = tope; this.tnase = tnase; - this.tpe = tpe; } /** @@ -3426,9 +3408,6 @@ public executeFateOperation_result(executeFateOperation_result other) { if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } - if (other.isSetTpe()) { - this.tpe = new ThriftPropertyException(other.tpe); - } } @Override @@ -3441,7 +3420,6 @@ public void clear() { this.sec = null; this.tope = null; this.tnase = null; - this.tpe = null; } @org.apache.thrift.annotation.Nullable @@ -3519,31 +3497,6 @@ public void setTnaseIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public ThriftPropertyException getTpe() { - return this.tpe; - } - - public executeFateOperation_result setTpe(@org.apache.thrift.annotation.Nullable ThriftPropertyException tpe) { - this.tpe = tpe; - return this; - } - - public void unsetTpe() { - this.tpe = null; - } - - /** Returns true if field tpe is set (has been assigned a value) and false otherwise */ - public boolean isSetTpe() { - return this.tpe != null; - } - - public void setTpeIsSet(boolean value) { - if (!value) { - this.tpe = null; - } - } - @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { @@ -3571,14 +3524,6 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } break; - case TPE: - if (value == null) { - unsetTpe(); - } else { - setTpe((ThriftPropertyException)value); - } - break; - } } @@ -3595,9 +3540,6 @@ public java.lang.Object getFieldValue(_Fields field) { case TNASE: return getTnase(); - case TPE: - return getTpe(); - } throw new java.lang.IllegalStateException(); } @@ -3616,8 +3558,6 @@ public boolean isSet(_Fields field) { return isSetTope(); case TNASE: return isSetTnase(); - case TPE: - return isSetTpe(); } throw new java.lang.IllegalStateException(); } @@ -3662,15 +3602,6 @@ public boolean equals(executeFateOperation_result that) { return false; } - boolean this_present_tpe = true && this.isSetTpe(); - boolean that_present_tpe = true && that.isSetTpe(); - if (this_present_tpe || that_present_tpe) { - if (!(this_present_tpe && that_present_tpe)) - return false; - if (!this.tpe.equals(that.tpe)) - return false; - } - return true; } @@ -3690,10 +3621,6 @@ public int hashCode() { if (isSetTnase()) hashCode = hashCode * 8191 + tnase.hashCode(); - hashCode = hashCode * 8191 + ((isSetTpe()) ? 131071 : 524287); - if (isSetTpe()) - hashCode = hashCode * 8191 + tpe.hashCode(); - return hashCode; } @@ -3735,16 +3662,6 @@ public int compareTo(executeFateOperation_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.compare(isSetTpe(), other.isSetTpe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTpe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tpe, other.tpe); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -3791,14 +3708,6 @@ public java.lang.String toString() { sb.append(this.tnase); } first = false; - if (!first) sb.append(", "); - sb.append("tpe:"); - if (this.tpe == null) { - sb.append("null"); - } else { - sb.append(this.tpe); - } - first = false; sb.append(")"); return sb.toString(); } @@ -3871,15 +3780,6 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, executeFateOperatio org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // TPE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.tpe = new ThriftPropertyException(); - struct.tpe.read(iprot); - struct.setTpeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -3911,11 +3811,6 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, executeFateOperati struct.tnase.write(oprot); oprot.writeFieldEnd(); } - if (struct.tpe != null) { - oprot.writeFieldBegin(TPE_FIELD_DESC); - struct.tpe.write(oprot); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -3944,10 +3839,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, executeFateOperatio if (struct.isSetTnase()) { optionals.set(2); } - if (struct.isSetTpe()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); + oprot.writeBitSet(optionals, 3); if (struct.isSetSec()) { struct.sec.write(oprot); } @@ -3957,15 +3849,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, executeFateOperatio if (struct.isSetTnase()) { struct.tnase.write(oprot); } - if (struct.isSetTpe()) { - struct.tpe.write(oprot); - } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, executeFateOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); struct.sec.read(iprot); @@ -3981,11 +3870,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, executeFateOperation struct.tnase.read(iprot); struct.setTnaseIsSet(true); } - if (incoming.get(3)) { - struct.tpe = new ThriftPropertyException(); - struct.tpe.read(iprot); - struct.setTpeIsSet(true); - } } } diff --git a/core/src/main/thrift/manager.thrift b/core/src/main/thrift/manager.thrift index a3044d34609..139e55fc1e4 100644 --- a/core/src/main/thrift/manager.thrift +++ b/core/src/main/thrift/manager.thrift @@ -127,7 +127,6 @@ service FateService { 1:client.ThriftSecurityException sec 2:client.ThriftTableOperationException tope 3:client.ThriftNotActiveServiceException tnase - 4:ThriftPropertyException tpe ) // wait for completion of the operation and get the returned exception, if any diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java b/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java index 52320225bab..57e3858a2da 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/FateServiceHandler.java @@ -66,7 +66,6 @@ import org.apache.accumulo.core.manager.state.tables.TableState; import org.apache.accumulo.core.manager.thrift.FateOperation; import org.apache.accumulo.core.manager.thrift.FateService; -import org.apache.accumulo.core.manager.thrift.ThriftPropertyException; import org.apache.accumulo.core.master.thrift.BulkImportState; import org.apache.accumulo.core.securityImpl.thrift.TCredentials; import org.apache.accumulo.core.trace.thrift.TInfo; @@ -118,7 +117,7 @@ public long beginFateOperation(TInfo tinfo, TCredentials credentials) @Override public void executeFateOperation(TInfo tinfo, TCredentials c, long opid, FateOperation op, List arguments, Map options, boolean autoCleanup) - throws ThriftSecurityException, ThriftTableOperationException, ThriftPropertyException { + throws ThriftSecurityException, ThriftTableOperationException { authenticate(c); String goalMessage = op.toString() + " "; @@ -223,7 +222,8 @@ public void executeFateOperation(TInfo tinfo, TCredentials c, long opid, FateOpe if (!Property.isValidTablePropertyKey(entry.getKey())) { errorMessage = "Invalid Table Property "; } - throw new ThriftPropertyException(entry.getKey(), entry.getValue(), + throw new ThriftTableOperationException(null, tableName, tableOp, + TableOperationExceptionType.OTHER, errorMessage + entry.getKey() + "=" + entry.getValue()); } } @@ -334,7 +334,8 @@ public void executeFateOperation(TInfo tinfo, TCredentials c, long opid, FateOpe if (!Property.isValidTablePropertyKey(entry.getKey())) { errorMessage = "Invalid Table Property "; } - throw new ThriftPropertyException(entry.getKey(), entry.getValue(), + throw new ThriftTableOperationException(null, tableName, tableOp, + TableOperationExceptionType.OTHER, errorMessage + entry.getKey() + "=" + entry.getValue()); }