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 [11/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/...
Modified: accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.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.tabletserver.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 SEQ_FIELD_DESC = new org.apache.thrift.protocol.TField("seq", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (short)3);
- public int tabletID;
- public long seq;
- public List<org.apache.accumulo.core.data.thrift.TMutation> mutations;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TabletMutationsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TabletMutationsTupleSchemeFactory());
+ }
+
+ public int tabletID; // required
+ public long seq; // required
+ public List<org.apache.accumulo.core.data.thrift.TMutation> mutations; // 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 {
@@ -99,7 +112,6 @@ import org.slf4j.LoggerFactory;
private static final int __TABLETID_ISSET_ID = 0;
private static final int __SEQ_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);
@@ -277,10 +289,10 @@ import org.slf4j.LoggerFactory;
public Object getFieldValue(_Fields field) {
switch (field) {
case TABLET_ID:
- return new Integer(getTabletID());
+ return Integer.valueOf(getTabletID());
case SEQ:
- return new Long(getSeq());
+ return Long.valueOf(getSeq());
case MUTATIONS:
return getMutations();
@@ -400,84 +412,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: // TABLET_ID
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.tabletID = iprot.readI32();
- setTabletIDIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // SEQ
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.seq = iprot.readI64();
- setSeqIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // MUTATIONS
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list31 = iprot.readListBegin();
- this.mutations = new ArrayList<org.apache.accumulo.core.data.thrift.TMutation>(_list31.size);
- for (int _i32 = 0; _i32 < _list31.size; ++_i32)
- {
- org.apache.accumulo.core.data.thrift.TMutation _elem33;
- _elem33 = new org.apache.accumulo.core.data.thrift.TMutation();
- _elem33.read(iprot);
- this.mutations.add(_elem33);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(TABLET_ID_FIELD_DESC);
- oprot.writeI32(this.tabletID);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(SEQ_FIELD_DESC);
- oprot.writeI64(this.seq);
- oprot.writeFieldEnd();
- if (this.mutations != null) {
- oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.mutations.size()));
- for (org.apache.accumulo.core.data.thrift.TMutation _iter34 : this.mutations)
- {
- _iter34.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -526,5 +465,165 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TabletMutationsStandardSchemeFactory implements SchemeFactory {
+ public TabletMutationsStandardScheme getScheme() {
+ return new TabletMutationsStandardScheme();
+ }
+ }
+
+ private static class TabletMutationsStandardScheme extends StandardScheme<TabletMutations> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TabletMutations 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: // TABLET_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.tabletID = iprot.readI32();
+ struct.setTabletIDIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // SEQ
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.seq = iprot.readI64();
+ struct.setSeqIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // MUTATIONS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list62 = iprot.readListBegin();
+ struct.mutations = new ArrayList<org.apache.accumulo.core.data.thrift.TMutation>(_list62.size);
+ for (int _i63 = 0; _i63 < _list62.size; ++_i63)
+ {
+ org.apache.accumulo.core.data.thrift.TMutation _elem64; // required
+ _elem64 = new org.apache.accumulo.core.data.thrift.TMutation();
+ _elem64.read(iprot);
+ struct.mutations.add(_elem64);
+ }
+ iprot.readListEnd();
+ }
+ struct.setMutationsIsSet(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, TabletMutations struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(TABLET_ID_FIELD_DESC);
+ oprot.writeI32(struct.tabletID);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(SEQ_FIELD_DESC);
+ oprot.writeI64(struct.seq);
+ oprot.writeFieldEnd();
+ if (struct.mutations != null) {
+ oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size()));
+ for (org.apache.accumulo.core.data.thrift.TMutation _iter65 : struct.mutations)
+ {
+ _iter65.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TabletMutationsTupleSchemeFactory implements SchemeFactory {
+ public TabletMutationsTupleScheme getScheme() {
+ return new TabletMutationsTupleScheme();
+ }
+ }
+
+ private static class TabletMutationsTupleScheme extends TupleScheme<TabletMutations> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TabletMutations struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTabletID()) {
+ optionals.set(0);
+ }
+ if (struct.isSetSeq()) {
+ optionals.set(1);
+ }
+ if (struct.isSetMutations()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetTabletID()) {
+ oprot.writeI32(struct.tabletID);
+ }
+ if (struct.isSetSeq()) {
+ oprot.writeI64(struct.seq);
+ }
+ if (struct.isSetMutations()) {
+ {
+ oprot.writeI32(struct.mutations.size());
+ for (org.apache.accumulo.core.data.thrift.TMutation _iter66 : struct.mutations)
+ {
+ _iter66.write(oprot);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TabletMutations struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.tabletID = iprot.readI32();
+ struct.setTabletIDIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.seq = iprot.readI64();
+ struct.setSeqIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.mutations = new ArrayList<org.apache.accumulo.core.data.thrift.TMutation>(_list67.size);
+ for (int _i68 = 0; _i68 < _list67.size; ++_i68)
+ {
+ org.apache.accumulo.core.data.thrift.TMutation _elem69; // required
+ _elem69 = new org.apache.accumulo.core.data.thrift.TMutation();
+ _elem69.read(iprot);
+ struct.mutations.add(_elem69);
+ }
+ }
+ struct.setMutationsIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.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.tabletserver.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;
@@ -32,14 +39,20 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField QUERY_RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("queryRate", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
private static final org.apache.thrift.protocol.TField SPLIT_CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("splitCreationTime", org.apache.thrift.protocol.TType.I64, (short)8);
- public org.apache.accumulo.core.data.thrift.TKeyExtent extent;
- public ActionStats major;
- public ActionStats minor;
- public ActionStats split;
- public long numEntries;
- public double ingestRate;
- public double queryRate;
- public long splitCreationTime;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TabletStatsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TabletStatsTupleSchemeFactory());
+ }
+
+ public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required
+ public ActionStats major; // required
+ public ActionStats minor; // required
+ public ActionStats split; // required
+ public long numEntries; // required
+ public double ingestRate; // required
+ public double queryRate; // required
+ public long splitCreationTime; // 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 {
@@ -126,7 +139,6 @@ import org.slf4j.LoggerFactory;
private static final int __QUERYRATE_ISSET_ID = 2;
private static final int __SPLITCREATIONTIME_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);
@@ -494,16 +506,16 @@ import org.slf4j.LoggerFactory;
return getSplit();
case NUM_ENTRIES:
- return new Long(getNumEntries());
+ return Long.valueOf(getNumEntries());
case INGEST_RATE:
- return new Double(getIngestRate());
+ return Double.valueOf(getIngestRate());
case QUERY_RATE:
- return new Double(getQueryRate());
+ return Double.valueOf(getQueryRate());
case SPLIT_CREATION_TIME:
- return new Long(getSplitCreationTime());
+ return Long.valueOf(getSplitCreationTime());
}
throw new IllegalStateException();
@@ -725,128 +737,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: // EXTENT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
- this.extent.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // MAJOR
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.major = new ActionStats();
- this.major.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // MINOR
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.minor = new ActionStats();
- this.minor.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // SPLIT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.split = new ActionStats();
- this.split.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // NUM_ENTRIES
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.numEntries = iprot.readI64();
- setNumEntriesIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 6: // INGEST_RATE
- if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
- this.ingestRate = iprot.readDouble();
- setIngestRateIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 7: // QUERY_RATE
- if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
- this.queryRate = iprot.readDouble();
- setQueryRateIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 8: // SPLIT_CREATION_TIME
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.splitCreationTime = iprot.readI64();
- setSplitCreationTimeIsSet(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.extent != null) {
- oprot.writeFieldBegin(EXTENT_FIELD_DESC);
- this.extent.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.major != null) {
- oprot.writeFieldBegin(MAJOR_FIELD_DESC);
- this.major.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.minor != null) {
- oprot.writeFieldBegin(MINOR_FIELD_DESC);
- this.minor.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.split != null) {
- oprot.writeFieldBegin(SPLIT_FIELD_DESC);
- this.split.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(NUM_ENTRIES_FIELD_DESC);
- oprot.writeI64(this.numEntries);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(INGEST_RATE_FIELD_DESC);
- oprot.writeDouble(this.ingestRate);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(QUERY_RATE_FIELD_DESC);
- oprot.writeDouble(this.queryRate);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(SPLIT_CREATION_TIME_FIELD_DESC);
- oprot.writeI64(this.splitCreationTime);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -927,5 +822,250 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TabletStatsStandardSchemeFactory implements SchemeFactory {
+ public TabletStatsStandardScheme getScheme() {
+ return new TabletStatsStandardScheme();
+ }
+ }
+
+ private static class TabletStatsStandardScheme extends StandardScheme<TabletStats> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TabletStats 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: // EXTENT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
+ struct.extent.read(iprot);
+ struct.setExtentIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // MAJOR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.major = new ActionStats();
+ struct.major.read(iprot);
+ struct.setMajorIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // MINOR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.minor = new ActionStats();
+ struct.minor.read(iprot);
+ struct.setMinorIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // SPLIT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.split = new ActionStats();
+ struct.split.read(iprot);
+ struct.setSplitIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // NUM_ENTRIES
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.numEntries = iprot.readI64();
+ struct.setNumEntriesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // INGEST_RATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ struct.ingestRate = iprot.readDouble();
+ struct.setIngestRateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // QUERY_RATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ struct.queryRate = iprot.readDouble();
+ struct.setQueryRateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 8: // SPLIT_CREATION_TIME
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.splitCreationTime = iprot.readI64();
+ struct.setSplitCreationTimeIsSet(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, TabletStats struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.extent != null) {
+ oprot.writeFieldBegin(EXTENT_FIELD_DESC);
+ struct.extent.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.major != null) {
+ oprot.writeFieldBegin(MAJOR_FIELD_DESC);
+ struct.major.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.minor != null) {
+ oprot.writeFieldBegin(MINOR_FIELD_DESC);
+ struct.minor.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.split != null) {
+ oprot.writeFieldBegin(SPLIT_FIELD_DESC);
+ struct.split.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(NUM_ENTRIES_FIELD_DESC);
+ oprot.writeI64(struct.numEntries);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(INGEST_RATE_FIELD_DESC);
+ oprot.writeDouble(struct.ingestRate);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(QUERY_RATE_FIELD_DESC);
+ oprot.writeDouble(struct.queryRate);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(SPLIT_CREATION_TIME_FIELD_DESC);
+ oprot.writeI64(struct.splitCreationTime);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TabletStatsTupleSchemeFactory implements SchemeFactory {
+ public TabletStatsTupleScheme getScheme() {
+ return new TabletStatsTupleScheme();
+ }
+ }
+
+ private static class TabletStatsTupleScheme extends TupleScheme<TabletStats> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TabletStats struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetExtent()) {
+ optionals.set(0);
+ }
+ if (struct.isSetMajor()) {
+ optionals.set(1);
+ }
+ if (struct.isSetMinor()) {
+ optionals.set(2);
+ }
+ if (struct.isSetSplit()) {
+ optionals.set(3);
+ }
+ if (struct.isSetNumEntries()) {
+ optionals.set(4);
+ }
+ if (struct.isSetIngestRate()) {
+ optionals.set(5);
+ }
+ if (struct.isSetQueryRate()) {
+ optionals.set(6);
+ }
+ if (struct.isSetSplitCreationTime()) {
+ optionals.set(7);
+ }
+ oprot.writeBitSet(optionals, 8);
+ if (struct.isSetExtent()) {
+ struct.extent.write(oprot);
+ }
+ if (struct.isSetMajor()) {
+ struct.major.write(oprot);
+ }
+ if (struct.isSetMinor()) {
+ struct.minor.write(oprot);
+ }
+ if (struct.isSetSplit()) {
+ struct.split.write(oprot);
+ }
+ if (struct.isSetNumEntries()) {
+ oprot.writeI64(struct.numEntries);
+ }
+ if (struct.isSetIngestRate()) {
+ oprot.writeDouble(struct.ingestRate);
+ }
+ if (struct.isSetQueryRate()) {
+ oprot.writeDouble(struct.queryRate);
+ }
+ if (struct.isSetSplitCreationTime()) {
+ oprot.writeI64(struct.splitCreationTime);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TabletStats struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(8);
+ if (incoming.get(0)) {
+ struct.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
+ struct.extent.read(iprot);
+ struct.setExtentIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.major = new ActionStats();
+ struct.major.read(iprot);
+ struct.setMajorIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.minor = new ActionStats();
+ struct.minor.read(iprot);
+ struct.setMinorIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.split = new ActionStats();
+ struct.split.read(iprot);
+ struct.setSplitIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.numEntries = iprot.readI64();
+ struct.setNumEntriesIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.ingestRate = iprot.readDouble();
+ struct.setIngestRateIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.queryRate = iprot.readDouble();
+ struct.setQueryRateIsSet(true);
+ }
+ if (incoming.get(7)) {
+ struct.splitCreationTime = iprot.readI64();
+ struct.setSplitCreationTimeIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.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.tabletserver.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 EXTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("extent", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- public org.apache.accumulo.core.data.thrift.TKeyExtent extent;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TooManyFilesExceptionStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TooManyFilesExceptionTupleSchemeFactory());
+ }
+
+ public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // 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 {
@@ -86,7 +99,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);
@@ -239,45 +251,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: // EXTENT
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
- this.extent.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.extent != null) {
- oprot.writeFieldBegin(EXTENT_FIELD_DESC);
- this.extent.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -316,5 +294,91 @@ import org.slf4j.LoggerFactory;
}
}
+ private static class TooManyFilesExceptionStandardSchemeFactory implements SchemeFactory {
+ public TooManyFilesExceptionStandardScheme getScheme() {
+ return new TooManyFilesExceptionStandardScheme();
+ }
+ }
+
+ private static class TooManyFilesExceptionStandardScheme extends StandardScheme<TooManyFilesException> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TooManyFilesException 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: // EXTENT
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
+ struct.extent.read(iprot);
+ struct.setExtentIsSet(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, TooManyFilesException struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.extent != null) {
+ oprot.writeFieldBegin(EXTENT_FIELD_DESC);
+ struct.extent.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TooManyFilesExceptionTupleSchemeFactory implements SchemeFactory {
+ public TooManyFilesExceptionTupleScheme getScheme() {
+ return new TooManyFilesExceptionTupleScheme();
+ }
+ }
+
+ private static class TooManyFilesExceptionTupleScheme extends TupleScheme<TooManyFilesException> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TooManyFilesException struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetExtent()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetExtent()) {
+ struct.extent.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TooManyFilesException struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
+ struct.extent.read(iprot);
+ struct.setExtentIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-672/core/src/main/thrift/thrift.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/core/src/main/thrift/thrift.sh?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/core/src/main/thrift/thrift.sh (original)
+++ accumulo/branches/ACCUMULO-672/core/src/main/thrift/thrift.sh Thu Jul 5 19:39:03 2012
@@ -22,7 +22,7 @@ fail() {
}
# test to see if we have thrift installed
-VERSION=`thrift -version 2>/dev/null | grep "0.6" | wc -l`
+VERSION=`thrift -version 2>/dev/null | grep "0.8" | wc -l`
if [ "$VERSION" -ne 1 ] ; then
# Nope: bail
echo "thrift is not available"
Modified: accumulo/branches/ACCUMULO-672/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java (original)
+++ accumulo/branches/ACCUMULO-672/server/src/main/java/org/apache/accumulo/server/test/performance/thrift/NullTserver.java Thu Jul 5 19:39:03 2012
@@ -47,6 +47,8 @@ import org.apache.accumulo.core.security
import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
import org.apache.accumulo.core.tabletserver.thrift.ActiveScan;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
+import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface;
+import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Processor;
import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.server.client.ClientServiceHandler;
@@ -205,7 +207,7 @@ public class NullTserver {
TransactionWatcher watcher = new TransactionWatcher();
ThriftClientHandler tch = new ThriftClientHandler(HdfsZooInstance.getInstance(), watcher);
- TabletClientService.Processor processor = new TabletClientService.Processor(tch);
+ Processor<Iface> processor = new Processor<Iface>(tch);
TServerUtils.startTServer(port, processor, "NullTServer", "null tserver", 2, 1000);
InetSocketAddress addr = new InetSocketAddress(InetAddress.getLocalHost(), port);
Modified: accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/thrift/TraceWrap.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/thrift/TraceWrap.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/thrift/TraceWrap.java (original)
+++ accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/thrift/TraceWrap.java Thu Jul 5 19:39:03 2012
@@ -25,6 +25,7 @@ import org.apache.accumulo.cloudtrace.in
import org.apache.accumulo.cloudtrace.instrument.Trace;
import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.cloudtrace.thrift.TInfo;
+import org.apache.log4j.Logger;
/**
Modified: accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java (original)
+++ accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/RemoteSpan.java Thu Jul 5 19:39:03 2012
@@ -1,12 +1,33 @@
/**
- * 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.cloudtrace.thrift;
-public class RemoteSpan implements org.apache.thrift.TBase<RemoteSpan, RemoteSpan._Fields>, java.io.Serializable, Cloneable {
-private static final long serialVersionUID = 1L;
+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;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class RemoteSpan implements org.apache.thrift.TBase<RemoteSpan, RemoteSpan._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteSpan");
private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)1);
@@ -19,15 +40,21 @@ private static final long serialVersionU
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)8);
private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.MAP, (short)9);
- public String sender;
- public String svc;
- public long traceId;
- public long spanId;
- public long parentId;
- public long start;
- public long stop;
- public String description;
- public java.util.Map<String,String> data;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new RemoteSpanStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new RemoteSpanTupleSchemeFactory());
+ }
+
+ public String sender; // required
+ public String svc; // required
+ public long traceId; // required
+ public long spanId; // required
+ public long parentId; // required
+ public long start; // required
+ public long stop; // required
+ public String description; // required
+ public Map<String,String> data; // 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 {
@@ -41,10 +68,10 @@ private static final long serialVersionU
DESCRIPTION((short)8, "description"),
DATA((short)9, "data");
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
- for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@@ -117,11 +144,10 @@ private static final long serialVersionU
private static final int __PARENTID_ISSET_ID = 2;
private static final int __START_ISSET_ID = 3;
private static final int __STOP_ISSET_ID = 4;
- private java.util.BitSet __isset_bit_vector = new java.util.BitSet(5);
-
- public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ private BitSet __isset_bit_vector = new BitSet(5);
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.SVC, new org.apache.thrift.meta_data.FieldMetaData("svc", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -142,7 +168,7 @@ private static final long serialVersionU
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoteSpan.class, metaDataMap);
}
@@ -158,7 +184,7 @@ private static final long serialVersionU
long start,
long stop,
String description,
- java.util.Map<String,String> data)
+ Map<String,String> data)
{
this();
this.sender = sender;
@@ -198,8 +224,8 @@ private static final long serialVersionU
this.description = other.description;
}
if (other.isSetData()) {
- java.util.Map<String,String> __this__data = new java.util.HashMap<String,String>();
- for (java.util.Map.Entry<String, String> other_element : other.data.entrySet()) {
+ Map<String,String> __this__data = new HashMap<String,String>();
+ for (Map.Entry<String, String> other_element : other.data.entrySet()) {
String other_element_key = other_element.getKey();
String other_element_value = other_element.getValue();
@@ -429,16 +455,16 @@ private static final long serialVersionU
public void putToData(String key, String val) {
if (this.data == null) {
- this.data = new java.util.HashMap<String,String>();
+ this.data = new HashMap<String,String>();
}
this.data.put(key, val);
}
- public java.util.Map<String,String> getData() {
+ public Map<String,String> getData() {
return this.data;
}
- public RemoteSpan setData(java.util.Map<String,String> data) {
+ public RemoteSpan setData(Map<String,String> data) {
this.data = data;
return this;
}
@@ -528,9 +554,7 @@ private static final long serialVersionU
if (value == null) {
unsetData();
} else {
- @SuppressWarnings("unchecked")
- java.util.Map<String,String> x = (java.util.Map<String,String>)value;
- setData(x);
+ setData((Map<String,String>)value);
}
break;
@@ -546,19 +570,19 @@ private static final long serialVersionU
return getSvc();
case TRACE_ID:
- return new Long(getTraceId());
+ return Long.valueOf(getTraceId());
case SPAN_ID:
- return new Long(getSpanId());
+ return Long.valueOf(getSpanId());
case PARENT_ID:
- return new Long(getParentId());
+ return Long.valueOf(getParentId());
case START:
- return new Long(getStart());
+ return Long.valueOf(getStart());
case STOP:
- return new Long(getStop());
+ return Long.valueOf(getStop());
case DESCRIPTION:
return getDescription();
@@ -807,155 +831,11 @@ private static final long serialVersionU
}
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: // SENDER
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.sender = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // SVC
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.svc = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // TRACE_ID
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.traceId = iprot.readI64();
- setTraceIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // SPAN_ID
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.spanId = iprot.readI64();
- setSpanIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // PARENT_ID
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.parentId = iprot.readI64();
- setParentIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 6: // START
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.start = iprot.readI64();
- setStartIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 7: // STOP
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.stop = iprot.readI64();
- setStopIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 8: // 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;
- case 9: // DATA
- if (field.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
- this.data = new java.util.HashMap<String,String>(2*_map0.size);
- for (int _i1 = 0; _i1 < _map0.size; ++_i1)
- {
- String _key2;
- String _val3;
- _key2 = iprot.readString();
- _val3 = iprot.readString();
- this.data.put(_key2, _val3);
- }
- iprot.readMapEnd();
- }
- } 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.sender != null) {
- oprot.writeFieldBegin(SENDER_FIELD_DESC);
- oprot.writeString(this.sender);
- oprot.writeFieldEnd();
- }
- if (this.svc != null) {
- oprot.writeFieldBegin(SVC_FIELD_DESC);
- oprot.writeString(this.svc);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(TRACE_ID_FIELD_DESC);
- oprot.writeI64(this.traceId);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(SPAN_ID_FIELD_DESC);
- oprot.writeI64(this.spanId);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(PARENT_ID_FIELD_DESC);
- oprot.writeI64(this.parentId);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(START_FIELD_DESC);
- oprot.writeI64(this.start);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(STOP_FIELD_DESC);
- oprot.writeI64(this.stop);
- oprot.writeFieldEnd();
- if (this.description != null) {
- oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
- oprot.writeString(this.description);
- oprot.writeFieldEnd();
- }
- if (this.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.data.size()));
- for (java.util.Map.Entry<String, String> _iter4 : this.data.entrySet())
- {
- oprot.writeString(_iter4.getKey());
- oprot.writeString(_iter4.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -1033,12 +913,308 @@ private static final long serialVersionU
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bit_vector = new java.util.BitSet(1);
+ __isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
+ private static class RemoteSpanStandardSchemeFactory implements SchemeFactory {
+ public RemoteSpanStandardScheme getScheme() {
+ return new RemoteSpanStandardScheme();
+ }
+ }
+
+ private static class RemoteSpanStandardScheme extends StandardScheme<RemoteSpan> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteSpan 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: // SENDER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.sender = iprot.readString();
+ struct.setSenderIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // SVC
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.svc = iprot.readString();
+ struct.setSvcIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // TRACE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.traceId = iprot.readI64();
+ struct.setTraceIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // SPAN_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.spanId = iprot.readI64();
+ struct.setSpanIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // PARENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.parentId = iprot.readI64();
+ struct.setParentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // START
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.start = iprot.readI64();
+ struct.setStartIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // STOP
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.stop = iprot.readI64();
+ struct.setStopIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 8: // 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;
+ case 9: // DATA
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
+ struct.data = new HashMap<String,String>(2*_map0.size);
+ for (int _i1 = 0; _i1 < _map0.size; ++_i1)
+ {
+ String _key2; // required
+ String _val3; // required
+ _key2 = iprot.readString();
+ _val3 = iprot.readString();
+ struct.data.put(_key2, _val3);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setDataIsSet(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, RemoteSpan struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.sender != null) {
+ oprot.writeFieldBegin(SENDER_FIELD_DESC);
+ oprot.writeString(struct.sender);
+ oprot.writeFieldEnd();
+ }
+ if (struct.svc != null) {
+ oprot.writeFieldBegin(SVC_FIELD_DESC);
+ oprot.writeString(struct.svc);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(TRACE_ID_FIELD_DESC);
+ oprot.writeI64(struct.traceId);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(SPAN_ID_FIELD_DESC);
+ oprot.writeI64(struct.spanId);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(PARENT_ID_FIELD_DESC);
+ oprot.writeI64(struct.parentId);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(START_FIELD_DESC);
+ oprot.writeI64(struct.start);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(STOP_FIELD_DESC);
+ oprot.writeI64(struct.stop);
+ oprot.writeFieldEnd();
+ if (struct.description != null) {
+ oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
+ oprot.writeString(struct.description);
+ oprot.writeFieldEnd();
+ }
+ if (struct.data != null) {
+ oprot.writeFieldBegin(DATA_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.data.size()));
+ for (Map.Entry<String, String> _iter4 : struct.data.entrySet())
+ {
+ oprot.writeString(_iter4.getKey());
+ oprot.writeString(_iter4.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class RemoteSpanTupleSchemeFactory implements SchemeFactory {
+ public RemoteSpanTupleScheme getScheme() {
+ return new RemoteSpanTupleScheme();
+ }
+ }
+
+ private static class RemoteSpanTupleScheme extends TupleScheme<RemoteSpan> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, RemoteSpan struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSender()) {
+ optionals.set(0);
+ }
+ if (struct.isSetSvc()) {
+ optionals.set(1);
+ }
+ if (struct.isSetTraceId()) {
+ optionals.set(2);
+ }
+ if (struct.isSetSpanId()) {
+ optionals.set(3);
+ }
+ if (struct.isSetParentId()) {
+ optionals.set(4);
+ }
+ if (struct.isSetStart()) {
+ optionals.set(5);
+ }
+ if (struct.isSetStop()) {
+ optionals.set(6);
+ }
+ if (struct.isSetDescription()) {
+ optionals.set(7);
+ }
+ if (struct.isSetData()) {
+ optionals.set(8);
+ }
+ oprot.writeBitSet(optionals, 9);
+ if (struct.isSetSender()) {
+ oprot.writeString(struct.sender);
+ }
+ if (struct.isSetSvc()) {
+ oprot.writeString(struct.svc);
+ }
+ if (struct.isSetTraceId()) {
+ oprot.writeI64(struct.traceId);
+ }
+ if (struct.isSetSpanId()) {
+ oprot.writeI64(struct.spanId);
+ }
+ if (struct.isSetParentId()) {
+ oprot.writeI64(struct.parentId);
+ }
+ if (struct.isSetStart()) {
+ oprot.writeI64(struct.start);
+ }
+ if (struct.isSetStop()) {
+ oprot.writeI64(struct.stop);
+ }
+ if (struct.isSetDescription()) {
+ oprot.writeString(struct.description);
+ }
+ if (struct.isSetData()) {
+ {
+ oprot.writeI32(struct.data.size());
+ for (Map.Entry<String, String> _iter5 : struct.data.entrySet())
+ {
+ oprot.writeString(_iter5.getKey());
+ oprot.writeString(_iter5.getValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, RemoteSpan struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(9);
+ if (incoming.get(0)) {
+ struct.sender = iprot.readString();
+ struct.setSenderIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.svc = iprot.readString();
+ struct.setSvcIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.traceId = iprot.readI64();
+ struct.setTraceIdIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.spanId = iprot.readI64();
+ struct.setSpanIdIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.parentId = iprot.readI64();
+ struct.setParentIdIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.start = iprot.readI64();
+ struct.setStartIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.stop = iprot.readI64();
+ struct.setStopIsSet(true);
+ }
+ if (incoming.get(7)) {
+ struct.description = iprot.readString();
+ struct.setDescriptionIsSet(true);
+ }
+ if (incoming.get(8)) {
+ {
+ org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.data = new HashMap<String,String>(2*_map6.size);
+ for (int _i7 = 0; _i7 < _map6.size; ++_i7)
+ {
+ String _key8; // required
+ String _val9; // required
+ _key8 = iprot.readString();
+ _val9 = iprot.readString();
+ struct.data.put(_key8, _val9);
+ }
+ }
+ struct.setDataIsSet(true);
+ }
+ }
+ }
+
}
Modified: accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java?rev=1357829&r1=1357828&r2=1357829&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java (original)
+++ accumulo/branches/ACCUMULO-672/trace/src/main/java/org/apache/accumulo/cloudtrace/thrift/SpanReceiver.java Thu Jul 5 19:39:03 2012
@@ -1,11 +1,33 @@
/**
- * 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.cloudtrace.thrift;
-public class SpanReceiver {
+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;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class SpanReceiver {
public interface Iface {
@@ -19,7 +41,7 @@ public class SpanReceiver {
}
- public static class Client implements org.apache.thrift.TServiceClient, Iface {
+ public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
@@ -32,28 +54,11 @@ public class SpanReceiver {
public Client(org.apache.thrift.protocol.TProtocol prot)
{
- this(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot)
- {
- iprot_ = iprot;
- oprot_ = oprot;
+ super(prot, prot);
}
- protected org.apache.thrift.protocol.TProtocol iprot_;
- protected org.apache.thrift.protocol.TProtocol oprot_;
-
- protected int seqid_;
-
- public org.apache.thrift.protocol.TProtocol getInputProtocol()
- {
- return this.iprot_;
- }
-
- public org.apache.thrift.protocol.TProtocol getOutputProtocol()
- {
- return this.oprot_;
+ public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ super(iprot, oprot);
}
public void span(RemoteSpan span) throws org.apache.thrift.TException
@@ -63,12 +68,9 @@ public class SpanReceiver {
public void send_span(RemoteSpan span) throws org.apache.thrift.TException
{
- oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("span", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_));
span_args args = new span_args();
args.setSpan(span);
- args.write(oprot_);
- oprot_.writeMessageEnd();
- oprot_.getTransport().flush();
+ sendBase("span", args);
}
}
@@ -91,15 +93,13 @@ public class SpanReceiver {
public void span(RemoteSpan span, org.apache.thrift.async.AsyncMethodCallback<span_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
- span_call method_call = new span_call(span, resultHandler, this, protocolFactory, transport);
- this.currentMethod = method_call;
- manager.call(method_call);
+ span_call method_call = new span_call(span, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
}
- @SuppressWarnings("rawtypes")
public static class span_call extends org.apache.thrift.async.TAsyncMethodCall {
private RemoteSpan span;
- @SuppressWarnings("unchecked")
public span_call(RemoteSpan span, org.apache.thrift.async.AsyncMethodCallback<span_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, true);
this.span = span;
@@ -117,83 +117,66 @@ public class SpanReceiver {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
}
}
}
- public static class Processor implements org.apache.thrift.TProcessor {
- private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
- public Processor(Iface iface)
- {
- iface_ = iface;
- processMap_.put("span", new span());
+ public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+ public Processor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
- protected static interface ProcessFunction {
- public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException;
+ protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ super(iface, getProcessMap(processMap));
}
- private Iface iface_;
- protected final java.util.HashMap<String,ProcessFunction> processMap_ = new java.util.HashMap<String,ProcessFunction>();
+ private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ processMap.put("span", new span());
+ return processMap;
+ }
- public boolean process(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
- {
- org.apache.thrift.protocol.TMessage msg = iprot.readMessageBegin();
- ProcessFunction fn = processMap_.get(msg.name);
- if (fn == null) {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, org.apache.thrift.protocol.TType.STRUCT);
- iprot.readMessageEnd();
- org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(msg.name, org.apache.thrift.protocol.TMessageType.EXCEPTION, msg.seqid));
- x.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
- return true;
+ private static class span<I extends Iface> extends org.apache.thrift.ProcessFunction<I, span_args> {
+ public span() {
+ super("span");
}
- fn.process(msg.seqid, iprot, oprot);
- return true;
- }
- private class span implements ProcessFunction {
- public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
- {
- span_args args = new span_args();
- try {
- args.read(iprot);
- } catch (org.apache.thrift.protocol.TProtocolException e) {
- iprot.readMessageEnd();
- org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage());
- oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("span", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid));
- x.write(oprot);
- oprot.writeMessageEnd();
- oprot.getTransport().flush();
- return;
- }
- iprot.readMessageEnd();
- iface_.span(args.span);
- return;
+ protected span_args getEmptyArgsInstance() {
+ return new span_args();
+ }
+
+ protected org.apache.thrift.TBase getResult(I iface, span_args args) throws org.apache.thrift.TException {
+ iface.span(args.span);
+ return null;
}
}
}
public static class span_args implements org.apache.thrift.TBase<span_args, span_args._Fields>, java.io.Serializable, Cloneable {
-private static final long serialVersionUID = 1L;
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("span_args");
private static final org.apache.thrift.protocol.TField SPAN_FIELD_DESC = new org.apache.thrift.protocol.TField("span", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- public RemoteSpan span;
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new span_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new span_argsTupleSchemeFactory());
+ }
+
+ public RemoteSpan span; // 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 {
SPAN((short)1, "span");
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
- for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@@ -245,13 +228,12 @@ private static final long serialVersionU
}
// isset id assignments
-
- public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SPAN, new org.apache.thrift.meta_data.FieldMetaData("span", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RemoteSpan.class)));
- metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(span_args.class, metaDataMap);
}
@@ -398,56 +380,25 @@ private static final long serialVersionU
}
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: // SPAN
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.span = new RemoteSpan();
- this.span.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.span != null) {
- oprot.writeFieldBegin(SPAN_FIELD_DESC);
- this.span.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("span_args(");
+ boolean first = true;
+
sb.append("span:");
if (this.span == null) {
sb.append("null");
} else {
sb.append(this.span);
}
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -472,6 +423,92 @@ private static final long serialVersionU
}
}
+ private static class span_argsStandardSchemeFactory implements SchemeFactory {
+ public span_argsStandardScheme getScheme() {
+ return new span_argsStandardScheme();
+ }
+ }
+
+ private static class span_argsStandardScheme extends StandardScheme<span_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, span_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // SPAN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.span = new RemoteSpan();
+ struct.span.read(iprot);
+ struct.setSpanIsSet(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, span_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.span != null) {
+ oprot.writeFieldBegin(SPAN_FIELD_DESC);
+ struct.span.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class span_argsTupleSchemeFactory implements SchemeFactory {
+ public span_argsTupleScheme getScheme() {
+ return new span_argsTupleScheme();
+ }
+ }
+
+ private static class span_argsTupleScheme extends TupleScheme<span_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, span_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSpan()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSpan()) {
+ struct.span.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, span_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.span = new RemoteSpan();
+ struct.span.read(iprot);
+ struct.setSpanIsSet(true);
+ }
+ }
+ }
+
}
}