You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/04/09 21:19:51 UTC
svn commit: r1466186 - in /accumulo/trunk/proxy/src:
main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
main/java/org/apache/accumulo/proxy/thrift/PrincipalToken.java
main/thrift/proxy.thrift test/java/org/apache/accumulo/proxy/SimpleTest.java
Author: ecn
Date: Tue Apr 9 19:19:50 2013
New Revision: 1466186
URL: http://svn.apache.org/r1466186
Log:
ACCUMULO-1199 added a lot of table not found checks
Removed:
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/PrincipalToken.java
Modified:
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
accumulo/trunk/proxy/src/main/thrift/proxy.thrift
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
Modified: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java?rev=1466186&r1=1466185&r2=1466186&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java (original)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java Tue Apr 9 19:19:50 2013
@@ -76,7 +76,7 @@ import org.slf4j.LoggerFactory;
public void exportTable(ByteBuffer login, String tableName, String exportDir) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
- public void flushTable(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow, boolean wait) throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException;
+ public void flushTable(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
public Map<String,Set<String>> getLocalityGroups(ByteBuffer login, String tableName) throws AccumuloException, TableNotFoundException, org.apache.thrift.TException;
@@ -158,7 +158,7 @@ import org.slf4j.LoggerFactory;
public boolean hasSystemPermission(ByteBuffer login, String user, SystemPermission perm) throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException;
- public boolean hasTablePermission(ByteBuffer login, String user, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException;
+ public boolean hasTablePermission(ByteBuffer login, String user, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
public Set<String> listLocalUsers(ByteBuffer login) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
@@ -764,7 +764,7 @@ import org.slf4j.LoggerFactory;
return;
}
- public void flushTable(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow, boolean wait) throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException
+ public void flushTable(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
send_flushTable(login, tableName, startRow, endRow, wait);
recv_flushTable();
@@ -781,7 +781,7 @@ import org.slf4j.LoggerFactory;
sendBase("flushTable", args);
}
- public void recv_flushTable() throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException
+ public void recv_flushTable() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
flushTable_result result = new flushTable_result();
receiveBase(result, "flushTable");
@@ -791,6 +791,9 @@ import org.slf4j.LoggerFactory;
if (result.ouch2 != null) {
throw result.ouch2;
}
+ if (result.ouch3 != null) {
+ throw result.ouch3;
+ }
return;
}
@@ -1984,7 +1987,7 @@ import org.slf4j.LoggerFactory;
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "hasSystemPermission failed: unknown result");
}
- public boolean hasTablePermission(ByteBuffer login, String user, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException
+ public boolean hasTablePermission(ByteBuffer login, String user, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
send_hasTablePermission(login, user, table, perm);
return recv_hasTablePermission();
@@ -2000,7 +2003,7 @@ import org.slf4j.LoggerFactory;
sendBase("hasTablePermission", args);
}
- public boolean recv_hasTablePermission() throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException
+ public boolean recv_hasTablePermission() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
hasTablePermission_result result = new hasTablePermission_result();
receiveBase(result, "hasTablePermission");
@@ -2013,6 +2016,9 @@ import org.slf4j.LoggerFactory;
if (result.ouch2 != null) {
throw result.ouch2;
}
+ if (result.ouch3 != null) {
+ throw result.ouch3;
+ }
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "hasTablePermission failed: unknown result");
}
@@ -3037,7 +3043,7 @@ import org.slf4j.LoggerFactory;
prot.writeMessageEnd();
}
- public void getResult() throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException {
+ public void getResult() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
@@ -4565,7 +4571,7 @@ import org.slf4j.LoggerFactory;
prot.writeMessageEnd();
}
- public boolean getResult() throws AccumuloException, AccumuloSecurityException, org.apache.thrift.TException {
+ public boolean getResult() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
@@ -5599,6 +5605,8 @@ import org.slf4j.LoggerFactory;
result.ouch1 = ouch1;
} catch (AccumuloSecurityException ouch2) {
result.ouch2 = ouch2;
+ } catch (TableNotFoundException ouch3) {
+ result.ouch3 = ouch3;
}
return result;
}
@@ -6676,6 +6684,8 @@ import org.slf4j.LoggerFactory;
result.ouch1 = ouch1;
} catch (AccumuloSecurityException ouch2) {
result.ouch2 = ouch2;
+ } catch (TableNotFoundException ouch3) {
+ result.ouch3 = ouch3;
}
return result;
}
@@ -23450,6 +23460,7 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField OUCH1_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField OUCH2_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField OUCH3_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch3", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -23459,11 +23470,13 @@ import org.slf4j.LoggerFactory;
public AccumuloException ouch1; // required
public AccumuloSecurityException ouch2; // required
+ public TableNotFoundException ouch3; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
OUCH1((short)1, "ouch1"),
- OUCH2((short)2, "ouch2");
+ OUCH2((short)2, "ouch2"),
+ OUCH3((short)3, "ouch3");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -23482,6 +23495,8 @@ import org.slf4j.LoggerFactory;
return OUCH1;
case 2: // OUCH2
return OUCH2;
+ case 3: // OUCH3
+ return OUCH3;
default:
return null;
}
@@ -23529,6 +23544,8 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.OUCH2, new org.apache.thrift.meta_data.FieldMetaData("ouch2", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.OUCH3, new org.apache.thrift.meta_data.FieldMetaData("ouch3", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(flushTable_result.class, metaDataMap);
}
@@ -23538,11 +23555,13 @@ import org.slf4j.LoggerFactory;
public flushTable_result(
AccumuloException ouch1,
- AccumuloSecurityException ouch2)
+ AccumuloSecurityException ouch2,
+ TableNotFoundException ouch3)
{
this();
this.ouch1 = ouch1;
this.ouch2 = ouch2;
+ this.ouch3 = ouch3;
}
/**
@@ -23555,6 +23574,9 @@ import org.slf4j.LoggerFactory;
if (other.isSetOuch2()) {
this.ouch2 = new AccumuloSecurityException(other.ouch2);
}
+ if (other.isSetOuch3()) {
+ this.ouch3 = new TableNotFoundException(other.ouch3);
+ }
}
public flushTable_result deepCopy() {
@@ -23565,6 +23587,7 @@ import org.slf4j.LoggerFactory;
public void clear() {
this.ouch1 = null;
this.ouch2 = null;
+ this.ouch3 = null;
}
public AccumuloException getOuch1() {
@@ -23615,6 +23638,30 @@ import org.slf4j.LoggerFactory;
}
}
+ public TableNotFoundException getOuch3() {
+ return this.ouch3;
+ }
+
+ public flushTable_result setOuch3(TableNotFoundException ouch3) {
+ this.ouch3 = ouch3;
+ return this;
+ }
+
+ public void unsetOuch3() {
+ this.ouch3 = null;
+ }
+
+ /** Returns true if field ouch3 is set (has been assigned a value) and false otherwise */
+ public boolean isSetOuch3() {
+ return this.ouch3 != null;
+ }
+
+ public void setOuch3IsSet(boolean value) {
+ if (!value) {
+ this.ouch3 = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case OUCH1:
@@ -23633,6 +23680,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case OUCH3:
+ if (value == null) {
+ unsetOuch3();
+ } else {
+ setOuch3((TableNotFoundException)value);
+ }
+ break;
+
}
}
@@ -23644,6 +23699,9 @@ import org.slf4j.LoggerFactory;
case OUCH2:
return getOuch2();
+ case OUCH3:
+ return getOuch3();
+
}
throw new IllegalStateException();
}
@@ -23659,6 +23717,8 @@ import org.slf4j.LoggerFactory;
return isSetOuch1();
case OUCH2:
return isSetOuch2();
+ case OUCH3:
+ return isSetOuch3();
}
throw new IllegalStateException();
}
@@ -23694,6 +23754,15 @@ import org.slf4j.LoggerFactory;
return false;
}
+ boolean this_present_ouch3 = true && this.isSetOuch3();
+ boolean that_present_ouch3 = true && that.isSetOuch3();
+ if (this_present_ouch3 || that_present_ouch3) {
+ if (!(this_present_ouch3 && that_present_ouch3))
+ return false;
+ if (!this.ouch3.equals(that.ouch3))
+ return false;
+ }
+
return true;
}
@@ -23730,6 +23799,16 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetOuch3()).compareTo(typedOther.isSetOuch3());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOuch3()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch3, typedOther.ouch3);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -23765,6 +23844,14 @@ import org.slf4j.LoggerFactory;
sb.append(this.ouch2);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("ouch3:");
+ if (this.ouch3 == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ouch3);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -23826,6 +23913,15 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 3: // OUCH3
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ouch3 = new TableNotFoundException();
+ struct.ouch3.read(iprot);
+ struct.setOuch3IsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -23851,6 +23947,11 @@ import org.slf4j.LoggerFactory;
struct.ouch2.write(oprot);
oprot.writeFieldEnd();
}
+ if (struct.ouch3 != null) {
+ oprot.writeFieldBegin(OUCH3_FIELD_DESC);
+ struct.ouch3.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -23875,19 +23976,25 @@ import org.slf4j.LoggerFactory;
if (struct.isSetOuch2()) {
optionals.set(1);
}
- oprot.writeBitSet(optionals, 2);
+ if (struct.isSetOuch3()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetOuch1()) {
struct.ouch1.write(oprot);
}
if (struct.isSetOuch2()) {
struct.ouch2.write(oprot);
}
+ if (struct.isSetOuch3()) {
+ struct.ouch3.write(oprot);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, flushTable_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
+ BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.ouch1 = new AccumuloException();
struct.ouch1.read(iprot);
@@ -23898,6 +24005,11 @@ import org.slf4j.LoggerFactory;
struct.ouch2.read(iprot);
struct.setOuch2IsSet(true);
}
+ if (incoming.get(2)) {
+ struct.ouch3 = new TableNotFoundException();
+ struct.ouch3.read(iprot);
+ struct.setOuch3IsSet(true);
+ }
}
}
@@ -68468,6 +68580,7 @@ import org.slf4j.LoggerFactory;
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)0);
private static final org.apache.thrift.protocol.TField OUCH1_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField OUCH2_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField OUCH3_FIELD_DESC = new org.apache.thrift.protocol.TField("ouch3", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -68478,12 +68591,14 @@ import org.slf4j.LoggerFactory;
public boolean success; // required
public AccumuloException ouch1; // required
public AccumuloSecurityException ouch2; // required
+ public TableNotFoundException ouch3; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
OUCH1((short)1, "ouch1"),
- OUCH2((short)2, "ouch2");
+ OUCH2((short)2, "ouch2"),
+ OUCH3((short)3, "ouch3");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -68504,6 +68619,8 @@ import org.slf4j.LoggerFactory;
return OUCH1;
case 2: // OUCH2
return OUCH2;
+ case 3: // OUCH3
+ return OUCH3;
default:
return null;
}
@@ -68555,6 +68672,8 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.OUCH2, new org.apache.thrift.meta_data.FieldMetaData("ouch2", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.OUCH3, new org.apache.thrift.meta_data.FieldMetaData("ouch3", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(hasTablePermission_result.class, metaDataMap);
}
@@ -68565,13 +68684,15 @@ import org.slf4j.LoggerFactory;
public hasTablePermission_result(
boolean success,
AccumuloException ouch1,
- AccumuloSecurityException ouch2)
+ AccumuloSecurityException ouch2,
+ TableNotFoundException ouch3)
{
this();
this.success = success;
setSuccessIsSet(true);
this.ouch1 = ouch1;
this.ouch2 = ouch2;
+ this.ouch3 = ouch3;
}
/**
@@ -68586,6 +68707,9 @@ import org.slf4j.LoggerFactory;
if (other.isSetOuch2()) {
this.ouch2 = new AccumuloSecurityException(other.ouch2);
}
+ if (other.isSetOuch3()) {
+ this.ouch3 = new TableNotFoundException(other.ouch3);
+ }
}
public hasTablePermission_result deepCopy() {
@@ -68598,6 +68722,7 @@ import org.slf4j.LoggerFactory;
this.success = false;
this.ouch1 = null;
this.ouch2 = null;
+ this.ouch3 = null;
}
public boolean isSuccess() {
@@ -68671,6 +68796,30 @@ import org.slf4j.LoggerFactory;
}
}
+ public TableNotFoundException getOuch3() {
+ return this.ouch3;
+ }
+
+ public hasTablePermission_result setOuch3(TableNotFoundException ouch3) {
+ this.ouch3 = ouch3;
+ return this;
+ }
+
+ public void unsetOuch3() {
+ this.ouch3 = null;
+ }
+
+ /** Returns true if field ouch3 is set (has been assigned a value) and false otherwise */
+ public boolean isSetOuch3() {
+ return this.ouch3 != null;
+ }
+
+ public void setOuch3IsSet(boolean value) {
+ if (!value) {
+ this.ouch3 = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
@@ -68697,6 +68846,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case OUCH3:
+ if (value == null) {
+ unsetOuch3();
+ } else {
+ setOuch3((TableNotFoundException)value);
+ }
+ break;
+
}
}
@@ -68711,6 +68868,9 @@ import org.slf4j.LoggerFactory;
case OUCH2:
return getOuch2();
+ case OUCH3:
+ return getOuch3();
+
}
throw new IllegalStateException();
}
@@ -68728,6 +68888,8 @@ import org.slf4j.LoggerFactory;
return isSetOuch1();
case OUCH2:
return isSetOuch2();
+ case OUCH3:
+ return isSetOuch3();
}
throw new IllegalStateException();
}
@@ -68772,6 +68934,15 @@ import org.slf4j.LoggerFactory;
return false;
}
+ boolean this_present_ouch3 = true && this.isSetOuch3();
+ boolean that_present_ouch3 = true && that.isSetOuch3();
+ if (this_present_ouch3 || that_present_ouch3) {
+ if (!(this_present_ouch3 && that_present_ouch3))
+ return false;
+ if (!this.ouch3.equals(that.ouch3))
+ return false;
+ }
+
return true;
}
@@ -68818,6 +68989,16 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetOuch3()).compareTo(typedOther.isSetOuch3());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOuch3()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ouch3, typedOther.ouch3);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -68857,6 +69038,14 @@ import org.slf4j.LoggerFactory;
sb.append(this.ouch2);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("ouch3:");
+ if (this.ouch3 == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ouch3);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -68928,6 +69117,15 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 3: // OUCH3
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ouch3 = new TableNotFoundException();
+ struct.ouch3.read(iprot);
+ struct.setOuch3IsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -68958,6 +69156,11 @@ import org.slf4j.LoggerFactory;
struct.ouch2.write(oprot);
oprot.writeFieldEnd();
}
+ if (struct.ouch3 != null) {
+ oprot.writeFieldBegin(OUCH3_FIELD_DESC);
+ struct.ouch3.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -68985,7 +69188,10 @@ import org.slf4j.LoggerFactory;
if (struct.isSetOuch2()) {
optionals.set(2);
}
- oprot.writeBitSet(optionals, 3);
+ if (struct.isSetOuch3()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
@@ -68995,12 +69201,15 @@ import org.slf4j.LoggerFactory;
if (struct.isSetOuch2()) {
struct.ouch2.write(oprot);
}
+ if (struct.isSetOuch3()) {
+ struct.ouch3.write(oprot);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, hasTablePermission_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
+ BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
@@ -69015,6 +69224,11 @@ import org.slf4j.LoggerFactory;
struct.ouch2.read(iprot);
struct.setOuch2IsSet(true);
}
+ if (incoming.get(3)) {
+ struct.ouch3 = new TableNotFoundException();
+ struct.ouch3.read(iprot);
+ struct.setOuch3IsSet(true);
+ }
}
}
Modified: accumulo/trunk/proxy/src/main/thrift/proxy.thrift
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/thrift/proxy.thrift?rev=1466186&r1=1466185&r2=1466186&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/thrift/proxy.thrift (original)
+++ accumulo/trunk/proxy/src/main/thrift/proxy.thrift Tue Apr 9 19:19:50 2013
@@ -256,7 +256,7 @@ service AccumuloProxy
void exportTable (1:binary login, 2:string tableName, 3:string exportDir) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
void flushTable (1:binary login, 2:string tableName, 3:binary startRow, 4:binary endRow,
5:bool wait)
- throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+ throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
map<string,set<string>> getLocalityGroups (1:binary login, 2:string tableName) throws (1:AccumuloException ouch1, 2:TableNotFoundException ouch2);
IteratorSetting getIteratorSetting (1:binary login, 2:string tableName,
3:string iteratorName, 4:IteratorScope scope)
@@ -309,7 +309,7 @@ service AccumuloProxy
void grantSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
void grantTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
bool hasSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
- bool hasTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
+ bool hasTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
set<string> listLocalUsers (1:binary login) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
void revokeSystemPermission (1:binary login, 2:string user, 3:SystemPermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2);
void revokeTablePermission (1:binary login, 2:string user, 3:string table, 4:TablePermission perm) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1466186&r1=1466185&r2=1466186&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Tue Apr 9 19:19:50 2013
@@ -18,6 +18,7 @@ package org.apache.accumulo.proxy;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileSKVWriter;
@@ -115,8 +116,191 @@ public class SimpleTest {
creds = client.login(principal, properties);
}
+
+ @Test(timeout = 10000)
+ public void tableNotFound() throws Exception {
+ final String doesNotExist = "doesNotExists";
+ try {
+ client.addConstraint(creds, doesNotExist, NumericValueConstraint.class.getName());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.addSplits(creds, doesNotExist, Collections.<ByteBuffer>emptySet());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ final IteratorSetting setting = new IteratorSetting(100, "slow", SlowIterator.class.getName(), Collections.singletonMap("sleepTime", "200"));
+ try {
+ client.attachIterator(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.cancelCompaction(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.checkIteratorConflicts(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.clearLocatorCache(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.cloneTable(creds, doesNotExist, TABLE_TEST, false, null, null);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.compactTable(creds, doesNotExist, null, null, null, true, false);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.createBatchScanner(creds, doesNotExist, new BatchScanOptions());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.createScanner(creds, doesNotExist, new ScanOptions());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.createWriter(creds, doesNotExist, new WriterOptions());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.deleteRows(creds, doesNotExist, null, null);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.deleteTable(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.exportTable(creds, doesNotExist, "/tmp");
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.flushTable(creds, doesNotExist, null, null, false);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.getIteratorSetting(creds, doesNotExist, "foo", IteratorScope.SCAN);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.getLocalityGroups(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.getMaxRow(creds, doesNotExist, Collections.<ByteBuffer>emptySet(), null, false, null, false);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.getTableProperties(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.grantTablePermission(creds, "root", doesNotExist, TablePermission.WRITE);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.hasTablePermission(creds, "root", doesNotExist, TablePermission.WRITE);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ File newFolder = folder.newFolder();
+ client.importDirectory(creds, doesNotExist, "/tmp", newFolder.getAbsolutePath(), true);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.listConstraints(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.listSplits(creds, doesNotExist, 10000);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.mergeTablets(creds, doesNotExist, null, null);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.offlineTable(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.onlineTable(creds, doesNotExist);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.removeConstraint(creds, doesNotExist, 0);
+ fail("exception not thrown");
+ } catch (AccumuloException ex) {
+ }
+ try {
+ client.removeIterator(creds, doesNotExist, "name", EnumSet.allOf(IteratorScope.class));
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.removeTableProperty(creds, doesNotExist, Property.TABLE_FILE_MAX.getKey());
+ fail("exception not thrown");
+ } catch (AccumuloException ex) {
+ }
+ try {
+ client.renameTable(creds, doesNotExist, "someTableName");
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.revokeTablePermission(creds, "root", doesNotExist, TablePermission.ALTER_TABLE);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.setTableProperty(creds, doesNotExist, Property.TABLE_FILE_MAX.getKey(), "0");
+ fail("exception not thrown");
+ } catch (AccumuloException ex) {
+ }
+ try {
+ client.splitRangeByTablets(creds, doesNotExist, client.getRowRange(ByteBuffer.wrap("row".getBytes())), 10);
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ try {
+ client.updateAndFlush(creds, doesNotExist, new HashMap<ByteBuffer,List<ColumnUpdate>>());
+ fail("exception not thrown");
+ } catch (TableNotFoundException ex) {
+ }
+ }
+
- @Test(timeout = 10000)
+ @Test(timeout = 10000)
public void testInstanceOperations() throws Exception {
int tservers = 0;
for (String tserver : client.getTabletServers(creds)) {