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 [4/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/MultiScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.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;
@@ -31,13 +38,19 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField PART_NEXT_KEY_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("partNextKeyInclusive", org.apache.thrift.protocol.TType.BOOL, (short)6);
private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.BOOL, (short)7);
- public List<TKeyValue> results;
- public Map<TKeyExtent,List<TRange>> failures;
- public List<TKeyExtent> fullScans;
- public TKeyExtent partScan;
- public TKey partNextKey;
- public boolean partNextKeyInclusive;
- public boolean more;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new MultiScanResultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new MultiScanResultTupleSchemeFactory());
+ }
+
+ public List<TKeyValue> results; // required
+ public Map<TKeyExtent,List<TRange>> failures; // required
+ public List<TKeyExtent> fullScans; // required
+ public TKeyExtent partScan; // required
+ public TKey partNextKey; // required
+ public boolean partNextKeyInclusive; // required
+ public boolean more; // 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 {
@@ -119,7 +132,6 @@ import org.slf4j.LoggerFactory;
private static final int __PARTNEXTKEYINCLUSIVE_ISSET_ID = 0;
private static final int __MORE_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
-
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);
@@ -503,10 +515,10 @@ import org.slf4j.LoggerFactory;
return getPartNextKey();
case PART_NEXT_KEY_INCLUSIVE:
- return new Boolean(isPartNextKeyInclusive());
+ return Boolean.valueOf(isPartNextKeyInclusive());
case MORE:
- return new Boolean(isMore());
+ return Boolean.valueOf(isMore());
}
throw new IllegalStateException();
@@ -707,191 +719,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: // RESULTS
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
- this.results = new ArrayList<TKeyValue>(_list8.size);
- for (int _i9 = 0; _i9 < _list8.size; ++_i9)
- {
- TKeyValue _elem10;
- _elem10 = new TKeyValue();
- _elem10.read(iprot);
- this.results.add(_elem10);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // FAILURES
- if (field.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map11 = iprot.readMapBegin();
- this.failures = new HashMap<TKeyExtent,List<TRange>>(2*_map11.size);
- for (int _i12 = 0; _i12 < _map11.size; ++_i12)
- {
- TKeyExtent _key13;
- List<TRange> _val14;
- _key13 = new TKeyExtent();
- _key13.read(iprot);
- {
- org.apache.thrift.protocol.TList _list15 = iprot.readListBegin();
- _val14 = new ArrayList<TRange>(_list15.size);
- for (int _i16 = 0; _i16 < _list15.size; ++_i16)
- {
- TRange _elem17;
- _elem17 = new TRange();
- _elem17.read(iprot);
- _val14.add(_elem17);
- }
- iprot.readListEnd();
- }
- this.failures.put(_key13, _val14);
- }
- iprot.readMapEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // FULL_SCANS
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list18 = iprot.readListBegin();
- this.fullScans = new ArrayList<TKeyExtent>(_list18.size);
- for (int _i19 = 0; _i19 < _list18.size; ++_i19)
- {
- TKeyExtent _elem20;
- _elem20 = new TKeyExtent();
- _elem20.read(iprot);
- this.fullScans.add(_elem20);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // PART_SCAN
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.partScan = new TKeyExtent();
- this.partScan.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // PART_NEXT_KEY
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.partNextKey = new TKey();
- this.partNextKey.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 6: // PART_NEXT_KEY_INCLUSIVE
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.partNextKeyInclusive = iprot.readBool();
- setPartNextKeyInclusiveIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 7: // MORE
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.more = iprot.readBool();
- setMoreIsSet(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.results != null) {
- oprot.writeFieldBegin(RESULTS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.results.size()));
- for (TKeyValue _iter21 : this.results)
- {
- _iter21.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.failures != null) {
- oprot.writeFieldBegin(FAILURES_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.LIST, this.failures.size()));
- for (Map.Entry<TKeyExtent, List<TRange>> _iter22 : this.failures.entrySet())
- {
- _iter22.getKey().write(oprot);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter22.getValue().size()));
- for (TRange _iter23 : _iter22.getValue())
- {
- _iter23.write(oprot);
- }
- oprot.writeListEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.fullScans != null) {
- oprot.writeFieldBegin(FULL_SCANS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.fullScans.size()));
- for (TKeyExtent _iter24 : this.fullScans)
- {
- _iter24.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.partScan != null) {
- oprot.writeFieldBegin(PART_SCAN_FIELD_DESC);
- this.partScan.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.partNextKey != null) {
- oprot.writeFieldBegin(PART_NEXT_KEY_FIELD_DESC);
- this.partNextKey.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(PART_NEXT_KEY_INCLUSIVE_FIELD_DESC);
- oprot.writeBool(this.partNextKeyInclusive);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(MORE_FIELD_DESC);
- oprot.writeBool(this.more);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -972,5 +804,369 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class MultiScanResultStandardSchemeFactory implements SchemeFactory {
+ public MultiScanResultStandardScheme getScheme() {
+ return new MultiScanResultStandardScheme();
+ }
+ }
+
+ private static class MultiScanResultStandardScheme extends StandardScheme<MultiScanResult> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, MultiScanResult 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: // RESULTS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
+ struct.results = new ArrayList<TKeyValue>(_list16.size);
+ for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+ {
+ TKeyValue _elem18; // required
+ _elem18 = new TKeyValue();
+ _elem18.read(iprot);
+ struct.results.add(_elem18);
+ }
+ iprot.readListEnd();
+ }
+ struct.setResultsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // FAILURES
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map19 = iprot.readMapBegin();
+ struct.failures = new HashMap<TKeyExtent,List<TRange>>(2*_map19.size);
+ for (int _i20 = 0; _i20 < _map19.size; ++_i20)
+ {
+ TKeyExtent _key21; // required
+ List<TRange> _val22; // required
+ _key21 = new TKeyExtent();
+ _key21.read(iprot);
+ {
+ org.apache.thrift.protocol.TList _list23 = iprot.readListBegin();
+ _val22 = new ArrayList<TRange>(_list23.size);
+ for (int _i24 = 0; _i24 < _list23.size; ++_i24)
+ {
+ TRange _elem25; // required
+ _elem25 = new TRange();
+ _elem25.read(iprot);
+ _val22.add(_elem25);
+ }
+ iprot.readListEnd();
+ }
+ struct.failures.put(_key21, _val22);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setFailuresIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // FULL_SCANS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list26 = iprot.readListBegin();
+ struct.fullScans = new ArrayList<TKeyExtent>(_list26.size);
+ for (int _i27 = 0; _i27 < _list26.size; ++_i27)
+ {
+ TKeyExtent _elem28; // required
+ _elem28 = new TKeyExtent();
+ _elem28.read(iprot);
+ struct.fullScans.add(_elem28);
+ }
+ iprot.readListEnd();
+ }
+ struct.setFullScansIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // PART_SCAN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.partScan = new TKeyExtent();
+ struct.partScan.read(iprot);
+ struct.setPartScanIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // PART_NEXT_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.partNextKey = new TKey();
+ struct.partNextKey.read(iprot);
+ struct.setPartNextKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // PART_NEXT_KEY_INCLUSIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.partNextKeyInclusive = iprot.readBool();
+ struct.setPartNextKeyInclusiveIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // MORE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.more = iprot.readBool();
+ struct.setMoreIsSet(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, MultiScanResult struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.results != null) {
+ oprot.writeFieldBegin(RESULTS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.results.size()));
+ for (TKeyValue _iter29 : struct.results)
+ {
+ _iter29.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.failures != null) {
+ oprot.writeFieldBegin(FAILURES_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.LIST, struct.failures.size()));
+ for (Map.Entry<TKeyExtent, List<TRange>> _iter30 : struct.failures.entrySet())
+ {
+ _iter30.getKey().write(oprot);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter30.getValue().size()));
+ for (TRange _iter31 : _iter30.getValue())
+ {
+ _iter31.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.fullScans != null) {
+ oprot.writeFieldBegin(FULL_SCANS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.fullScans.size()));
+ for (TKeyExtent _iter32 : struct.fullScans)
+ {
+ _iter32.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.partScan != null) {
+ oprot.writeFieldBegin(PART_SCAN_FIELD_DESC);
+ struct.partScan.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.partNextKey != null) {
+ oprot.writeFieldBegin(PART_NEXT_KEY_FIELD_DESC);
+ struct.partNextKey.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(PART_NEXT_KEY_INCLUSIVE_FIELD_DESC);
+ oprot.writeBool(struct.partNextKeyInclusive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(MORE_FIELD_DESC);
+ oprot.writeBool(struct.more);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class MultiScanResultTupleSchemeFactory implements SchemeFactory {
+ public MultiScanResultTupleScheme getScheme() {
+ return new MultiScanResultTupleScheme();
+ }
+ }
+
+ private static class MultiScanResultTupleScheme extends TupleScheme<MultiScanResult> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, MultiScanResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetResults()) {
+ optionals.set(0);
+ }
+ if (struct.isSetFailures()) {
+ optionals.set(1);
+ }
+ if (struct.isSetFullScans()) {
+ optionals.set(2);
+ }
+ if (struct.isSetPartScan()) {
+ optionals.set(3);
+ }
+ if (struct.isSetPartNextKey()) {
+ optionals.set(4);
+ }
+ if (struct.isSetPartNextKeyInclusive()) {
+ optionals.set(5);
+ }
+ if (struct.isSetMore()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetResults()) {
+ {
+ oprot.writeI32(struct.results.size());
+ for (TKeyValue _iter33 : struct.results)
+ {
+ _iter33.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetFailures()) {
+ {
+ oprot.writeI32(struct.failures.size());
+ for (Map.Entry<TKeyExtent, List<TRange>> _iter34 : struct.failures.entrySet())
+ {
+ _iter34.getKey().write(oprot);
+ {
+ oprot.writeI32(_iter34.getValue().size());
+ for (TRange _iter35 : _iter34.getValue())
+ {
+ _iter35.write(oprot);
+ }
+ }
+ }
+ }
+ }
+ if (struct.isSetFullScans()) {
+ {
+ oprot.writeI32(struct.fullScans.size());
+ for (TKeyExtent _iter36 : struct.fullScans)
+ {
+ _iter36.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetPartScan()) {
+ struct.partScan.write(oprot);
+ }
+ if (struct.isSetPartNextKey()) {
+ struct.partNextKey.write(oprot);
+ }
+ if (struct.isSetPartNextKeyInclusive()) {
+ oprot.writeBool(struct.partNextKeyInclusive);
+ }
+ if (struct.isSetMore()) {
+ oprot.writeBool(struct.more);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, MultiScanResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.results = new ArrayList<TKeyValue>(_list37.size);
+ for (int _i38 = 0; _i38 < _list37.size; ++_i38)
+ {
+ TKeyValue _elem39; // required
+ _elem39 = new TKeyValue();
+ _elem39.read(iprot);
+ struct.results.add(_elem39);
+ }
+ }
+ struct.setResultsIsSet(true);
+ }
+ if (incoming.get(1)) {
+ {
+ org.apache.thrift.protocol.TMap _map40 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+ struct.failures = new HashMap<TKeyExtent,List<TRange>>(2*_map40.size);
+ for (int _i41 = 0; _i41 < _map40.size; ++_i41)
+ {
+ TKeyExtent _key42; // required
+ List<TRange> _val43; // required
+ _key42 = new TKeyExtent();
+ _key42.read(iprot);
+ {
+ org.apache.thrift.protocol.TList _list44 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ _val43 = new ArrayList<TRange>(_list44.size);
+ for (int _i45 = 0; _i45 < _list44.size; ++_i45)
+ {
+ TRange _elem46; // required
+ _elem46 = new TRange();
+ _elem46.read(iprot);
+ _val43.add(_elem46);
+ }
+ }
+ struct.failures.put(_key42, _val43);
+ }
+ }
+ struct.setFailuresIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TList _list47 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.fullScans = new ArrayList<TKeyExtent>(_list47.size);
+ for (int _i48 = 0; _i48 < _list47.size; ++_i48)
+ {
+ TKeyExtent _elem49; // required
+ _elem49 = new TKeyExtent();
+ _elem49.read(iprot);
+ struct.fullScans.add(_elem49);
+ }
+ }
+ struct.setFullScansIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.partScan = new TKeyExtent();
+ struct.partScan.read(iprot);
+ struct.setPartScanIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.partNextKey = new TKey();
+ struct.partNextKey.read(iprot);
+ struct.setPartNextKeyIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.partNextKeyInclusive = iprot.readBool();
+ struct.setPartNextKeyInclusiveIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.more = iprot.readBool();
+ struct.setMoreIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.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;
@@ -26,8 +33,14 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.LIST, (short)1);
private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.BOOL, (short)2);
- public List<TKeyValue> results;
- public boolean more;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new ScanResultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ScanResultTupleSchemeFactory());
+ }
+
+ public List<TKeyValue> results; // required
+ public boolean more; // 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 {
@@ -93,7 +106,6 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __MORE_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);
@@ -235,7 +247,7 @@ import org.slf4j.LoggerFactory;
return getResults();
case MORE:
- return new Boolean(isMore());
+ return Boolean.valueOf(isMore());
}
throw new IllegalStateException();
@@ -331,73 +343,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: // RESULTS
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
- this.results = new ArrayList<TKeyValue>(_list4.size);
- for (int _i5 = 0; _i5 < _list4.size; ++_i5)
- {
- TKeyValue _elem6;
- _elem6 = new TKeyValue();
- _elem6.read(iprot);
- this.results.add(_elem6);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // MORE
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.more = iprot.readBool();
- setMoreIsSet(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.results != null) {
- oprot.writeFieldBegin(RESULTS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.results.size()));
- for (TKeyValue _iter7 : this.results)
- {
- _iter7.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(MORE_FIELD_DESC);
- oprot.writeBool(this.more);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -442,5 +392,144 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class ScanResultStandardSchemeFactory implements SchemeFactory {
+ public ScanResultStandardScheme getScheme() {
+ return new ScanResultStandardScheme();
+ }
+ }
+
+ private static class ScanResultStandardScheme extends StandardScheme<ScanResult> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ScanResult 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: // RESULTS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
+ struct.results = new ArrayList<TKeyValue>(_list8.size);
+ for (int _i9 = 0; _i9 < _list8.size; ++_i9)
+ {
+ TKeyValue _elem10; // required
+ _elem10 = new TKeyValue();
+ _elem10.read(iprot);
+ struct.results.add(_elem10);
+ }
+ iprot.readListEnd();
+ }
+ struct.setResultsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // MORE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.more = iprot.readBool();
+ struct.setMoreIsSet(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, ScanResult struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.results != null) {
+ oprot.writeFieldBegin(RESULTS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.results.size()));
+ for (TKeyValue _iter11 : struct.results)
+ {
+ _iter11.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(MORE_FIELD_DESC);
+ oprot.writeBool(struct.more);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ScanResultTupleSchemeFactory implements SchemeFactory {
+ public ScanResultTupleScheme getScheme() {
+ return new ScanResultTupleScheme();
+ }
+ }
+
+ private static class ScanResultTupleScheme extends TupleScheme<ScanResult> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ScanResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetResults()) {
+ optionals.set(0);
+ }
+ if (struct.isSetMore()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetResults()) {
+ {
+ oprot.writeI32(struct.results.size());
+ for (TKeyValue _iter12 : struct.results)
+ {
+ _iter12.write(oprot);
+ }
+ }
+ }
+ if (struct.isSetMore()) {
+ oprot.writeBool(struct.more);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ScanResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.results = new ArrayList<TKeyValue>(_list13.size);
+ for (int _i14 = 0; _i14 < _list13.size; ++_i14)
+ {
+ TKeyValue _elem15; // required
+ _elem15 = new TKeyValue();
+ _elem15.read(iprot);
+ struct.results.add(_elem15);
+ }
+ }
+ struct.setResultsIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.more = iprot.readBool();
+ struct.setMoreIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.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 COLUMN_QUALIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("columnQualifier", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField COLUMN_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("columnVisibility", org.apache.thrift.protocol.TType.STRING, (short)3);
- public ByteBuffer columnFamily;
- public ByteBuffer columnQualifier;
- public ByteBuffer columnVisibility;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TColumnStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TColumnTupleSchemeFactory());
+ }
+
+ public ByteBuffer columnFamily; // required
+ public ByteBuffer columnQualifier; // required
+ public ByteBuffer columnVisibility; // 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);
@@ -410,68 +422,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: // COLUMN_FAMILY
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.columnFamily = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // COLUMN_QUALIFIER
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.columnQualifier = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // COLUMN_VISIBILITY
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.columnVisibility = iprot.readBinary();
- } 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.columnFamily != null) {
- oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC);
- oprot.writeBinary(this.columnFamily);
- oprot.writeFieldEnd();
- }
- if (this.columnQualifier != null) {
- oprot.writeFieldBegin(COLUMN_QUALIFIER_FIELD_DESC);
- oprot.writeBinary(this.columnQualifier);
- oprot.writeFieldEnd();
- }
- if (this.columnVisibility != null) {
- oprot.writeFieldBegin(COLUMN_VISIBILITY_FIELD_DESC);
- oprot.writeBinary(this.columnVisibility);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -526,5 +481,135 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TColumnStandardSchemeFactory implements SchemeFactory {
+ public TColumnStandardScheme getScheme() {
+ return new TColumnStandardScheme();
+ }
+ }
+
+ private static class TColumnStandardScheme extends StandardScheme<TColumn> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TColumn 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: // COLUMN_FAMILY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.columnFamily = iprot.readBinary();
+ struct.setColumnFamilyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // COLUMN_QUALIFIER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.columnQualifier = iprot.readBinary();
+ struct.setColumnQualifierIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // COLUMN_VISIBILITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.columnVisibility = iprot.readBinary();
+ struct.setColumnVisibilityIsSet(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, TColumn struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.columnFamily != null) {
+ oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC);
+ oprot.writeBinary(struct.columnFamily);
+ oprot.writeFieldEnd();
+ }
+ if (struct.columnQualifier != null) {
+ oprot.writeFieldBegin(COLUMN_QUALIFIER_FIELD_DESC);
+ oprot.writeBinary(struct.columnQualifier);
+ oprot.writeFieldEnd();
+ }
+ if (struct.columnVisibility != null) {
+ oprot.writeFieldBegin(COLUMN_VISIBILITY_FIELD_DESC);
+ oprot.writeBinary(struct.columnVisibility);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TColumnTupleSchemeFactory implements SchemeFactory {
+ public TColumnTupleScheme getScheme() {
+ return new TColumnTupleScheme();
+ }
+ }
+
+ private static class TColumnTupleScheme extends TupleScheme<TColumn> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetColumnFamily()) {
+ optionals.set(0);
+ }
+ if (struct.isSetColumnQualifier()) {
+ optionals.set(1);
+ }
+ if (struct.isSetColumnVisibility()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetColumnFamily()) {
+ oprot.writeBinary(struct.columnFamily);
+ }
+ if (struct.isSetColumnQualifier()) {
+ oprot.writeBinary(struct.columnQualifier);
+ }
+ if (struct.isSetColumnVisibility()) {
+ oprot.writeBinary(struct.columnVisibility);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.columnFamily = iprot.readBinary();
+ struct.setColumnFamilyIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.columnQualifier = iprot.readBinary();
+ struct.setColumnQualifierIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.columnVisibility = iprot.readBinary();
+ struct.setColumnVisibilityIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.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 VIOLATION_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("violationDescription", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField NUMBER_OF_VIOLATING_MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("numberOfViolatingMutations", org.apache.thrift.protocol.TType.I64, (short)4);
- public String constrainClass;
- public short violationCode;
- public String violationDescription;
- public long numberOfViolatingMutations;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TConstraintViolationSummaryStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TConstraintViolationSummaryTupleSchemeFactory());
+ }
+
+ public String constrainClass; // required
+ public short violationCode; // required
+ public String violationDescription; // required
+ public long numberOfViolatingMutations; // 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 {
@@ -104,7 +117,6 @@ import org.slf4j.LoggerFactory;
private static final int __VIOLATIONCODE_ISSET_ID = 0;
private static final int __NUMBEROFVIOLATINGMUTATIONS_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
-
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);
@@ -305,13 +317,13 @@ import org.slf4j.LoggerFactory;
return getConstrainClass();
case VIOLATION_CODE:
- return new Short(getViolationCode());
+ return Short.valueOf(getViolationCode());
case VIOLATION_DESCRIPTION:
return getViolationDescription();
case NUMBER_OF_VIOLATING_MUTATIONS:
- return new Long(getNumberOfViolatingMutations());
+ return Long.valueOf(getNumberOfViolatingMutations());
}
throw new IllegalStateException();
@@ -449,78 +461,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: // CONSTRAIN_CLASS
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.constrainClass = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // VIOLATION_CODE
- if (field.type == org.apache.thrift.protocol.TType.I16) {
- this.violationCode = iprot.readI16();
- setViolationCodeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // VIOLATION_DESCRIPTION
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.violationDescription = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // NUMBER_OF_VIOLATING_MUTATIONS
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.numberOfViolatingMutations = iprot.readI64();
- setNumberOfViolatingMutationsIsSet(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.constrainClass != null) {
- oprot.writeFieldBegin(CONSTRAIN_CLASS_FIELD_DESC);
- oprot.writeString(this.constrainClass);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(VIOLATION_CODE_FIELD_DESC);
- oprot.writeI16(this.violationCode);
- oprot.writeFieldEnd();
- if (this.violationDescription != null) {
- oprot.writeFieldBegin(VIOLATION_DESCRIPTION_FIELD_DESC);
- oprot.writeString(this.violationDescription);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(NUMBER_OF_VIOLATING_MUTATIONS_FIELD_DESC);
- oprot.writeI64(this.numberOfViolatingMutations);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -577,5 +522,154 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TConstraintViolationSummaryStandardSchemeFactory implements SchemeFactory {
+ public TConstraintViolationSummaryStandardScheme getScheme() {
+ return new TConstraintViolationSummaryStandardScheme();
+ }
+ }
+
+ private static class TConstraintViolationSummaryStandardScheme extends StandardScheme<TConstraintViolationSummary> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TConstraintViolationSummary 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: // CONSTRAIN_CLASS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.constrainClass = iprot.readString();
+ struct.setConstrainClassIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // VIOLATION_CODE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
+ struct.violationCode = iprot.readI16();
+ struct.setViolationCodeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // VIOLATION_DESCRIPTION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.violationDescription = iprot.readString();
+ struct.setViolationDescriptionIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // NUMBER_OF_VIOLATING_MUTATIONS
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.numberOfViolatingMutations = iprot.readI64();
+ struct.setNumberOfViolatingMutationsIsSet(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, TConstraintViolationSummary struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.constrainClass != null) {
+ oprot.writeFieldBegin(CONSTRAIN_CLASS_FIELD_DESC);
+ oprot.writeString(struct.constrainClass);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(VIOLATION_CODE_FIELD_DESC);
+ oprot.writeI16(struct.violationCode);
+ oprot.writeFieldEnd();
+ if (struct.violationDescription != null) {
+ oprot.writeFieldBegin(VIOLATION_DESCRIPTION_FIELD_DESC);
+ oprot.writeString(struct.violationDescription);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(NUMBER_OF_VIOLATING_MUTATIONS_FIELD_DESC);
+ oprot.writeI64(struct.numberOfViolatingMutations);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TConstraintViolationSummaryTupleSchemeFactory implements SchemeFactory {
+ public TConstraintViolationSummaryTupleScheme getScheme() {
+ return new TConstraintViolationSummaryTupleScheme();
+ }
+ }
+
+ private static class TConstraintViolationSummaryTupleScheme extends TupleScheme<TConstraintViolationSummary> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TConstraintViolationSummary struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetConstrainClass()) {
+ optionals.set(0);
+ }
+ if (struct.isSetViolationCode()) {
+ optionals.set(1);
+ }
+ if (struct.isSetViolationDescription()) {
+ optionals.set(2);
+ }
+ if (struct.isSetNumberOfViolatingMutations()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetConstrainClass()) {
+ oprot.writeString(struct.constrainClass);
+ }
+ if (struct.isSetViolationCode()) {
+ oprot.writeI16(struct.violationCode);
+ }
+ if (struct.isSetViolationDescription()) {
+ oprot.writeString(struct.violationDescription);
+ }
+ if (struct.isSetNumberOfViolatingMutations()) {
+ oprot.writeI64(struct.numberOfViolatingMutations);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TConstraintViolationSummary struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.constrainClass = iprot.readString();
+ struct.setConstrainClassIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.violationCode = iprot.readI16();
+ struct.setViolationCodeIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.violationDescription = iprot.readString();
+ struct.setViolationDescriptionIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.numberOfViolatingMutations = iprot.readI64();
+ struct.setNumberOfViolatingMutationsIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.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;
@@ -29,11 +36,17 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField COL_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("colVisibility", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)5);
- public ByteBuffer row;
- public ByteBuffer colFamily;
- public ByteBuffer colQualifier;
- public ByteBuffer colVisibility;
- public long timestamp;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TKeyStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TKeyTupleSchemeFactory());
+ }
+
+ public ByteBuffer row; // required
+ public ByteBuffer colFamily; // required
+ public ByteBuffer colQualifier; // required
+ public ByteBuffer colVisibility; // required
+ public long timestamp; // 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 {
@@ -108,7 +121,6 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __TIMESTAMP_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);
@@ -403,7 +415,7 @@ import org.slf4j.LoggerFactory;
return getColVisibility();
case TIMESTAMP:
- return new Long(getTimestamp());
+ return Long.valueOf(getTimestamp());
}
throw new IllegalStateException();
@@ -562,91 +574,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: // COL_FAMILY
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.colFamily = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // COL_QUALIFIER
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.colQualifier = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // COL_VISIBILITY
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.colVisibility = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // TIMESTAMP
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.timestamp = iprot.readI64();
- setTimestampIsSet(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.colFamily != null) {
- oprot.writeFieldBegin(COL_FAMILY_FIELD_DESC);
- oprot.writeBinary(this.colFamily);
- oprot.writeFieldEnd();
- }
- if (this.colQualifier != null) {
- oprot.writeFieldBegin(COL_QUALIFIER_FIELD_DESC);
- oprot.writeBinary(this.colQualifier);
- oprot.writeFieldEnd();
- }
- if (this.colVisibility != null) {
- oprot.writeFieldBegin(COL_VISIBILITY_FIELD_DESC);
- oprot.writeBinary(this.colVisibility);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
- oprot.writeI64(this.timestamp);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -715,5 +647,179 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TKeyStandardSchemeFactory implements SchemeFactory {
+ public TKeyStandardScheme getScheme() {
+ return new TKeyStandardScheme();
+ }
+ }
+
+ private static class TKeyStandardScheme extends StandardScheme<TKey> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TKey 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: // COL_FAMILY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.colFamily = iprot.readBinary();
+ struct.setColFamilyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // COL_QUALIFIER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.colQualifier = iprot.readBinary();
+ struct.setColQualifierIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // COL_VISIBILITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.colVisibility = iprot.readBinary();
+ struct.setColVisibilityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // TIMESTAMP
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.timestamp = iprot.readI64();
+ struct.setTimestampIsSet(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, TKey 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.colFamily != null) {
+ oprot.writeFieldBegin(COL_FAMILY_FIELD_DESC);
+ oprot.writeBinary(struct.colFamily);
+ oprot.writeFieldEnd();
+ }
+ if (struct.colQualifier != null) {
+ oprot.writeFieldBegin(COL_QUALIFIER_FIELD_DESC);
+ oprot.writeBinary(struct.colQualifier);
+ oprot.writeFieldEnd();
+ }
+ if (struct.colVisibility != null) {
+ oprot.writeFieldBegin(COL_VISIBILITY_FIELD_DESC);
+ oprot.writeBinary(struct.colVisibility);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
+ oprot.writeI64(struct.timestamp);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TKeyTupleSchemeFactory implements SchemeFactory {
+ public TKeyTupleScheme getScheme() {
+ return new TKeyTupleScheme();
+ }
+ }
+
+ private static class TKeyTupleScheme extends TupleScheme<TKey> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TKey struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetRow()) {
+ optionals.set(0);
+ }
+ if (struct.isSetColFamily()) {
+ optionals.set(1);
+ }
+ if (struct.isSetColQualifier()) {
+ optionals.set(2);
+ }
+ if (struct.isSetColVisibility()) {
+ optionals.set(3);
+ }
+ if (struct.isSetTimestamp()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetRow()) {
+ oprot.writeBinary(struct.row);
+ }
+ if (struct.isSetColFamily()) {
+ oprot.writeBinary(struct.colFamily);
+ }
+ if (struct.isSetColQualifier()) {
+ oprot.writeBinary(struct.colQualifier);
+ }
+ if (struct.isSetColVisibility()) {
+ oprot.writeBinary(struct.colVisibility);
+ }
+ if (struct.isSetTimestamp()) {
+ oprot.writeI64(struct.timestamp);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TKey struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.colFamily = iprot.readBinary();
+ struct.setColFamilyIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.colQualifier = iprot.readBinary();
+ struct.setColQualifierIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.colVisibility = iprot.readBinary();
+ struct.setColVisibilityIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.timestamp = iprot.readI64();
+ struct.setTimestampIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.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 END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("endRow", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PREV_END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("prevEndRow", org.apache.thrift.protocol.TType.STRING, (short)3);
- public ByteBuffer table;
- public ByteBuffer endRow;
- public ByteBuffer prevEndRow;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TKeyExtentStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TKeyExtentTupleSchemeFactory());
+ }
+
+ public ByteBuffer table; // required
+ public ByteBuffer endRow; // required
+ public ByteBuffer prevEndRow; // 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);
@@ -410,68 +422,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: // TABLE
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.table = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // END_ROW
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.endRow = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // PREV_END_ROW
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.prevEndRow = iprot.readBinary();
- } 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.table != null) {
- oprot.writeFieldBegin(TABLE_FIELD_DESC);
- oprot.writeBinary(this.table);
- oprot.writeFieldEnd();
- }
- if (this.endRow != null) {
- oprot.writeFieldBegin(END_ROW_FIELD_DESC);
- oprot.writeBinary(this.endRow);
- oprot.writeFieldEnd();
- }
- if (this.prevEndRow != null) {
- oprot.writeFieldBegin(PREV_END_ROW_FIELD_DESC);
- oprot.writeBinary(this.prevEndRow);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -526,5 +481,135 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TKeyExtentStandardSchemeFactory implements SchemeFactory {
+ public TKeyExtentStandardScheme getScheme() {
+ return new TKeyExtentStandardScheme();
+ }
+ }
+
+ private static class TKeyExtentStandardScheme extends StandardScheme<TKeyExtent> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TKeyExtent 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: // TABLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.table = iprot.readBinary();
+ struct.setTableIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // END_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.endRow = iprot.readBinary();
+ struct.setEndRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // PREV_END_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.prevEndRow = iprot.readBinary();
+ struct.setPrevEndRowIsSet(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, TKeyExtent struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.table != null) {
+ oprot.writeFieldBegin(TABLE_FIELD_DESC);
+ oprot.writeBinary(struct.table);
+ oprot.writeFieldEnd();
+ }
+ if (struct.endRow != null) {
+ oprot.writeFieldBegin(END_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.endRow);
+ oprot.writeFieldEnd();
+ }
+ if (struct.prevEndRow != null) {
+ oprot.writeFieldBegin(PREV_END_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.prevEndRow);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TKeyExtentTupleSchemeFactory implements SchemeFactory {
+ public TKeyExtentTupleScheme getScheme() {
+ return new TKeyExtentTupleScheme();
+ }
+ }
+
+ private static class TKeyExtentTupleScheme extends TupleScheme<TKeyExtent> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TKeyExtent struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTable()) {
+ optionals.set(0);
+ }
+ if (struct.isSetEndRow()) {
+ optionals.set(1);
+ }
+ if (struct.isSetPrevEndRow()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetTable()) {
+ oprot.writeBinary(struct.table);
+ }
+ if (struct.isSetEndRow()) {
+ oprot.writeBinary(struct.endRow);
+ }
+ if (struct.isSetPrevEndRow()) {
+ oprot.writeBinary(struct.prevEndRow);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TKeyExtent struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.table = iprot.readBinary();
+ struct.setTableIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.endRow = iprot.readBinary();
+ struct.setEndRowIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.prevEndRow = iprot.readBinary();
+ struct.setPrevEndRowIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.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;
@@ -26,8 +33,14 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
- public TKey key;
- public ByteBuffer value;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TKeyValueStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TKeyValueTupleSchemeFactory());
+ }
+
+ public TKey key; // required
+ public ByteBuffer value; // 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 {
@@ -91,7 +104,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);
@@ -319,57 +331,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: // KEY
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.key = new TKey();
- this.key.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // VALUE
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.value = iprot.readBinary();
- } 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.key != null) {
- oprot.writeFieldBegin(KEY_FIELD_DESC);
- this.key.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.value != null) {
- oprot.writeFieldBegin(VALUE_FIELD_DESC);
- oprot.writeBinary(this.value);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -416,5 +382,114 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TKeyValueStandardSchemeFactory implements SchemeFactory {
+ public TKeyValueStandardScheme getScheme() {
+ return new TKeyValueStandardScheme();
+ }
+ }
+
+ private static class TKeyValueStandardScheme extends StandardScheme<TKeyValue> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TKeyValue 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: // KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.key = new TKey();
+ struct.key.read(iprot);
+ struct.setKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // VALUE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.value = iprot.readBinary();
+ struct.setValueIsSet(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, TKeyValue struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.key != null) {
+ oprot.writeFieldBegin(KEY_FIELD_DESC);
+ struct.key.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.value != null) {
+ oprot.writeFieldBegin(VALUE_FIELD_DESC);
+ oprot.writeBinary(struct.value);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TKeyValueTupleSchemeFactory implements SchemeFactory {
+ public TKeyValueTupleScheme getScheme() {
+ return new TKeyValueTupleScheme();
+ }
+ }
+
+ private static class TKeyValueTupleScheme extends TupleScheme<TKeyValue> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TKeyValue struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetKey()) {
+ optionals.set(0);
+ }
+ if (struct.isSetValue()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetKey()) {
+ struct.key.write(oprot);
+ }
+ if (struct.isSetValue()) {
+ oprot.writeBinary(struct.value);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TKeyValue struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.key = new TKey();
+ struct.key.read(iprot);
+ struct.setKeyIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.value = iprot.readBinary();
+ struct.setValueIsSet(true);
+ }
+ }
+ }
+
}