You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2012/07/05 21:39:05 UTC
svn commit: r1357829 [4/12] - in /accumulo/branches/ACCUMULO-672:
core/src/main/java/org/apache/accumulo/core/client/impl/thrift/
core/src/main/java/org/apache/accumulo/core/data/thrift/
core/src/main/java/org/apache/accumulo/core/gc/thrift/ core/src/m...
Modified: accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java Thu Jul 5 19:39:03 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-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java Thu Jul 5 19:39:03 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-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java Thu Jul 5 19:39:03 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-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java Thu Jul 5 19:39:03 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-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java Thu Jul 5 19:39:03 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);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java Thu Jul 5 19:39:03 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-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java Thu Jul 5 19:39:03 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);
+ }
+ }
+ }
+
}