You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/10/24 22:00:54 UTC
git commit: ACCUMULO-1768 added synchronous offline and online table
to proxy
Updated Branches:
refs/heads/master ab6779c30 -> a5cf86094
ACCUMULO-1768 added synchronous offline and online table to proxy
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a5cf8609
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a5cf8609
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a5cf8609
Branch: refs/heads/master
Commit: a5cf860948a2c6cd36a5a2c94b6cd9d22a6b40c4
Parents: ab6779c
Author: Keith Turner <kt...@apache.org>
Authored: Thu Oct 24 15:49:02 2013 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Thu Oct 24 15:53:48 2013 -0400
----------------------------------------------------------------------
.../org/apache/accumulo/proxy/ProxyServer.java | 8 +-
.../accumulo/proxy/thrift/AccumuloProxy.java | 260 +++++++++++++++++--
proxy/src/main/thrift/proxy.thrift | 27 +-
.../org/apache/accumulo/proxy/SimpleTest.java | 10 +-
4 files changed, 268 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/a5cf8609/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
index ee993b9..c92f73b 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
@@ -518,20 +518,20 @@ public class ProxyServer implements AccumuloProxy.Iface {
}
@Override
- public void offlineTable(ByteBuffer login, String tableName) throws org.apache.accumulo.proxy.thrift.AccumuloException,
+ public void offlineTable(ByteBuffer login, String tableName, boolean wait) throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
try {
- getConnector(login).tableOperations().offline(tableName);
+ getConnector(login).tableOperations().offline(tableName, wait);
} catch (Exception e) {
handleExceptionTNF(e);
}
}
@Override
- public void onlineTable(ByteBuffer login, String tableName) throws org.apache.accumulo.proxy.thrift.AccumuloException,
+ public void onlineTable(ByteBuffer login, String tableName, boolean wait) throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, org.apache.accumulo.proxy.thrift.TableNotFoundException, TException {
try {
- getConnector(login).tableOperations().online(tableName);
+ getConnector(login).tableOperations().online(tableName, wait);
} catch (Exception e) {
handleExceptionTNF(e);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/a5cf8609/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
index ca9c415..39b287b 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/AccumuloProxy.java
@@ -102,9 +102,9 @@ import org.slf4j.LoggerFactory;
public void mergeTablets(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
- public void offlineTable(ByteBuffer login, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
+ public void offlineTable(ByteBuffer login, String tableName, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
- public void onlineTable(ByteBuffer login, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
+ public void onlineTable(ByteBuffer login, String tableName, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
public void removeConstraint(ByteBuffer login, String tableName, int constraint) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException;
@@ -260,9 +260,9 @@ import org.slf4j.LoggerFactory;
public void mergeTablets(ByteBuffer login, String tableName, ByteBuffer startRow, ByteBuffer endRow, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.mergeTablets_call> resultHandler) throws org.apache.thrift.TException;
- public void offlineTable(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.offlineTable_call> resultHandler) throws org.apache.thrift.TException;
+ public void offlineTable(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.offlineTable_call> resultHandler) throws org.apache.thrift.TException;
- public void onlineTable(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.onlineTable_call> resultHandler) throws org.apache.thrift.TException;
+ public void onlineTable(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.onlineTable_call> resultHandler) throws org.apache.thrift.TException;
public void removeConstraint(ByteBuffer login, String tableName, int constraint, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeConstraint_call> resultHandler) throws org.apache.thrift.TException;
@@ -1215,17 +1215,18 @@ import org.slf4j.LoggerFactory;
return;
}
- public void offlineTable(ByteBuffer login, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
+ public void offlineTable(ByteBuffer login, String tableName, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
- send_offlineTable(login, tableName);
+ send_offlineTable(login, tableName, wait);
recv_offlineTable();
}
- public void send_offlineTable(ByteBuffer login, String tableName) throws org.apache.thrift.TException
+ public void send_offlineTable(ByteBuffer login, String tableName, boolean wait) throws org.apache.thrift.TException
{
offlineTable_args args = new offlineTable_args();
args.setLogin(login);
args.setTableName(tableName);
+ args.setWait(wait);
sendBase("offlineTable", args);
}
@@ -1245,17 +1246,18 @@ import org.slf4j.LoggerFactory;
return;
}
- public void onlineTable(ByteBuffer login, String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
+ public void onlineTable(ByteBuffer login, String tableName, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, org.apache.thrift.TException
{
- send_onlineTable(login, tableName);
+ send_onlineTable(login, tableName, wait);
recv_onlineTable();
}
- public void send_onlineTable(ByteBuffer login, String tableName) throws org.apache.thrift.TException
+ public void send_onlineTable(ByteBuffer login, String tableName, boolean wait) throws org.apache.thrift.TException
{
onlineTable_args args = new onlineTable_args();
args.setLogin(login);
args.setTableName(tableName);
+ args.setWait(wait);
sendBase("onlineTable", args);
}
@@ -3747,9 +3749,9 @@ import org.slf4j.LoggerFactory;
}
}
- public void offlineTable(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<offlineTable_call> resultHandler) throws org.apache.thrift.TException {
+ public void offlineTable(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<offlineTable_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
- offlineTable_call method_call = new offlineTable_call(login, tableName, resultHandler, this, ___protocolFactory, ___transport);
+ offlineTable_call method_call = new offlineTable_call(login, tableName, wait, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -3757,10 +3759,12 @@ import org.slf4j.LoggerFactory;
public static class offlineTable_call extends org.apache.thrift.async.TAsyncMethodCall {
private ByteBuffer login;
private String tableName;
- public offlineTable_call(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<offlineTable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private boolean wait;
+ public offlineTable_call(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<offlineTable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.login = login;
this.tableName = tableName;
+ this.wait = wait;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -3768,6 +3772,7 @@ import org.slf4j.LoggerFactory;
offlineTable_args args = new offlineTable_args();
args.setLogin(login);
args.setTableName(tableName);
+ args.setWait(wait);
args.write(prot);
prot.writeMessageEnd();
}
@@ -3782,9 +3787,9 @@ import org.slf4j.LoggerFactory;
}
}
- public void onlineTable(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<onlineTable_call> resultHandler) throws org.apache.thrift.TException {
+ public void onlineTable(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<onlineTable_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
- onlineTable_call method_call = new onlineTable_call(login, tableName, resultHandler, this, ___protocolFactory, ___transport);
+ onlineTable_call method_call = new onlineTable_call(login, tableName, wait, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
@@ -3792,10 +3797,12 @@ import org.slf4j.LoggerFactory;
public static class onlineTable_call extends org.apache.thrift.async.TAsyncMethodCall {
private ByteBuffer login;
private String tableName;
- public onlineTable_call(ByteBuffer login, String tableName, org.apache.thrift.async.AsyncMethodCallback<onlineTable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ private boolean wait;
+ public onlineTable_call(ByteBuffer login, String tableName, boolean wait, org.apache.thrift.async.AsyncMethodCallback<onlineTable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.login = login;
this.tableName = tableName;
+ this.wait = wait;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -3803,6 +3810,7 @@ import org.slf4j.LoggerFactory;
onlineTable_args args = new onlineTable_args();
args.setLogin(login);
args.setTableName(tableName);
+ args.setWait(wait);
args.write(prot);
prot.writeMessageEnd();
}
@@ -6421,7 +6429,7 @@ import org.slf4j.LoggerFactory;
public offlineTable_result getResult(I iface, offlineTable_args args) throws org.apache.thrift.TException {
offlineTable_result result = new offlineTable_result();
try {
- iface.offlineTable(args.login, args.tableName);
+ iface.offlineTable(args.login, args.tableName, args.wait);
} catch (AccumuloException ouch1) {
result.ouch1 = ouch1;
} catch (AccumuloSecurityException ouch2) {
@@ -6449,7 +6457,7 @@ import org.slf4j.LoggerFactory;
public onlineTable_result getResult(I iface, onlineTable_args args) throws org.apache.thrift.TException {
onlineTable_result result = new onlineTable_result();
try {
- iface.onlineTable(args.login, args.tableName);
+ iface.onlineTable(args.login, args.tableName, args.wait);
} catch (AccumuloException ouch1) {
result.ouch1 = ouch1;
} catch (AccumuloSecurityException ouch2) {
@@ -39608,6 +39616,7 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField WAIT_FIELD_DESC = new org.apache.thrift.protocol.TField("wait", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -39617,11 +39626,13 @@ import org.slf4j.LoggerFactory;
public ByteBuffer login; // required
public String tableName; // required
+ public boolean wait; // 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 {
LOGIN((short)1, "login"),
- TABLE_NAME((short)2, "tableName");
+ TABLE_NAME((short)2, "tableName"),
+ WAIT((short)3, "wait");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -39640,6 +39651,8 @@ import org.slf4j.LoggerFactory;
return LOGIN;
case 2: // TABLE_NAME
return TABLE_NAME;
+ case 3: // WAIT
+ return WAIT;
default:
return null;
}
@@ -39680,6 +39693,8 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
+ private static final int __WAIT_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);
@@ -39687,26 +39702,34 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.WAIT, new org.apache.thrift.meta_data.FieldMetaData("wait", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(offlineTable_args.class, metaDataMap);
}
public offlineTable_args() {
+ this.wait = false;
+
}
public offlineTable_args(
ByteBuffer login,
- String tableName)
+ String tableName,
+ boolean wait)
{
this();
this.login = login;
this.tableName = tableName;
+ this.wait = wait;
+ setWaitIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public offlineTable_args(offlineTable_args other) {
+ __isset_bitfield = other.__isset_bitfield;
if (other.isSetLogin()) {
this.login = org.apache.thrift.TBaseHelper.copyBinary(other.login);
;
@@ -39714,6 +39737,7 @@ import org.slf4j.LoggerFactory;
if (other.isSetTableName()) {
this.tableName = other.tableName;
}
+ this.wait = other.wait;
}
public offlineTable_args deepCopy() {
@@ -39724,6 +39748,8 @@ import org.slf4j.LoggerFactory;
public void clear() {
this.login = null;
this.tableName = null;
+ this.wait = false;
+
}
public byte[] getLogin() {
@@ -39784,6 +39810,29 @@ import org.slf4j.LoggerFactory;
}
}
+ public boolean isWait() {
+ return this.wait;
+ }
+
+ public offlineTable_args setWait(boolean wait) {
+ this.wait = wait;
+ setWaitIsSet(true);
+ return this;
+ }
+
+ public void unsetWait() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAIT_ISSET_ID);
+ }
+
+ /** Returns true if field wait is set (has been assigned a value) and false otherwise */
+ public boolean isSetWait() {
+ return EncodingUtils.testBit(__isset_bitfield, __WAIT_ISSET_ID);
+ }
+
+ public void setWaitIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAIT_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case LOGIN:
@@ -39802,6 +39851,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case WAIT:
+ if (value == null) {
+ unsetWait();
+ } else {
+ setWait((Boolean)value);
+ }
+ break;
+
}
}
@@ -39813,6 +39870,9 @@ import org.slf4j.LoggerFactory;
case TABLE_NAME:
return getTableName();
+ case WAIT:
+ return Boolean.valueOf(isWait());
+
}
throw new IllegalStateException();
}
@@ -39828,6 +39888,8 @@ import org.slf4j.LoggerFactory;
return isSetLogin();
case TABLE_NAME:
return isSetTableName();
+ case WAIT:
+ return isSetWait();
}
throw new IllegalStateException();
}
@@ -39863,6 +39925,15 @@ import org.slf4j.LoggerFactory;
return false;
}
+ boolean this_present_wait = true;
+ boolean that_present_wait = true;
+ if (this_present_wait || that_present_wait) {
+ if (!(this_present_wait && that_present_wait))
+ return false;
+ if (this.wait != that.wait)
+ return false;
+ }
+
return true;
}
@@ -39899,6 +39970,16 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetWait()).compareTo(typedOther.isSetWait());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWait()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait, typedOther.wait);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -39934,6 +40015,10 @@ import org.slf4j.LoggerFactory;
sb.append(this.tableName);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("wait:");
+ sb.append(this.wait);
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -39953,6 +40038,8 @@ import org.slf4j.LoggerFactory;
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);
@@ -39993,6 +40080,14 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 3: // WAIT
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.wait = iprot.readBool();
+ struct.setWaitIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -40018,6 +40113,9 @@ import org.slf4j.LoggerFactory;
oprot.writeString(struct.tableName);
oprot.writeFieldEnd();
}
+ oprot.writeFieldBegin(WAIT_FIELD_DESC);
+ oprot.writeBool(struct.wait);
+ oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -40042,19 +40140,25 @@ import org.slf4j.LoggerFactory;
if (struct.isSetTableName()) {
optionals.set(1);
}
- oprot.writeBitSet(optionals, 2);
+ if (struct.isSetWait()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetLogin()) {
oprot.writeBinary(struct.login);
}
if (struct.isSetTableName()) {
oprot.writeString(struct.tableName);
}
+ if (struct.isSetWait()) {
+ oprot.writeBool(struct.wait);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, offlineTable_args 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.login = iprot.readBinary();
struct.setLoginIsSet(true);
@@ -40063,6 +40167,10 @@ import org.slf4j.LoggerFactory;
struct.tableName = iprot.readString();
struct.setTableNameIsSet(true);
}
+ if (incoming.get(2)) {
+ struct.wait = iprot.readBool();
+ struct.setWaitIsSet(true);
+ }
}
}
@@ -40633,6 +40741,7 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField WAIT_FIELD_DESC = new org.apache.thrift.protocol.TField("wait", org.apache.thrift.protocol.TType.BOOL, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -40642,11 +40751,13 @@ import org.slf4j.LoggerFactory;
public ByteBuffer login; // required
public String tableName; // required
+ public boolean wait; // 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 {
LOGIN((short)1, "login"),
- TABLE_NAME((short)2, "tableName");
+ TABLE_NAME((short)2, "tableName"),
+ WAIT((short)3, "wait");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -40665,6 +40776,8 @@ import org.slf4j.LoggerFactory;
return LOGIN;
case 2: // TABLE_NAME
return TABLE_NAME;
+ case 3: // WAIT
+ return WAIT;
default:
return null;
}
@@ -40705,6 +40818,8 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
+ private static final int __WAIT_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);
@@ -40712,26 +40827,34 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.WAIT, new org.apache.thrift.meta_data.FieldMetaData("wait", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onlineTable_args.class, metaDataMap);
}
public onlineTable_args() {
+ this.wait = false;
+
}
public onlineTable_args(
ByteBuffer login,
- String tableName)
+ String tableName,
+ boolean wait)
{
this();
this.login = login;
this.tableName = tableName;
+ this.wait = wait;
+ setWaitIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public onlineTable_args(onlineTable_args other) {
+ __isset_bitfield = other.__isset_bitfield;
if (other.isSetLogin()) {
this.login = org.apache.thrift.TBaseHelper.copyBinary(other.login);
;
@@ -40739,6 +40862,7 @@ import org.slf4j.LoggerFactory;
if (other.isSetTableName()) {
this.tableName = other.tableName;
}
+ this.wait = other.wait;
}
public onlineTable_args deepCopy() {
@@ -40749,6 +40873,8 @@ import org.slf4j.LoggerFactory;
public void clear() {
this.login = null;
this.tableName = null;
+ this.wait = false;
+
}
public byte[] getLogin() {
@@ -40809,6 +40935,29 @@ import org.slf4j.LoggerFactory;
}
}
+ public boolean isWait() {
+ return this.wait;
+ }
+
+ public onlineTable_args setWait(boolean wait) {
+ this.wait = wait;
+ setWaitIsSet(true);
+ return this;
+ }
+
+ public void unsetWait() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAIT_ISSET_ID);
+ }
+
+ /** Returns true if field wait is set (has been assigned a value) and false otherwise */
+ public boolean isSetWait() {
+ return EncodingUtils.testBit(__isset_bitfield, __WAIT_ISSET_ID);
+ }
+
+ public void setWaitIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAIT_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case LOGIN:
@@ -40827,6 +40976,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case WAIT:
+ if (value == null) {
+ unsetWait();
+ } else {
+ setWait((Boolean)value);
+ }
+ break;
+
}
}
@@ -40838,6 +40995,9 @@ import org.slf4j.LoggerFactory;
case TABLE_NAME:
return getTableName();
+ case WAIT:
+ return Boolean.valueOf(isWait());
+
}
throw new IllegalStateException();
}
@@ -40853,6 +41013,8 @@ import org.slf4j.LoggerFactory;
return isSetLogin();
case TABLE_NAME:
return isSetTableName();
+ case WAIT:
+ return isSetWait();
}
throw new IllegalStateException();
}
@@ -40888,6 +41050,15 @@ import org.slf4j.LoggerFactory;
return false;
}
+ boolean this_present_wait = true;
+ boolean that_present_wait = true;
+ if (this_present_wait || that_present_wait) {
+ if (!(this_present_wait && that_present_wait))
+ return false;
+ if (this.wait != that.wait)
+ return false;
+ }
+
return true;
}
@@ -40924,6 +41095,16 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetWait()).compareTo(typedOther.isSetWait());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWait()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait, typedOther.wait);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -40959,6 +41140,10 @@ import org.slf4j.LoggerFactory;
sb.append(this.tableName);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("wait:");
+ sb.append(this.wait);
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -40978,6 +41163,8 @@ import org.slf4j.LoggerFactory;
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);
@@ -41018,6 +41205,14 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 3: // WAIT
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.wait = iprot.readBool();
+ struct.setWaitIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -41043,6 +41238,9 @@ import org.slf4j.LoggerFactory;
oprot.writeString(struct.tableName);
oprot.writeFieldEnd();
}
+ oprot.writeFieldBegin(WAIT_FIELD_DESC);
+ oprot.writeBool(struct.wait);
+ oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -41067,19 +41265,25 @@ import org.slf4j.LoggerFactory;
if (struct.isSetTableName()) {
optionals.set(1);
}
- oprot.writeBitSet(optionals, 2);
+ if (struct.isSetWait()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
if (struct.isSetLogin()) {
oprot.writeBinary(struct.login);
}
if (struct.isSetTableName()) {
oprot.writeString(struct.tableName);
}
+ if (struct.isSetWait()) {
+ oprot.writeBool(struct.wait);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, onlineTable_args 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.login = iprot.readBinary();
struct.setLoginIsSet(true);
@@ -41088,6 +41292,10 @@ import org.slf4j.LoggerFactory;
struct.tableName = iprot.readString();
struct.setTableNameIsSet(true);
}
+ if (incoming.get(2)) {
+ struct.wait = iprot.readBool();
+ struct.setWaitIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/a5cf8609/proxy/src/main/thrift/proxy.thrift
----------------------------------------------------------------------
diff --git a/proxy/src/main/thrift/proxy.thrift b/proxy/src/main/thrift/proxy.thrift
index bc83232..aabaa5e 100644
--- a/proxy/src/main/thrift/proxy.thrift
+++ b/proxy/src/main/thrift/proxy.thrift
@@ -14,6 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/*
+ * Compatibility.
+ *
+ * Its possible that over time that this IDL may change in ways that breaks
+ * client code. However newer versions of the proxy server will use thrift
+ * mechanisms to maintain compatibility with older versions of the proxy IDL.
+ * So proxy clients using 1.4.x or 1.5.x IDL can use a 1.6.x proxy server.
+ * Therefore if changes to this IDL break your client code, then using an older
+ * version of the IDL with a new version of the proxy server is an option.
+ */
+
namespace cpp accumulo
namespace java org.apache.accumulo.proxy.thrift
@@ -43,6 +55,7 @@ struct ColumnUpdate {
6:optional bool deleteCell
}
+//since 1.6.0
struct DiskUsage {
1:list<string> tables,
2:i64 usage
@@ -141,6 +154,7 @@ struct Column {
3:binary colVisibility;
}
+//since 1.6.0
struct Condition {
1:Column column;
2:optional i64 timestamp;
@@ -148,11 +162,13 @@ struct Condition {
4:optional list<IteratorSetting> iterators;
}
+//since 1.6.0
struct ConditionalUpdates {
2:list<Condition> conditions
3:list<ColumnUpdate> updates
}
+//since 1.6.0
enum ConditionalStatus {
ACCEPTED,
REJECTED,
@@ -161,6 +177,7 @@ enum ConditionalStatus {
INVISIBLE_VISIBILITY
}
+//since 1.6.0
struct ConditionalWriterOptions {
1:optional i64 maxMemory
2:optional i64 timeoutMs
@@ -289,6 +306,7 @@ service AccumuloProxy
void flushTable (1:binary login, 2:string tableName, 3:binary startRow, 4:binary endRow,
5:bool wait)
throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+ //since 1.6.0
list<DiskUsage> getDiskUsage(1:binary login, 2:set<string> tables) 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:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
IteratorSetting getIteratorSetting (1:binary login, 2:string tableName,
@@ -307,8 +325,10 @@ service AccumuloProxy
map<string,set<IteratorScope>> listIterators (1:binary login, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
map<string,i32> listConstraints (1:binary login, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
void mergeTablets (1:binary login, 2:string tableName, 3:binary startRow, 4:binary endRow) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
- void offlineTable (1:binary login, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
- void onlineTable (1:binary login, 2:string tableName) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+ //changed in 1.6.0, see comment at top about compatibility
+ void offlineTable (1:binary login, 2:string tableName, 3:bool wait=false) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+ //changed in 1.6.0, see comment at top about compatibility
+ void onlineTable (1:binary login, 2:string tableName, 3:bool wait=false) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
void removeConstraint (1:binary login, 2:string tableName, 3:i32 constraint) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
void removeIterator (1:binary login, 2:string tableName, 3:string iterName,
4:set<IteratorScope> scopes)
@@ -373,10 +393,13 @@ service AccumuloProxy
4:ConditionalUpdates updates) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
//api for batch conditional updates
+ //since 1.6.0
string createConditionalWriter(1:binary login, 2:string tableName,
3:ConditionalWriterOptions options) throws (1:AccumuloException ouch1, 2:AccumuloSecurityException ouch2, 3:TableNotFoundException ouch3);
+ //since 1.6.0
map<binary, ConditionalStatus> updateRowsConditionally(1:string conditionalWriter,
2:map<binary, ConditionalUpdates> updates) throws (1:UnknownWriter ouch1, 2:AccumuloException ouch2, 3:AccumuloSecurityException ouch3);
+ //since 1.6.0
void closeConditionalWriter(1:string conditionalWriter);
// utilities
http://git-wip-us.apache.org/repos/asf/accumulo/blob/a5cf8609/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
----------------------------------------------------------------------
diff --git a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
index 8b1ab8b..d49cce8 100644
--- a/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
+++ b/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
@@ -257,11 +257,11 @@ public class SimpleTest {
fail("exception not thrown");
} catch (AccumuloSecurityException ex) {}
try {
- client.offlineTable(badLogin, table);
+ client.offlineTable(badLogin, table, false);
fail("exception not thrown");
} catch (AccumuloSecurityException ex) {}
try {
- client.onlineTable(badLogin, table);
+ client.onlineTable(badLogin, table, false);
fail("exception not thrown");
} catch (AccumuloSecurityException ex) {}
try {
@@ -559,11 +559,11 @@ public class SimpleTest {
fail("exception not thrown");
} catch (TableNotFoundException ex) {}
try {
- client.offlineTable(creds, doesNotExist);
+ client.offlineTable(creds, doesNotExist, false);
fail("exception not thrown");
} catch (TableNotFoundException ex) {}
try {
- client.onlineTable(creds, doesNotExist);
+ client.onlineTable(creds, doesNotExist, false);
fail("exception not thrown");
} catch (TableNotFoundException ex) {}
try {
@@ -1079,7 +1079,7 @@ public class SimpleTest {
// export/import
String dir = folder.getRoot() + "/test";
String destDir = folder.getRoot() + "/test_dest";
- client.offlineTable(creds, TABLE_TEST);
+ client.offlineTable(creds, TABLE_TEST, false);
client.exportTable(creds, TABLE_TEST, dir);
// copy files to a new location
FileSystem fs = FileSystem.get(new Configuration());