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/10 14:39:55 UTC
svn commit: r1359639 [3/13] - in /accumulo/trunk: ./ core/
core/src/main/java/org/apache/accumulo/core/client/admin/
core/src/main/java/org/apache/accumulo/core/client/impl/
core/src/main/java/org/apache/accumulo/core/client/impl/thrift/
core/src/main/...
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java Tue Jul 10 12:39:52 2012
@@ -1,7 +1,8 @@
/**
- * 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.client.impl.thrift;
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java Tue Jul 10 12:39:52 2012
@@ -1,7 +1,8 @@
/**
- * 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.client.impl.thrift;
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java Tue Jul 10 12:39:52 2012
@@ -1,7 +1,8 @@
/**
- * 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.client.impl.thrift;
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java Tue Jul 10 12:39:52 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.client.impl.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,19 +36,25 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5);
- public String tableId;
- public String tableName;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new ThriftTableOperationExceptionStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ThriftTableOperationExceptionTupleSchemeFactory());
+ }
+
+ public String tableId; // required
+ public String tableName; // required
/**
*
* @see TableOperation
*/
- public TableOperation op;
+ public TableOperation op; // required
/**
*
* @see TableOperationExceptionType
*/
- public TableOperationExceptionType type;
- public String description;
+ public TableOperationExceptionType type; // required
+ public String description; // 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 {
@@ -122,7 +135,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);
@@ -547,92 +559,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_ID
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.tableId = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // TABLE_NAME
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.tableName = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // OP
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.op = TableOperation.findByValue(iprot.readI32());
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // TYPE
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.type = TableOperationExceptionType.findByValue(iprot.readI32());
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // DESCRIPTION
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.description = iprot.readString();
- } 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.tableId != null) {
- oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
- oprot.writeString(this.tableId);
- oprot.writeFieldEnd();
- }
- if (this.tableName != null) {
- oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
- oprot.writeString(this.tableName);
- oprot.writeFieldEnd();
- }
- if (this.op != null) {
- oprot.writeFieldBegin(OP_FIELD_DESC);
- oprot.writeI32(this.op.getValue());
- oprot.writeFieldEnd();
- }
- if (this.type != null) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(this.type.getValue());
- oprot.writeFieldEnd();
- }
- if (this.description != null) {
- oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
- oprot.writeString(this.description);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -703,5 +634,181 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class ThriftTableOperationExceptionStandardSchemeFactory implements SchemeFactory {
+ public ThriftTableOperationExceptionStandardScheme getScheme() {
+ return new ThriftTableOperationExceptionStandardScheme();
+ }
+ }
+
+ private static class ThriftTableOperationExceptionStandardScheme extends StandardScheme<ThriftTableOperationException> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftTableOperationException 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_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.tableId = iprot.readString();
+ struct.setTableIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // TABLE_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.tableName = iprot.readString();
+ struct.setTableNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // OP
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.op = TableOperation.findByValue(iprot.readI32());
+ struct.setOpIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.type = TableOperationExceptionType.findByValue(iprot.readI32());
+ struct.setTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // DESCRIPTION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.description = iprot.readString();
+ struct.setDescriptionIsSet(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, ThriftTableOperationException struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.tableId != null) {
+ oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
+ oprot.writeString(struct.tableId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.tableName != null) {
+ oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
+ oprot.writeString(struct.tableName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.op != null) {
+ oprot.writeFieldBegin(OP_FIELD_DESC);
+ oprot.writeI32(struct.op.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.type != null) {
+ oprot.writeFieldBegin(TYPE_FIELD_DESC);
+ oprot.writeI32(struct.type.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.description != null) {
+ oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+ oprot.writeString(struct.description);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ThriftTableOperationExceptionTupleSchemeFactory implements SchemeFactory {
+ public ThriftTableOperationExceptionTupleScheme getScheme() {
+ return new ThriftTableOperationExceptionTupleScheme();
+ }
+ }
+
+ private static class ThriftTableOperationExceptionTupleScheme extends TupleScheme<ThriftTableOperationException> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ThriftTableOperationException struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTableId()) {
+ optionals.set(0);
+ }
+ if (struct.isSetTableName()) {
+ optionals.set(1);
+ }
+ if (struct.isSetOp()) {
+ optionals.set(2);
+ }
+ if (struct.isSetType()) {
+ optionals.set(3);
+ }
+ if (struct.isSetDescription()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetTableId()) {
+ oprot.writeString(struct.tableId);
+ }
+ if (struct.isSetTableName()) {
+ oprot.writeString(struct.tableName);
+ }
+ if (struct.isSetOp()) {
+ oprot.writeI32(struct.op.getValue());
+ }
+ if (struct.isSetType()) {
+ oprot.writeI32(struct.type.getValue());
+ }
+ if (struct.isSetDescription()) {
+ oprot.writeString(struct.description);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ThriftTableOperationException struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.tableId = iprot.readString();
+ struct.setTableIdIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.tableName = iprot.readString();
+ struct.setTableNameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.op = TableOperation.findByValue(iprot.readI32());
+ struct.setOpIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.type = TableOperationExceptionType.findByValue(iprot.readI32());
+ struct.setTypeIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.description = iprot.readString();
+ struct.setDescriptionIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java Tue Jul 10 12:39:52 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 SCAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scanID", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- public long scanID;
- public MultiScanResult result;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new InitialMultiScanStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new InitialMultiScanTupleSchemeFactory());
+ }
+
+ public long scanID; // required
+ public MultiScanResult result; // 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 __SCANID_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);
@@ -212,7 +224,7 @@ import org.slf4j.LoggerFactory;
public Object getFieldValue(_Fields field) {
switch (field) {
case SCAN_ID:
- return new Long(getScanID());
+ return Long.valueOf(getScanID());
case RESULT:
return getResult();
@@ -311,56 +323,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: // SCAN_ID
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.scanID = iprot.readI64();
- setScanIDIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // RESULT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.result = new MultiScanResult();
- this.result.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(SCAN_ID_FIELD_DESC);
- oprot.writeI64(this.scanID);
- oprot.writeFieldEnd();
- if (this.result != null) {
- oprot.writeFieldBegin(RESULT_FIELD_DESC);
- this.result.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -405,5 +372,112 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class InitialMultiScanStandardSchemeFactory implements SchemeFactory {
+ public InitialMultiScanStandardScheme getScheme() {
+ return new InitialMultiScanStandardScheme();
+ }
+ }
+
+ private static class InitialMultiScanStandardScheme extends StandardScheme<InitialMultiScan> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, InitialMultiScan 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: // SCAN_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.scanID = iprot.readI64();
+ struct.setScanIDIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // RESULT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.result = new MultiScanResult();
+ struct.result.read(iprot);
+ struct.setResultIsSet(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, InitialMultiScan struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(SCAN_ID_FIELD_DESC);
+ oprot.writeI64(struct.scanID);
+ oprot.writeFieldEnd();
+ if (struct.result != null) {
+ oprot.writeFieldBegin(RESULT_FIELD_DESC);
+ struct.result.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class InitialMultiScanTupleSchemeFactory implements SchemeFactory {
+ public InitialMultiScanTupleScheme getScheme() {
+ return new InitialMultiScanTupleScheme();
+ }
+ }
+
+ private static class InitialMultiScanTupleScheme extends TupleScheme<InitialMultiScan> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, InitialMultiScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetScanID()) {
+ optionals.set(0);
+ }
+ if (struct.isSetResult()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetScanID()) {
+ oprot.writeI64(struct.scanID);
+ }
+ if (struct.isSetResult()) {
+ struct.result.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, InitialMultiScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.scanID = iprot.readI64();
+ struct.setScanIDIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.result = new MultiScanResult();
+ struct.result.read(iprot);
+ struct.setResultIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java Tue Jul 10 12:39:52 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 SCAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scanID", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- public long scanID;
- public ScanResult result;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new InitialScanStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new InitialScanTupleSchemeFactory());
+ }
+
+ public long scanID; // required
+ public ScanResult result; // 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 __SCANID_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);
@@ -212,7 +224,7 @@ import org.slf4j.LoggerFactory;
public Object getFieldValue(_Fields field) {
switch (field) {
case SCAN_ID:
- return new Long(getScanID());
+ return Long.valueOf(getScanID());
case RESULT:
return getResult();
@@ -311,56 +323,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: // SCAN_ID
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.scanID = iprot.readI64();
- setScanIDIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // RESULT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.result = new ScanResult();
- this.result.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(SCAN_ID_FIELD_DESC);
- oprot.writeI64(this.scanID);
- oprot.writeFieldEnd();
- if (this.result != null) {
- oprot.writeFieldBegin(RESULT_FIELD_DESC);
- this.result.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -405,5 +372,112 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class InitialScanStandardSchemeFactory implements SchemeFactory {
+ public InitialScanStandardScheme getScheme() {
+ return new InitialScanStandardScheme();
+ }
+ }
+
+ private static class InitialScanStandardScheme extends StandardScheme<InitialScan> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, InitialScan 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: // SCAN_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.scanID = iprot.readI64();
+ struct.setScanIDIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // RESULT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.result = new ScanResult();
+ struct.result.read(iprot);
+ struct.setResultIsSet(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, InitialScan struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(SCAN_ID_FIELD_DESC);
+ oprot.writeI64(struct.scanID);
+ oprot.writeFieldEnd();
+ if (struct.result != null) {
+ oprot.writeFieldBegin(RESULT_FIELD_DESC);
+ struct.result.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class InitialScanTupleSchemeFactory implements SchemeFactory {
+ public InitialScanTupleScheme getScheme() {
+ return new InitialScanTupleScheme();
+ }
+ }
+
+ private static class InitialScanTupleScheme extends TupleScheme<InitialScan> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, InitialScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetScanID()) {
+ optionals.set(0);
+ }
+ if (struct.isSetResult()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetScanID()) {
+ oprot.writeI64(struct.scanID);
+ }
+ if (struct.isSetResult()) {
+ struct.result.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, InitialScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.scanID = iprot.readI64();
+ struct.setScanIDIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.result = new ScanResult();
+ struct.result.read(iprot);
+ struct.setResultIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java Tue Jul 10 12:39:52 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 CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("className", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField ITER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("iterName", org.apache.thrift.protocol.TType.STRING, (short)3);
- public int priority;
- public String className;
- public String iterName;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new IterInfoStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new IterInfoTupleSchemeFactory());
+ }
+
+ public int priority; // required
+ public String className; // required
+ public String iterName; // 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 {
@@ -98,7 +111,6 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __PRIORITY_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);
@@ -257,7 +269,7 @@ import org.slf4j.LoggerFactory;
public Object getFieldValue(_Fields field) {
switch (field) {
case PRIORITY:
- return new Integer(getPriority());
+ return Integer.valueOf(getPriority());
case CLASS_NAME:
return getClassName();
@@ -380,67 +392,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: // PRIORITY
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.priority = iprot.readI32();
- setPriorityIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // CLASS_NAME
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.className = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // ITER_NAME
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.iterName = iprot.readString();
- } 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);
- oprot.writeFieldBegin(PRIORITY_FIELD_DESC);
- oprot.writeI32(this.priority);
- oprot.writeFieldEnd();
- if (this.className != null) {
- oprot.writeFieldBegin(CLASS_NAME_FIELD_DESC);
- oprot.writeString(this.className);
- oprot.writeFieldEnd();
- }
- if (this.iterName != null) {
- oprot.writeFieldBegin(ITER_NAME_FIELD_DESC);
- oprot.writeString(this.iterName);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -493,5 +449,133 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class IterInfoStandardSchemeFactory implements SchemeFactory {
+ public IterInfoStandardScheme getScheme() {
+ return new IterInfoStandardScheme();
+ }
+ }
+
+ private static class IterInfoStandardScheme extends StandardScheme<IterInfo> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, IterInfo 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: // PRIORITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.priority = iprot.readI32();
+ struct.setPriorityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // CLASS_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.className = iprot.readString();
+ struct.setClassNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // ITER_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.iterName = iprot.readString();
+ struct.setIterNameIsSet(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, IterInfo struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(PRIORITY_FIELD_DESC);
+ oprot.writeI32(struct.priority);
+ oprot.writeFieldEnd();
+ if (struct.className != null) {
+ oprot.writeFieldBegin(CLASS_NAME_FIELD_DESC);
+ oprot.writeString(struct.className);
+ oprot.writeFieldEnd();
+ }
+ if (struct.iterName != null) {
+ oprot.writeFieldBegin(ITER_NAME_FIELD_DESC);
+ oprot.writeString(struct.iterName);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class IterInfoTupleSchemeFactory implements SchemeFactory {
+ public IterInfoTupleScheme getScheme() {
+ return new IterInfoTupleScheme();
+ }
+ }
+
+ private static class IterInfoTupleScheme extends TupleScheme<IterInfo> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, IterInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetPriority()) {
+ optionals.set(0);
+ }
+ if (struct.isSetClassName()) {
+ optionals.set(1);
+ }
+ if (struct.isSetIterName()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetPriority()) {
+ oprot.writeI32(struct.priority);
+ }
+ if (struct.isSetClassName()) {
+ oprot.writeString(struct.className);
+ }
+ if (struct.isSetIterName()) {
+ oprot.writeString(struct.iterName);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, IterInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.priority = iprot.readI32();
+ struct.setPriorityIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.className = iprot.readString();
+ struct.setClassNameIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.iterName = iprot.readString();
+ struct.setIterNameIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java Tue Jul 10 12:39:52 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;
@@ -25,7 +32,13 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField ESTIMATED_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimatedSize", org.apache.thrift.protocol.TType.I64, (short)1);
- public long estimatedSize;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new MapFileInfoStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new MapFileInfoTupleSchemeFactory());
+ }
+
+ public long estimatedSize; // 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 {
@@ -88,7 +101,6 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __ESTIMATEDSIZE_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);
@@ -167,7 +179,7 @@ import org.slf4j.LoggerFactory;
public Object getFieldValue(_Fields field) {
switch (field) {
case ESTIMATED_SIZE:
- return new Long(getEstimatedSize());
+ return Long.valueOf(getEstimatedSize());
}
throw new IllegalStateException();
@@ -242,43 +254,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: // ESTIMATED_SIZE
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.estimatedSize = iprot.readI64();
- setEstimatedSizeIsSet(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);
- oprot.writeFieldBegin(ESTIMATED_SIZE_FIELD_DESC);
- oprot.writeI64(this.estimatedSize);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -315,5 +295,87 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class MapFileInfoStandardSchemeFactory implements SchemeFactory {
+ public MapFileInfoStandardScheme getScheme() {
+ return new MapFileInfoStandardScheme();
+ }
+ }
+
+ private static class MapFileInfoStandardScheme extends StandardScheme<MapFileInfo> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, MapFileInfo 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: // ESTIMATED_SIZE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.estimatedSize = iprot.readI64();
+ struct.setEstimatedSizeIsSet(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, MapFileInfo struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(ESTIMATED_SIZE_FIELD_DESC);
+ oprot.writeI64(struct.estimatedSize);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class MapFileInfoTupleSchemeFactory implements SchemeFactory {
+ public MapFileInfoTupleScheme getScheme() {
+ return new MapFileInfoTupleScheme();
+ }
+ }
+
+ private static class MapFileInfoTupleScheme extends TupleScheme<MapFileInfo> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, MapFileInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetEstimatedSize()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetEstimatedSize()) {
+ oprot.writeI64(struct.estimatedSize);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, MapFileInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.estimatedSize = iprot.readI64();
+ struct.setEstimatedSizeIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java Tue Jul 10 12:39:52 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/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java Tue Jul 10 12:39:52 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);
+ }
+ }
+ }
+
}