You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/07/13 22:34:49 UTC
svn commit: r1361382 [5/16] - in /accumulo/branches/ACCUMULO-259: ./ bin/
conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/
conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/
conf/examples/3GB/native-standalone/ conf/ex...
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.data.thrift;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -28,10 +35,16 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)3);
private static final org.apache.thrift.protocol.TField ENTRIES_FIELD_DESC = new org.apache.thrift.protocol.TField("entries", org.apache.thrift.protocol.TType.I32, (short)4);
- public ByteBuffer row;
- public ByteBuffer data;
- public List<ByteBuffer> values;
- public int entries;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TMutationStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TMutationTupleSchemeFactory());
+ }
+
+ public ByteBuffer row; // required
+ public ByteBuffer data; // required
+ public List<ByteBuffer> values; // required
+ public int entries; // 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 {
@@ -103,7 +116,6 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __ENTRIES_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
-
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);
@@ -355,7 +367,7 @@ import org.slf4j.LoggerFactory;
return getValues();
case ENTRIES:
- return new Integer(getEntries());
+ return Integer.valueOf(getEntries());
}
throw new IllegalStateException();
@@ -493,96 +505,11 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // ROW
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.row = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // DATA
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.data = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // VALUES
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- this.values = new ArrayList<ByteBuffer>(_list0.size);
- for (int _i1 = 0; _i1 < _list0.size; ++_i1)
- {
- ByteBuffer _elem2;
- _elem2 = iprot.readBinary();
- this.values.add(_elem2);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // ENTRIES
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.entries = iprot.readI32();
- setEntriesIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.row != null) {
- oprot.writeFieldBegin(ROW_FIELD_DESC);
- oprot.writeBinary(this.row);
- oprot.writeFieldEnd();
- }
- if (this.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- oprot.writeBinary(this.data);
- oprot.writeFieldEnd();
- }
- if (this.values != null) {
- oprot.writeFieldBegin(VALUES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.values.size()));
- for (ByteBuffer _iter3 : this.values)
- {
- oprot.writeBinary(_iter3);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(ENTRIES_FIELD_DESC);
- oprot.writeI32(this.entries);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -643,5 +570,188 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TMutationStandardSchemeFactory implements SchemeFactory {
+ public TMutationStandardScheme getScheme() {
+ return new TMutationStandardScheme();
+ }
+ }
+
+ private static class TMutationStandardScheme extends StandardScheme<TMutation> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TMutation struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // DATA
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.data = iprot.readBinary();
+ struct.setDataIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // VALUES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ struct.values = new ArrayList<ByteBuffer>(_list0.size);
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1)
+ {
+ ByteBuffer _elem2; // required
+ _elem2 = iprot.readBinary();
+ struct.values.add(_elem2);
+ }
+ iprot.readListEnd();
+ }
+ struct.setValuesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ENTRIES
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.entries = iprot.readI32();
+ struct.setEntriesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TMutation struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.row != null) {
+ oprot.writeFieldBegin(ROW_FIELD_DESC);
+ oprot.writeBinary(struct.row);
+ oprot.writeFieldEnd();
+ }
+ if (struct.data != null) {
+ oprot.writeFieldBegin(DATA_FIELD_DESC);
+ oprot.writeBinary(struct.data);
+ oprot.writeFieldEnd();
+ }
+ if (struct.values != null) {
+ oprot.writeFieldBegin(VALUES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size()));
+ for (ByteBuffer _iter3 : struct.values)
+ {
+ oprot.writeBinary(_iter3);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(ENTRIES_FIELD_DESC);
+ oprot.writeI32(struct.entries);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TMutationTupleSchemeFactory implements SchemeFactory {
+ public TMutationTupleScheme getScheme() {
+ return new TMutationTupleScheme();
+ }
+ }
+
+ private static class TMutationTupleScheme extends TupleScheme<TMutation> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TMutation struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetRow()) {
+ optionals.set(0);
+ }
+ if (struct.isSetData()) {
+ optionals.set(1);
+ }
+ if (struct.isSetValues()) {
+ optionals.set(2);
+ }
+ if (struct.isSetEntries()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetRow()) {
+ oprot.writeBinary(struct.row);
+ }
+ if (struct.isSetData()) {
+ oprot.writeBinary(struct.data);
+ }
+ if (struct.isSetValues()) {
+ {
+ oprot.writeI32(struct.values.size());
+ for (ByteBuffer _iter4 : struct.values)
+ {
+ oprot.writeBinary(_iter4);
+ }
+ }
+ }
+ if (struct.isSetEntries()) {
+ oprot.writeI32(struct.entries);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TMutation struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.data = iprot.readBinary();
+ struct.setDataIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.values = new ArrayList<ByteBuffer>(_list5.size);
+ for (int _i6 = 0; _i6 < _list5.size; ++_i6)
+ {
+ ByteBuffer _elem7; // required
+ _elem7 = iprot.readBinary();
+ struct.values.add(_elem7);
+ }
+ }
+ struct.setValuesIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.entries = iprot.readI32();
+ struct.setEntriesIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.data.thrift;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -30,12 +37,18 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField INFINITE_START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStartKey", org.apache.thrift.protocol.TType.BOOL, (short)5);
private static final org.apache.thrift.protocol.TField INFINITE_STOP_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStopKey", org.apache.thrift.protocol.TType.BOOL, (short)6);
- public TKey start;
- public TKey stop;
- public boolean startKeyInclusive;
- public boolean stopKeyInclusive;
- public boolean infiniteStartKey;
- public boolean infiniteStopKey;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TRangeStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TRangeTupleSchemeFactory());
+ }
+
+ public TKey start; // required
+ public TKey stop; // required
+ public boolean startKeyInclusive; // required
+ public boolean stopKeyInclusive; // required
+ public boolean infiniteStartKey; // required
+ public boolean infiniteStopKey; // 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 {
@@ -116,7 +129,6 @@ import org.slf4j.LoggerFactory;
private static final int __INFINITESTARTKEY_ISSET_ID = 2;
private static final int __INFINITESTOPKEY_ISSET_ID = 3;
private BitSet __isset_bit_vector = new BitSet(4);
-
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);
@@ -398,16 +410,16 @@ import org.slf4j.LoggerFactory;
return getStop();
case START_KEY_INCLUSIVE:
- return new Boolean(isStartKeyInclusive());
+ return Boolean.valueOf(isStartKeyInclusive());
case STOP_KEY_INCLUSIVE:
- return new Boolean(isStopKeyInclusive());
+ return Boolean.valueOf(isStopKeyInclusive());
case INFINITE_START_KEY:
- return new Boolean(isInfiniteStartKey());
+ return Boolean.valueOf(isInfiniteStartKey());
case INFINITE_STOP_KEY:
- return new Boolean(isInfiniteStopKey());
+ return Boolean.valueOf(isInfiniteStopKey());
}
throw new IllegalStateException();
@@ -587,102 +599,11 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // START
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.start = new TKey();
- this.start.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // STOP
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.stop = new TKey();
- this.stop.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // START_KEY_INCLUSIVE
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.startKeyInclusive = iprot.readBool();
- setStartKeyInclusiveIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // STOP_KEY_INCLUSIVE
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.stopKeyInclusive = iprot.readBool();
- setStopKeyInclusiveIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // INFINITE_START_KEY
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.infiniteStartKey = iprot.readBool();
- setInfiniteStartKeyIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 6: // INFINITE_STOP_KEY
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.infiniteStopKey = iprot.readBool();
- setInfiniteStopKeyIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.start != null) {
- oprot.writeFieldBegin(START_FIELD_DESC);
- this.start.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.stop != null) {
- oprot.writeFieldBegin(STOP_FIELD_DESC);
- this.stop.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(START_KEY_INCLUSIVE_FIELD_DESC);
- oprot.writeBool(this.startKeyInclusive);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(STOP_KEY_INCLUSIVE_FIELD_DESC);
- oprot.writeBool(this.stopKeyInclusive);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(INFINITE_START_KEY_FIELD_DESC);
- oprot.writeBool(this.infiniteStartKey);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(INFINITE_STOP_KEY_FIELD_DESC);
- oprot.writeBool(this.infiniteStopKey);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -747,5 +668,200 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TRangeStandardSchemeFactory implements SchemeFactory {
+ public TRangeStandardScheme getScheme() {
+ return new TRangeStandardScheme();
+ }
+ }
+
+ private static class TRangeStandardScheme extends StandardScheme<TRange> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TRange struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // START
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.start = new TKey();
+ struct.start.read(iprot);
+ struct.setStartIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // STOP
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.stop = new TKey();
+ struct.stop.read(iprot);
+ struct.setStopIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // START_KEY_INCLUSIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.startKeyInclusive = iprot.readBool();
+ struct.setStartKeyInclusiveIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // STOP_KEY_INCLUSIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.stopKeyInclusive = iprot.readBool();
+ struct.setStopKeyInclusiveIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // INFINITE_START_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.infiniteStartKey = iprot.readBool();
+ struct.setInfiniteStartKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // INFINITE_STOP_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.infiniteStopKey = iprot.readBool();
+ struct.setInfiniteStopKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TRange struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.start != null) {
+ oprot.writeFieldBegin(START_FIELD_DESC);
+ struct.start.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.stop != null) {
+ oprot.writeFieldBegin(STOP_FIELD_DESC);
+ struct.stop.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(START_KEY_INCLUSIVE_FIELD_DESC);
+ oprot.writeBool(struct.startKeyInclusive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(STOP_KEY_INCLUSIVE_FIELD_DESC);
+ oprot.writeBool(struct.stopKeyInclusive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(INFINITE_START_KEY_FIELD_DESC);
+ oprot.writeBool(struct.infiniteStartKey);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(INFINITE_STOP_KEY_FIELD_DESC);
+ oprot.writeBool(struct.infiniteStopKey);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TRangeTupleSchemeFactory implements SchemeFactory {
+ public TRangeTupleScheme getScheme() {
+ return new TRangeTupleScheme();
+ }
+ }
+
+ private static class TRangeTupleScheme extends TupleScheme<TRange> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetStart()) {
+ optionals.set(0);
+ }
+ if (struct.isSetStop()) {
+ optionals.set(1);
+ }
+ if (struct.isSetStartKeyInclusive()) {
+ optionals.set(2);
+ }
+ if (struct.isSetStopKeyInclusive()) {
+ optionals.set(3);
+ }
+ if (struct.isSetInfiniteStartKey()) {
+ optionals.set(4);
+ }
+ if (struct.isSetInfiniteStopKey()) {
+ optionals.set(5);
+ }
+ oprot.writeBitSet(optionals, 6);
+ if (struct.isSetStart()) {
+ struct.start.write(oprot);
+ }
+ if (struct.isSetStop()) {
+ struct.stop.write(oprot);
+ }
+ if (struct.isSetStartKeyInclusive()) {
+ oprot.writeBool(struct.startKeyInclusive);
+ }
+ if (struct.isSetStopKeyInclusive()) {
+ oprot.writeBool(struct.stopKeyInclusive);
+ }
+ if (struct.isSetInfiniteStartKey()) {
+ oprot.writeBool(struct.infiniteStartKey);
+ }
+ if (struct.isSetInfiniteStopKey()) {
+ oprot.writeBool(struct.infiniteStopKey);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(6);
+ if (incoming.get(0)) {
+ struct.start = new TKey();
+ struct.start.read(iprot);
+ struct.setStartIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.stop = new TKey();
+ struct.stop.read(iprot);
+ struct.setStopIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.startKeyInclusive = iprot.readBool();
+ struct.setStartKeyInclusiveIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.stopKeyInclusive = iprot.readBool();
+ struct.setStopKeyInclusiveIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.infiniteStartKey = iprot.readBool();
+ struct.setInfiniteStartKeyIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.infiniteStopKey = iprot.readBool();
+ struct.setInfiniteStopKeyIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.data.thrift;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -27,9 +34,15 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField VIOLATION_SUMMARIES_FIELD_DESC = new org.apache.thrift.protocol.TField("violationSummaries", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField AUTHORIZATION_FAILURES_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizationFailures", org.apache.thrift.protocol.TType.LIST, (short)3);
- public Map<TKeyExtent,Long> failedExtents;
- public List<TConstraintViolationSummary> violationSummaries;
- public List<TKeyExtent> authorizationFailures;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new UpdateErrorsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new UpdateErrorsTupleSchemeFactory());
+ }
+
+ public Map<TKeyExtent,Long> failedExtents; // required
+ public List<TConstraintViolationSummary> violationSummaries; // required
+ public List<TKeyExtent> authorizationFailures; // 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 {
@@ -96,7 +109,6 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
-
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -442,125 +454,11 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // FAILED_EXTENTS
- if (field.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map25 = iprot.readMapBegin();
- this.failedExtents = new HashMap<TKeyExtent,Long>(2*_map25.size);
- for (int _i26 = 0; _i26 < _map25.size; ++_i26)
- {
- TKeyExtent _key27;
- long _val28;
- _key27 = new TKeyExtent();
- _key27.read(iprot);
- _val28 = iprot.readI64();
- this.failedExtents.put(_key27, _val28);
- }
- iprot.readMapEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // VIOLATION_SUMMARIES
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
- this.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list29.size);
- for (int _i30 = 0; _i30 < _list29.size; ++_i30)
- {
- TConstraintViolationSummary _elem31;
- _elem31 = new TConstraintViolationSummary();
- _elem31.read(iprot);
- this.violationSummaries.add(_elem31);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // AUTHORIZATION_FAILURES
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
- this.authorizationFailures = new ArrayList<TKeyExtent>(_list32.size);
- for (int _i33 = 0; _i33 < _list32.size; ++_i33)
- {
- TKeyExtent _elem34;
- _elem34 = new TKeyExtent();
- _elem34.read(iprot);
- this.authorizationFailures.add(_elem34);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.failedExtents != null) {
- oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, this.failedExtents.size()));
- for (Map.Entry<TKeyExtent, Long> _iter35 : this.failedExtents.entrySet())
- {
- _iter35.getKey().write(oprot);
- oprot.writeI64(_iter35.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.violationSummaries != null) {
- oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.violationSummaries.size()));
- for (TConstraintViolationSummary _iter36 : this.violationSummaries)
- {
- _iter36.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.authorizationFailures != null) {
- oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.authorizationFailures.size()));
- for (TKeyExtent _iter37 : this.authorizationFailures)
- {
- _iter37.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -615,5 +513,243 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class UpdateErrorsStandardSchemeFactory implements SchemeFactory {
+ public UpdateErrorsStandardScheme getScheme() {
+ return new UpdateErrorsStandardScheme();
+ }
+ }
+
+ private static class UpdateErrorsStandardScheme extends StandardScheme<UpdateErrors> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, UpdateErrors struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // FAILED_EXTENTS
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
+ struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map50.size);
+ for (int _i51 = 0; _i51 < _map50.size; ++_i51)
+ {
+ TKeyExtent _key52; // required
+ long _val53; // required
+ _key52 = new TKeyExtent();
+ _key52.read(iprot);
+ _val53 = iprot.readI64();
+ struct.failedExtents.put(_key52, _val53);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setFailedExtentsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // VIOLATION_SUMMARIES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list54 = iprot.readListBegin();
+ struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list54.size);
+ for (int _i55 = 0; _i55 < _list54.size; ++_i55)
+ {
+ TConstraintViolationSummary _elem56; // required
+ _elem56 = new TConstraintViolationSummary();
+ _elem56.read(iprot);
+ struct.violationSummaries.add(_elem56);
+ }
+ iprot.readListEnd();
+ }
+ struct.setViolationSummariesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // AUTHORIZATION_FAILURES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list57 = iprot.readListBegin();
+ struct.authorizationFailures = new ArrayList<TKeyExtent>(_list57.size);
+ for (int _i58 = 0; _i58 < _list57.size; ++_i58)
+ {
+ TKeyExtent _elem59; // required
+ _elem59 = new TKeyExtent();
+ _elem59.read(iprot);
+ struct.authorizationFailures.add(_elem59);
+ }
+ iprot.readListEnd();
+ }
+ struct.setAuthorizationFailuresIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, UpdateErrors struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.failedExtents != null) {
+ oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, struct.failedExtents.size()));
+ for (Map.Entry<TKeyExtent, Long> _iter60 : struct.failedExtents.entrySet())
+ {
+ _iter60.getKey().write(oprot);
+ oprot.writeI64(_iter60.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.violationSummaries != null) {
+ oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.violationSummaries.size()));
+ for (TConstraintViolationSummary _iter61 : struct.violationSummaries)
+ {
+ _iter61.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.authorizationFailures != null) {
+ oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authorizationFailures.size()));
+ for (TKeyExtent _iter62 : struct.authorizationFailures)
+ {
+ _iter62.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class UpdateErrorsTupleSchemeFactory implements SchemeFactory {
+ public UpdateErrorsTupleScheme getScheme() {
+ return new UpdateErrorsTupleScheme();
+ }
+ }
+
+ private static class UpdateErrorsTupleScheme extends TupleScheme<UpdateErrors> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetFailedExtents()) {
+ optionals.set(0);
+ }
+ if (struct.isSetViolationSummaries()) {
+ optionals.set(1);
+ }
+ if (struct.isSetAuthorizationFailures()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetFailedExtents()) {
+ {
+ oprot.writeI32(struct.failedExtents.size());
+ for (Map.Entry<TKeyExtent, Long> _iter63 : struct.failedExtents.entrySet())
+ {
+ _iter63.getKey().write(oprot);
+ oprot.writeI64(_iter63.getValue());
+ }
+ }
+ }
+ if (struct.isSetViolationSummaries()) {
+ {
+ oprot.writeI32(struct.violationSummaries.size());
+ for (TConstraintViolationSummary _iter64 : struct.violationSummaries)
+ {
+ _iter64.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetAuthorizationFailures()) {
+ {
+ oprot.writeI32(struct.authorizationFailures.size());
+ for (TKeyExtent _iter65 : struct.authorizationFailures)
+ {
+ _iter65.write(oprot);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, UpdateErrors struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
+ struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map66.size);
+ for (int _i67 = 0; _i67 < _map66.size; ++_i67)
+ {
+ TKeyExtent _key68; // required
+ long _val69; // required
+ _key68 = new TKeyExtent();
+ _key68.read(iprot);
+ _val69 = iprot.readI64();
+ struct.failedExtents.put(_key68, _val69);
+ }
+ }
+ struct.setFailedExtentsIsSet(true);
+ }
+ if (incoming.get(1)) {
+ {
+ org.apache.thrift.protocol.TList _list70 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list70.size);
+ for (int _i71 = 0; _i71 < _list70.size; ++_i71)
+ {
+ TConstraintViolationSummary _elem72; // required
+ _elem72 = new TConstraintViolationSummary();
+ _elem72.read(iprot);
+ struct.violationSummaries.add(_elem72);
+ }
+ }
+ struct.setViolationSummariesIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TList _list73 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.authorizationFailures = new ArrayList<TKeyExtent>(_list73.size);
+ for (int _i74 = 0; _i74 < _list73.size; ++_i74)
+ {
+ TKeyExtent _elem75; // required
+ _elem75 = new TKeyExtent();
+ _elem75.read(iprot);
+ struct.authorizationFailures.add(_elem75);
+ }
+ }
+ struct.setAuthorizationFailuresIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java Fri Jul 13 20:34:44 2012
@@ -632,6 +632,7 @@ public final class BCFile {
}
dataIndex = new DataIndex(cachedDataIndex);
+ cachedDataIndex.close();
} else {
// Logger.getLogger(Reader.class).debug("Read bcfile !METADATA from cache");
@@ -639,7 +640,6 @@ public final class BCFile {
metaIndex = new MetaIndex(cachedMetaIndex);
dataIndex = new DataIndex(cachedDataIndex);
}
-
}
/**
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.gc.thrift;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -34,7 +41,7 @@ import org.slf4j.LoggerFactory;
}
- public static class Client implements org.apache.thrift.TServiceClient, Iface {
+ public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
@@ -47,28 +54,11 @@ import org.slf4j.LoggerFactory;
public Client(org.apache.thrift.protocol.TProtocol prot)
{
- this(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot)
- {
- iprot_ = iprot;
- oprot_ = oprot;
+ super(prot, prot);
}
- protected org.apache.thrift.protocol.TProtocol iprot_;
- protected org.apache.thrift.protocol.TProtocol oprot_;
-
- protected int seqid_;
-
- public org.apache.thrift.protocol.TProtocol getInputProtocol()
- {
- return this.iprot_;
- }
-
- public org.apache.thrift.protocol.TProtocol getOutputProtocol()
- {
- return this.oprot_;
+ public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ super(iprot, oprot);
}
public GCStatus getStatus(org.apache.accumulo.cloudtrace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.AuthInfo credentials) throws org.apache.accumulo.core.security.thrift.ThriftSecurityException, org.apache.thrift.TException
@@ -79,29 +69,16 @@ import org.slf4j.LoggerFactory;
public void send_getStatus(org.apache.accumulo.cloudtrace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.AuthInfo credentials) throws org.apache.thrift.TException
{
- oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_));
getStatus_args args = new getStatus_args();
args.setTinfo(tinfo);
args.setCredentials(credentials);
- args.write(oprot_);
- oprot_.writeMessageEnd();
- oprot_.getTransport().flush();
+ sendBase("getStatus", args);
}
public GCStatus recv_getStatus() throws org.apache.accumulo.core.security.thrift.ThriftSecurityException, org.apache.thrift.TException
{
- org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin();
- if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) {
- org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_);
- iprot_.readMessageEnd();
- throw x;
- }
- if (msg.seqid != seqid_) {
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "getStatus failed: out of sequence response");
- }
getStatus_result result = new getStatus_result();
- result.read(iprot_);
- iprot_.readMessageEnd();
+ receiveBase(result, "getStatus");
if (result.isSetSuccess()) {
return result.success;
}
@@ -131,9 +108,9 @@ import org.slf4j.LoggerFactory;
public void getStatus(org.apache.accumulo.cloudtrace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.AuthInfo credentials, org.apache.thrift.async.AsyncMethodCallback<getStatus_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
- getStatus_call method_call = new getStatus_call(tinfo, credentials, resultHandler, this, protocolFactory, transport);
- this.currentMethod = method_call;
- manager.call(method_call);
+ getStatus_call method_call = new getStatus_call(tinfo, credentials, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
}
public static class getStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
@@ -166,75 +143,39 @@ import org.slf4j.LoggerFactory;
}
- public static class Processor implements org.apache.thrift.TProcessor {
+ public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(Iface iface)
- {
- iface_ = iface;
- processMap_.put("getStatus", new getStatus());
+ public Processor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
- protected static interface ProcessFunction {
- public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException;
+ protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ super(iface, getProcessMap(processMap));
}
- private Iface iface_;
- protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
+ private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ processMap.put("getStatus", new getStatus());
+ return processMap;
+ }
- public boolean process(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
- {
- org.apache.thrift.protocol.TMessage msg = iprot.readMessageBegin();
- ProcessFunction fn = processMap_.get(msg.name);
- if (fn == null) {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, org.apache.thrift.protocol.TType.STRUCT);
- iprot.readMessageEnd();
- org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(msg.name, org.apache.thrift.protocol.TMessageType.EXCEPTION, msg.seqid));
- x.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
- return true;
+ private static class getStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getStatus_args> {
+ public getStatus() {
+ super("getStatus");
}
- fn.process(msg.seqid, iprot, oprot);
- return true;
- }
- private class getStatus implements ProcessFunction {
- public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
- {
- getStatus_args args = new getStatus_args();
- try {
- args.read(iprot);
- } catch (org.apache.thrift.protocol.TProtocolException e) {
- iprot.readMessageEnd();
- org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage());
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid));
- x.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
- return;
- }
- iprot.readMessageEnd();
+ protected getStatus_args getEmptyArgsInstance() {
+ return new getStatus_args();
+ }
+
+ protected getStatus_result getResult(I iface, getStatus_args args) throws org.apache.thrift.TException {
getStatus_result result = new getStatus_result();
try {
- result.success = iface_.getStatus(args.tinfo, args.credentials);
+ result.success = iface.getStatus(args.tinfo, args.credentials);
} catch (org.apache.accumulo.core.security.thrift.ThriftSecurityException sec) {
result.sec = sec;
- } catch (Throwable th) {
- LOGGER.error("Internal error processing getStatus", th);
- org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing getStatus");
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid));
- x.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
- return;
- }
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.REPLY, seqid));
- result.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
+ }
+ return result;
}
-
}
}
@@ -245,8 +186,14 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField TINFO_FIELD_DESC = new org.apache.thrift.protocol.TField("tinfo", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField CREDENTIALS_FIELD_DESC = new org.apache.thrift.protocol.TField("credentials", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- public org.apache.accumulo.cloudtrace.thrift.TInfo tinfo;
- public org.apache.accumulo.core.security.thrift.AuthInfo credentials;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getStatus_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getStatus_argsTupleSchemeFactory());
+ }
+
+ public org.apache.accumulo.cloudtrace.thrift.TInfo tinfo; // required
+ public org.apache.accumulo.core.security.thrift.AuthInfo credentials; // 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 {
@@ -310,7 +257,6 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
-
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -527,58 +473,11 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 2: // TINFO
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.tinfo = new org.apache.accumulo.cloudtrace.thrift.TInfo();
- this.tinfo.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 1: // CREDENTIALS
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.credentials = new org.apache.accumulo.core.security.thrift.AuthInfo();
- this.credentials.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.credentials != null) {
- oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
- this.credentials.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.tinfo != null) {
- oprot.writeFieldBegin(TINFO_FIELD_DESC);
- this.tinfo.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -625,6 +524,117 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class getStatus_argsStandardSchemeFactory implements SchemeFactory {
+ public getStatus_argsStandardScheme getScheme() {
+ return new getStatus_argsStandardScheme();
+ }
+ }
+
+ private static class getStatus_argsStandardScheme extends StandardScheme<getStatus_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getStatus_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 2: // TINFO
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.tinfo = new org.apache.accumulo.cloudtrace.thrift.TInfo();
+ struct.tinfo.read(iprot);
+ struct.setTinfoIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // CREDENTIALS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.credentials = new org.apache.accumulo.core.security.thrift.AuthInfo();
+ struct.credentials.read(iprot);
+ struct.setCredentialsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getStatus_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.credentials != null) {
+ oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
+ struct.credentials.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.tinfo != null) {
+ oprot.writeFieldBegin(TINFO_FIELD_DESC);
+ struct.tinfo.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getStatus_argsTupleSchemeFactory implements SchemeFactory {
+ public getStatus_argsTupleScheme getScheme() {
+ return new getStatus_argsTupleScheme();
+ }
+ }
+
+ private static class getStatus_argsTupleScheme extends TupleScheme<getStatus_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTinfo()) {
+ optionals.set(0);
+ }
+ if (struct.isSetCredentials()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetTinfo()) {
+ struct.tinfo.write(oprot);
+ }
+ if (struct.isSetCredentials()) {
+ struct.credentials.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getStatus_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.tinfo = new org.apache.accumulo.cloudtrace.thrift.TInfo();
+ struct.tinfo.read(iprot);
+ struct.setTinfoIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.credentials = new org.apache.accumulo.core.security.thrift.AuthInfo();
+ struct.credentials.read(iprot);
+ struct.setCredentialsIsSet(true);
+ }
+ }
+ }
+
}
public static class getStatus_result implements org.apache.thrift.TBase<getStatus_result, getStatus_result._Fields>, java.io.Serializable, Cloneable {
@@ -633,8 +643,14 @@ 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.STRUCT, (short)0);
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);
- public GCStatus success;
- public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getStatus_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getStatus_resultTupleSchemeFactory());
+ }
+
+ public GCStatus success; // required
+ public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // 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 {
@@ -698,7 +714,6 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
-
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -915,57 +930,12 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 0: // SUCCESS
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.success = new GCStatus();
- this.success.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 1: // SEC
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.sec = new org.apache.accumulo.core.security.thrift.ThriftSecurityException();
- this.sec.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- oprot.writeStructBegin(STRUCT_DESC);
-
- if (this.isSetSuccess()) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- this.success.write(oprot);
- oprot.writeFieldEnd();
- } else if (this.isSetSec()) {
- oprot.writeFieldBegin(SEC_FIELD_DESC);
- this.sec.write(oprot);
- oprot.writeFieldEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
@Override
public String toString() {
@@ -1011,6 +981,117 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class getStatus_resultStandardSchemeFactory implements SchemeFactory {
+ public getStatus_resultStandardScheme getScheme() {
+ return new getStatus_resultStandardScheme();
+ }
+ }
+
+ private static class getStatus_resultStandardScheme extends StandardScheme<getStatus_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getStatus_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.success = new GCStatus();
+ struct.success.read(iprot);
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // SEC
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.sec = new org.apache.accumulo.core.security.thrift.ThriftSecurityException();
+ struct.sec.read(iprot);
+ struct.setSecIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getStatus_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ struct.success.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.sec != null) {
+ oprot.writeFieldBegin(SEC_FIELD_DESC);
+ struct.sec.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getStatus_resultTupleSchemeFactory implements SchemeFactory {
+ public getStatus_resultTupleScheme getScheme() {
+ return new getStatus_resultTupleScheme();
+ }
+ }
+
+ private static class getStatus_resultTupleScheme extends TupleScheme<getStatus_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetSec()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetSuccess()) {
+ struct.success.write(oprot);
+ }
+ if (struct.isSetSec()) {
+ struct.sec.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getStatus_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.success = new GCStatus();
+ struct.success.read(iprot);
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.sec = new org.apache.accumulo.core.security.thrift.ThriftSecurityException();
+ struct.sec.read(iprot);
+ struct.setSecIsSet(true);
+ }
+ }
+ }
+
}
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.gc.thrift;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -28,10 +35,16 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField CURRENT_FIELD_DESC = new org.apache.thrift.protocol.TField("current", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField CURRENT_LOG_FIELD_DESC = new org.apache.thrift.protocol.TField("currentLog", org.apache.thrift.protocol.TType.STRUCT, (short)4);
- public GcCycleStats last;
- public GcCycleStats lastLog;
- public GcCycleStats current;
- public GcCycleStats currentLog;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new GCStatusStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new GCStatusTupleSchemeFactory());
+ }
+
+ public GcCycleStats last; // required
+ public GcCycleStats lastLog; // required
+ public GcCycleStats current; // required
+ public GcCycleStats currentLog; // 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 {
@@ -101,7 +114,6 @@ import org.slf4j.LoggerFactory;
}
// isset id assignments
-
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -446,84 +458,11 @@ import org.slf4j.LoggerFactory;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // LAST
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.last = new GcCycleStats();
- this.last.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // LAST_LOG
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.lastLog = new GcCycleStats();
- this.lastLog.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // CURRENT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.current = new GcCycleStats();
- this.current.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // CURRENT_LOG
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.currentLog = new GcCycleStats();
- this.currentLog.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.last != null) {
- oprot.writeFieldBegin(LAST_FIELD_DESC);
- this.last.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.lastLog != null) {
- oprot.writeFieldBegin(LAST_LOG_FIELD_DESC);
- this.lastLog.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.current != null) {
- oprot.writeFieldBegin(CURRENT_FIELD_DESC);
- this.current.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.currentLog != null) {
- oprot.writeFieldBegin(CURRENT_LOG_FIELD_DESC);
- this.currentLog.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -586,5 +525,166 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class GCStatusStandardSchemeFactory implements SchemeFactory {
+ public GCStatusStandardScheme getScheme() {
+ return new GCStatusStandardScheme();
+ }
+ }
+
+ private static class GCStatusStandardScheme extends StandardScheme<GCStatus> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, GCStatus struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // LAST
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.last = new GcCycleStats();
+ struct.last.read(iprot);
+ struct.setLastIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // LAST_LOG
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.lastLog = new GcCycleStats();
+ struct.lastLog.read(iprot);
+ struct.setLastLogIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // CURRENT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.current = new GcCycleStats();
+ struct.current.read(iprot);
+ struct.setCurrentIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // CURRENT_LOG
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.currentLog = new GcCycleStats();
+ struct.currentLog.read(iprot);
+ struct.setCurrentLogIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, GCStatus struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.last != null) {
+ oprot.writeFieldBegin(LAST_FIELD_DESC);
+ struct.last.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.lastLog != null) {
+ oprot.writeFieldBegin(LAST_LOG_FIELD_DESC);
+ struct.lastLog.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.current != null) {
+ oprot.writeFieldBegin(CURRENT_FIELD_DESC);
+ struct.current.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.currentLog != null) {
+ oprot.writeFieldBegin(CURRENT_LOG_FIELD_DESC);
+ struct.currentLog.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class GCStatusTupleSchemeFactory implements SchemeFactory {
+ public GCStatusTupleScheme getScheme() {
+ return new GCStatusTupleScheme();
+ }
+ }
+
+ private static class GCStatusTupleScheme extends TupleScheme<GCStatus> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, GCStatus struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetLast()) {
+ optionals.set(0);
+ }
+ if (struct.isSetLastLog()) {
+ optionals.set(1);
+ }
+ if (struct.isSetCurrent()) {
+ optionals.set(2);
+ }
+ if (struct.isSetCurrentLog()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetLast()) {
+ struct.last.write(oprot);
+ }
+ if (struct.isSetLastLog()) {
+ struct.lastLog.write(oprot);
+ }
+ if (struct.isSetCurrent()) {
+ struct.current.write(oprot);
+ }
+ if (struct.isSetCurrentLog()) {
+ struct.currentLog.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, GCStatus struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.last = new GcCycleStats();
+ struct.last.read(iprot);
+ struct.setLastIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.lastLog = new GcCycleStats();
+ struct.lastLog.read(iprot);
+ struct.setLastLogIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.current = new GcCycleStats();
+ struct.current.read(iprot);
+ struct.setCurrentIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.currentLog = new GcCycleStats();
+ struct.currentLog.read(iprot);
+ struct.setCurrentLogIsSet(true);
+ }
+ }
+ }
+
}