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 [11/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/tabletserver/thrift/TabletMutations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.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.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/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.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.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/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.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.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/trunk/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java Tue Jul 10 12:39:52 2012
@@ -18,7 +18,8 @@ package org.apache.accumulo.core.util;
import java.net.InetSocketAddress;
-import org.apache.accumulo.cloudtrace.instrument.thrift.TraceWrap;
+import org.apache.accumulo.cloudtrace.instrument.Span;
+import org.apache.accumulo.cloudtrace.instrument.Trace;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.impl.ClientExec;
@@ -29,9 +30,12 @@ import org.apache.accumulo.core.conf.Pro
import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
import org.apache.log4j.Logger;
+import org.apache.thrift.TException;
import org.apache.thrift.TServiceClient;
import org.apache.thrift.TServiceClientFactory;
import org.apache.thrift.protocol.TCompactProtocol;
+import org.apache.thrift.protocol.TMessage;
+import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.protocol.TProtocolFactory;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TTransport;
@@ -41,12 +45,42 @@ import org.apache.thrift.transport.TTran
public class ThriftUtil {
private static final Logger log = Logger.getLogger(ThriftUtil.class);
+
+ public static class TraceProtocol extends TCompactProtocol {
+
+ @Override
+ public void writeMessageBegin(TMessage message) throws TException {
+ Trace.start("client:" + message.name);
+ super.writeMessageBegin(message);
+ }
+
+ @Override
+ public void writeMessageEnd() throws TException {
+ super.writeMessageEnd();
+ Span currentTrace = Trace.currentTrace();
+ if (currentTrace != null)
+ currentTrace.stop();
+ }
+
+ public TraceProtocol(TTransport transport) {
+ super(transport);
+ }
+ }
+
+ public static class TraceProtocolFactory extends TCompactProtocol.Factory {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public TProtocol getProtocol(TTransport trans) {
+ return new TraceProtocol(trans);
+ }
+ }
- static private TProtocolFactory protocolFactory = new TCompactProtocol.Factory();
+ static private TProtocolFactory protocolFactory = new TraceProtocolFactory();
static private TTransportFactory transportFactory = new TFramedTransport.Factory();
static public <T extends TServiceClient> T createClient(TServiceClientFactory<T> factory, TTransport transport) {
- return TraceWrap.client(factory.getClient(protocolFactory.getProtocol(transport), protocolFactory.getProtocol(transport)));
+ return factory.getClient(protocolFactory.getProtocol(transport), protocolFactory.getProtocol(transport));
}
static public <T extends TServiceClient> T getClient(TServiceClientFactory<T> factory, InetSocketAddress address, AccumuloConfiguration conf)
@@ -68,21 +102,20 @@ public class ThriftUtil {
return createClient(factory, transport);
}
- static public void returnClient(Object iface) { // Eew... the typing here is horrible
+ static public void returnClient(TServiceClient iface) { // Eew... the typing here is horrible
if (iface != null) {
- TServiceClient client = (TServiceClient) iface;
- ThriftTransportPool.getInstance().returnTransport(client.getInputProtocol().getTransport());
+ ThriftTransportPool.getInstance().returnTransport(iface.getInputProtocol().getTransport());
}
}
- static public TabletClientService.Iface getTServerClient(String address, AccumuloConfiguration conf) throws TTransportException {
+ static public TabletClientService.Client getTServerClient(String address, AccumuloConfiguration conf) throws TTransportException {
return getClient(new TabletClientService.Client.Factory(), address, Property.TSERV_CLIENTPORT, Property.GENERAL_RPC_TIMEOUT, conf);
}
- public static void execute(String address, AccumuloConfiguration conf, ClientExec<TabletClientService.Iface> exec) throws AccumuloException,
+ public static void execute(String address, AccumuloConfiguration conf, ClientExec<TabletClientService.Client> exec) throws AccumuloException,
AccumuloSecurityException {
while (true) {
- TabletClientService.Iface client = null;
+ TabletClientService.Client client = null;
try {
exec.execute(client = getTServerClient(address, conf));
break;
@@ -100,10 +133,10 @@ public class ThriftUtil {
}
}
- public static <T> T execute(String address, AccumuloConfiguration conf, ClientExecReturn<T,TabletClientService.Iface> exec) throws AccumuloException,
+ public static <T> T execute(String address, AccumuloConfiguration conf, ClientExecReturn<T,TabletClientService.Client> exec) throws AccumuloException,
AccumuloSecurityException {
while (true) {
- TabletClientService.Iface client = null;
+ TabletClientService.Client client = null;
try {
return exec.execute(client = getTServerClient(address, conf));
} catch (TTransportException tte) {
Modified: accumulo/trunk/core/src/main/thrift/thrift.sh
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/thrift/thrift.sh?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/thrift/thrift.sh (original)
+++ accumulo/trunk/core/src/main/thrift/thrift.sh Tue Jul 10 12:39:52 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/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java (original)
+++ accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java Tue Jul 10 12:39:52 2012
@@ -17,8 +17,8 @@
package org.apache.accumulo.examples.wikisearch.iterator;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Map;
import org.apache.accumulo.core.data.ArrayByteSequence;
@@ -47,8 +47,7 @@ public class AndIterator implements Sort
private Text currentRow = null;
private Text currentTerm = new Text(emptyByteArray);
private Text currentDocID = new Text(emptyByteArray);
- private Collection<ByteSequence> seekColumnFamilies;
- private boolean inclusive;
+ private static boolean SEEK_INCLUSIVE = true;
private Text parentEndRow;
/**
@@ -60,24 +59,21 @@ public class AndIterator implements Sort
public Text dataLocation;
public Text term;
public boolean notFlag;
+ private Collection<ByteSequence> seekColumnFamilies;
- public TermSource(TermSource other) {
- this.iter = other.iter;
- this.dataLocation = other.dataLocation;
- this.term = other.term;
- this.notFlag = other.notFlag;
+ private TermSource(TermSource other) {
+ this(other.iter, other.dataLocation, other.term, other.notFlag);
}
public TermSource(SortedKeyValueIterator<Key,Value> iter, Text dataLocation, Text term) {
- this.iter = iter;
- this.dataLocation = dataLocation;
- this.term = term;
- this.notFlag = false;
+ this(iter, dataLocation, term, false);
}
public TermSource(SortedKeyValueIterator<Key,Value> iter, Text dataLocation, Text term, boolean notFlag) {
this.iter = iter;
this.dataLocation = dataLocation;
+ ByteSequence bs = new ArrayByteSequence(dataLocation.getBytes(), 0, dataLocation.getLength());
+ this.seekColumnFamilies = Collections.singletonList(bs);
this.term = term;
this.notFlag = notFlag;
}
@@ -203,6 +199,7 @@ public class AndIterator implements Sort
sources[i] = new TermSource(other.sources[i].iter.deepCopy(env), other.sources[i].dataLocation, other.sources[i].term);
}
}
+ //other.seekColumnFamilies = other.seekColumnFamilies;
}
public Key getTopKey() {
@@ -305,8 +302,7 @@ public class AndIterator implements Sort
if (log.isDebugEnabled()) {
log.debug("Seeking to: " + seekKey);
}
-
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
continue;
}
@@ -352,7 +348,7 @@ public class AndIterator implements Sort
log.debug("Seeking to: " + seekKey);
}
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
if (!ts.iter.hasTop()) {
currentRow = null;
return true;
@@ -385,8 +381,7 @@ public class AndIterator implements Sort
if (log.isDebugEnabled()) {
log.debug("Seeking to: " + seekKey);
}
-
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
if (!ts.iter.hasTop()) {
currentRow = null;
return true;
@@ -407,14 +402,13 @@ public class AndIterator implements Sort
if (log.isDebugEnabled()) {
log.debug("Need to seek to the right term");
}
-
Key seekKey = buildKey(currentRow, ts.dataLocation, new Text(ts.term + "\0"));// new Text(ts.term + "\0" + currentDocID));
if (log.isDebugEnabled()) {
log.debug("Seeking to: " + seekKey);
}
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
if (!ts.iter.hasTop()) {
currentRow = null;
return true;
@@ -451,7 +445,7 @@ public class AndIterator implements Sort
log.debug("Seeking to: " + seekKey);
}
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
if (!ts.iter.hasTop()) {
currentRow = null;
@@ -486,7 +480,7 @@ public class AndIterator implements Sort
log.debug("Seeking to: " + seekKey);
}
- ts.iter.seek(new Range(seekKey, true, null, false), seekColumnFamilies, inclusive);
+ ts.iter.seek(new Range(seekKey, true, null, false), ts.seekColumnFamilies, SEEK_INCLUSIVE);
continue;
}
@@ -749,8 +743,7 @@ public class AndIterator implements Sort
// Build up the array of sources that are to be intersected
sources = new TermSource[dataLocations.length];
- sources[0] = new TermSource(source, dataLocations[0], terms[0]);
- for (int i = 1; i < dataLocations.length; i++) {
+ for (int i = 0; i < dataLocations.length; i++) {
sources[i] = new TermSource(source.deepCopy(env), dataLocations[i], terms[i], notFlags[i]);
}
@@ -764,10 +757,10 @@ public class AndIterator implements Sort
}
currentRow = new Text();
currentDocID.set(emptyByteArray);
- doSeek(range, seekColumnFamilies, inclusive);
+ doSeek(range);
}
- private void doSeek(Range range, Collection<ByteSequence> seekColumnFamilies, boolean inclusive) throws IOException {
+ private void doSeek(Range range) throws IOException {
overallRange = new Range(range);
@@ -775,18 +768,13 @@ public class AndIterator implements Sort
this.parentEndRow = range.getEndKey().getRow();
}
- this.seekColumnFamilies = seekColumnFamilies;
- this.inclusive = inclusive;
-
// seek each of the sources to the right column family within the row given by key
for (int i = 0; i < sourcesCount; i++) {
Key sourceKey;
Text dataLocation = (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation;
- Collection<ByteSequence> columnFamilies = new ArrayList<ByteSequence>();
- columnFamilies.add(new ArrayByteSequence(dataLocation.getBytes(), 0, dataLocation.getLength()));
if (range.getStartKey() != null) {
// Build a key with the DocID if one is given
- if (range.getStartKey().getColumnFamily() != null) {
+ if (range.getStartKey().getColumnFamily() != null) {
sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation,
(sources[i].term == null) ? nullText : new Text(sources[i].term + "\0" + range.getStartKey().getColumnFamily()));
} // Build a key with just the term.
@@ -796,9 +784,9 @@ public class AndIterator implements Sort
}
if (!range.isStartKeyInclusive())
sourceKey = sourceKey.followingKey(PartialKey.ROW_COLFAM_COLQUAL);
- sources[i].iter.seek(new Range(sourceKey, true, null, false), columnFamilies, inclusive);
+ sources[i].iter.seek(new Range(sourceKey, true, null, false), sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
} else {
- sources[i].iter.seek(range, columnFamilies, inclusive);
+ sources[i].iter.seek(range, sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
}
}
@@ -882,7 +870,7 @@ public class AndIterator implements Sort
}
Key sKey = new Key(jumpKey.getRow());
Range fake = new Range(sKey, true, endKey, false);
- this.seek(fake, this.seekColumnFamilies, false);
+ this.seek(fake, null, false);
return hasTop();
} else {
// need to check uid
@@ -912,7 +900,7 @@ public class AndIterator implements Sort
this.currentRow = row;
this.currentDocID = new Text(this.getUID(jumpKey));
- doSeek(range, seekColumnFamilies, false);
+ doSeek(range);
// make sure it is in the range if we have one.
if (hasTop() && parentEndRow != null && topKey.getRow().compareTo(parentEndRow) > 0) {
Modified: accumulo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/pom.xml?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/pom.xml (original)
+++ accumulo/trunk/pom.xml Tue Jul 10 12:39:52 2012
@@ -600,7 +600,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
- <version>0.6.1</version>
+ <version>0.8.0</version>
</dependency>
<dependency>
<groupId>jline</groupId>
Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
Reverse-merged /incubator/accumulo/trunk/src/server:r1178656-1201898
Merged /accumulo/branches/1.4/server:r1358206
Merged /accumulo/branches/ACCUMULO-672/server:r1357826,1357829,1357842,1357858,1358236
Merged /accumulo/branches/1.4/src/server:r1358206
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java Tue Jul 10 12:39:52 2012
@@ -33,6 +33,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.cloudtrace.instrument.TraceRunnable;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -130,7 +131,7 @@ public class BulkImporter {
throw new RuntimeException("Directory does not exist " + failureDir);
}
- ClientService.Iface client = null;
+ ClientService.Client client = null;
final TabletLocator locator = TabletLocator.getInstance(instance, credentials, new Text(tableId));
try {
@@ -591,7 +592,7 @@ public class BulkImporter {
}
log.debug("Asking " + location + " to bulk load " + files);
- List<TKeyExtent> failures = client.bulkImport(null, credentials, tid, Translator.translate(files, Translator.KET), setTime);
+ List<TKeyExtent> failures = client.bulkImport(Tracer.traceInfo(), credentials, tid, Translator.translate(files, Translator.KET), setTime);
return Translator.translate(failures, Translator.TKET);
} finally {
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java Tue Jul 10 12:39:52 2012
@@ -28,6 +28,7 @@ import java.util.UUID;
import org.apache.accumulo.cloudtrace.instrument.Span;
import org.apache.accumulo.cloudtrace.instrument.Trace;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -35,6 +36,7 @@ import org.apache.accumulo.core.conf.Pro
import org.apache.accumulo.core.gc.thrift.GCStatus;
import org.apache.accumulo.core.gc.thrift.GcCycleStats;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
+import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Client;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface;
import org.apache.accumulo.core.util.ThriftUtil;
import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -137,10 +139,10 @@ public class GarbageCollectWriteAheadLog
InetSocketAddress address = AddressUtil.parseAddress(entry.getKey(), Property.TSERV_CLIENTPORT);
if (!holdsLock(address))
continue;
- Iface tserver = null;
+ Client tserver = null;
try {
tserver = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
- tserver.removeLogs(null, SecurityConstants.getSystemCredentials(), entry.getValue());
+ tserver.removeLogs(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), entry.getValue());
log.debug("deleted " + entry.getValue() + " from " + entry.getKey());
status.currentLog.deleted += entry.getValue().size();
} catch (TException e) {
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Tue Jul 10 12:39:52 2012
@@ -58,6 +58,7 @@ import org.apache.accumulo.core.file.Fil
import org.apache.accumulo.core.file.FileUtil;
import org.apache.accumulo.core.gc.thrift.GCMonitorService;
import org.apache.accumulo.core.gc.thrift.GCMonitorService.Iface;
+import org.apache.accumulo.core.gc.thrift.GCMonitorService.Processor;
import org.apache.accumulo.core.gc.thrift.GCStatus;
import org.apache.accumulo.core.gc.thrift.GcCycleStats;
import org.apache.accumulo.core.master.state.tables.TableState;
@@ -375,7 +376,7 @@ public class SimpleGarbageCollector impl
}
private InetSocketAddress startStatsService() throws UnknownHostException {
- GCMonitorService.Processor processor = new GCMonitorService.Processor(TraceWrap.service(this));
+ Processor<Iface> processor = new Processor<Iface>(TraceWrap.service(this));
int port = instance.getConfiguration().getPort(Property.GC_PORT);
try {
TServerUtils.startTServer(port, processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, 1000);
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java Tue Jul 10 12:39:52 2012
@@ -26,6 +26,8 @@ import java.util.Map;
import java.util.Set;
import java.util.TimerTask;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
+import org.apache.accumulo.cloudtrace.instrument.thrift.TraceWrap;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -79,54 +81,54 @@ public class LiveTServerSet implements W
}
public void assignTablet(ZooLock lock, KeyExtent extent) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.loadTablet(null, SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
+ client.loadTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
} finally {
ThriftUtil.returnClient(client);
}
}
public void unloadTablet(ZooLock lock, KeyExtent extent, boolean save) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.unloadTablet(null, SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift(), save);
+ client.unloadTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift(), save);
} finally {
ThriftUtil.returnClient(client);
}
}
public TabletServerStatus getTableMap() throws TException, ThriftSecurityException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- return client.getTabletServerStatus(null, SecurityConstants.getSystemCredentials());
+ return client.getTabletServerStatus(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
} finally {
ThriftUtil.returnClient(client);
}
}
public void halt(ZooLock lock) throws TException, ThriftSecurityException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.halt(null, SecurityConstants.getSystemCredentials(), lockString(lock));
+ client.halt(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock));
} finally {
ThriftUtil.returnClient(client);
}
}
public void fastHalt(ZooLock lock) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.fastHalt(null, SecurityConstants.getSystemCredentials(), lockString(lock));
+ client.fastHalt(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock));
} finally {
ThriftUtil.returnClient(client);
}
}
public void flush(ZooLock lock, String tableId, byte[] startRow, byte[] endRow) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.flush(null, SecurityConstants.getSystemCredentials(), lockString(lock), tableId, startRow == null ? null : ByteBuffer.wrap(startRow),
+ client.flush(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), tableId, startRow == null ? null : ByteBuffer.wrap(startRow),
endRow == null ? null : ByteBuffer.wrap(endRow));
} finally {
ThriftUtil.returnClient(client);
@@ -134,37 +136,37 @@ public class LiveTServerSet implements W
}
public void chop(ZooLock lock, KeyExtent extent) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.chop(null, SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
+ client.chop(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
} finally {
ThriftUtil.returnClient(client);
}
}
public void splitTablet(ZooLock lock, KeyExtent extent, Text splitPoint) throws TException, ThriftSecurityException, NotServingTabletException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
client
- .splitTablet(null, SecurityConstants.getSystemCredentials(), extent.toThrift(), ByteBuffer.wrap(splitPoint.getBytes(), 0, splitPoint.getLength()));
+ .splitTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), extent.toThrift(), ByteBuffer.wrap(splitPoint.getBytes(), 0, splitPoint.getLength()));
} finally {
ThriftUtil.returnClient(client);
}
}
public void flushTablet(ZooLock lock, KeyExtent extent) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.flushTablet(null, SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
+ client.flushTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), extent.toThrift());
} finally {
ThriftUtil.returnClient(client);
}
}
public void compact(ZooLock lock, String tableId, byte[] startRow, byte[] endRow) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- client.compact(null, SecurityConstants.getSystemCredentials(), lockString(lock), tableId, startRow == null ? null : ByteBuffer.wrap(startRow),
+ client.compact(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock), tableId, startRow == null ? null : ByteBuffer.wrap(startRow),
endRow == null ? null : ByteBuffer.wrap(endRow));
} finally {
ThriftUtil.returnClient(client);
@@ -172,9 +174,9 @@ public class LiveTServerSet implements W
}
public boolean isActive(long tid) throws TException {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
try {
- return client.isActive(null, tid);
+ return client.isActive(Tracer.traceInfo(), tid);
} finally {
ThriftUtil.returnClient(client);
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java Tue Jul 10 12:39:52 2012
@@ -70,6 +70,7 @@ import org.apache.accumulo.core.file.Fil
import org.apache.accumulo.core.iterators.IteratorUtil;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.core.master.thrift.MasterClientService;
+import org.apache.accumulo.core.master.thrift.MasterClientService.Iface;
import org.apache.accumulo.core.master.thrift.MasterClientService.Processor;
import org.apache.accumulo.core.master.thrift.MasterGoalState;
import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
@@ -2123,7 +2124,7 @@ public class Master implements LiveTServ
throw new IOException(e);
}
- Processor processor = new MasterClientService.Processor(TraceWrap.service(new MasterClientServiceHandler()));
+ Processor<Iface> processor = new Processor<Iface>(TraceWrap.service(new MasterClientServiceHandler()));
clientService = TServerUtils.startServer(getSystemConfiguration(), Property.MASTER_CLIENTPORT, processor, "Master", "Master Client Service Handler", null,
Property.MASTER_MINTHREADS, Property.MASTER_THREADCHECK).server;
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java Tue Jul 10 12:39:52 2012
@@ -22,11 +22,12 @@ import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
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.Client;
import org.apache.accumulo.core.tabletserver.thrift.TabletStats;
import org.apache.accumulo.core.util.ThriftUtil;
import org.apache.accumulo.server.conf.ServerConfiguration;
@@ -95,9 +96,9 @@ public abstract class TabletBalancer {
*/
public List<TabletStats> getOnlineTabletsForTable(TServerInstance tserver, String tableId) throws ThriftSecurityException, TException {
log.debug("Scanning tablet server " + tserver + " for table " + tableId);
- Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), tserver.getLocation(), configuration.getConfiguration());
+ Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), tserver.getLocation(), configuration.getConfiguration());
try {
- List<TabletStats> onlineTabletsForTable = client.getTabletStats(null, SecurityConstants.getSystemCredentials(), tableId);
+ List<TabletStats> onlineTabletsForTable = client.getTabletStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), tableId);
return onlineTabletsForTable;
} catch (TTransportException e) {
log.error("Unable to connect to " + tserver + ": " + e);
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/BulkImport.java Tue Jul 10 12:39:52 2012
@@ -36,6 +36,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.accumulo.cloudtrace.instrument.TraceExecutorService;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
@@ -44,6 +45,7 @@ import org.apache.accumulo.core.client.S
import org.apache.accumulo.core.client.impl.ServerClient;
import org.apache.accumulo.core.client.impl.Tables;
import org.apache.accumulo.core.client.impl.thrift.ClientService;
+import org.apache.accumulo.core.client.impl.thrift.ClientService.Client;
import org.apache.accumulo.core.client.impl.thrift.ClientService.Iface;
import org.apache.accumulo.core.client.impl.thrift.TableOperation;
import org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType;
@@ -522,18 +524,18 @@ class LoadFiles extends MasterRepo {
@Override
public List<String> call() {
List<String> failures = new ArrayList<String>();
- ClientService.Iface client = null;
+ ClientService.Client client = null;
String server = null;
try {
// get a connection to a random tablet server, do not prefer cached connections because
// this is running on the master and there are lots of connections to tablet servers
// serving the !METADATA tablets
- Pair<String,Iface> pair = ServerClient.getConnection(master.getInstance(), false);
+ Pair<String,Client> pair = ServerClient.getConnection(master.getInstance(), false);
client = pair.getSecond();
server = pair.getFirst();
List<String> attempt = Collections.singletonList(file);
log.debug("Asking " + pair.getFirst() + " to bulk import " + file);
- List<String> fail = client.bulkImportFiles(null, SecurityConstants.getSystemCredentials(), tid, tableId, attempt, errorDir, setTime);
+ List<String> fail = client.bulkImportFiles(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), tid, tableId, attempt, errorDir, setTime);
if (fail.isEmpty()) {
filesToLoad.remove(file);
} else {
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java Tue Jul 10 12:39:52 2012
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.impl.MasterClient;
@@ -292,7 +293,7 @@ public class Monitor {
try {
client = MasterClient.getConnection(HdfsZooInstance.getInstance());
if (client != null) {
- mmi = client.getMasterStats(null, SecurityConstants.getSystemCredentials());
+ mmi = client.getMasterStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
} else {
mmi = null;
}
@@ -429,9 +430,9 @@ public class Monitor {
if (locks != null && locks.size() > 0) {
Collections.sort(locks);
InetSocketAddress address = new ServerServices(new String(zk.getData(path + "/" + locks.get(0), null, null))).getAddress(Service.GC_CLIENT);
- GCMonitorService.Iface client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, config.getConfiguration());
+ GCMonitorService.Client client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, config.getConfiguration());
try {
- result = client.getStatus(null, SecurityConstants.getSystemCredentials());
+ result = client.getStatus(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
} finally {
ThriftUtil.returnClient(client);
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/TServersServlet.java Tue Jul 10 12:39:52 2012
@@ -27,6 +27,7 @@ import java.util.Map.Entry;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.master.thrift.DeadServer;
import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
@@ -122,12 +123,12 @@ public class TServersServlet extends Bas
TabletStats historical = new TabletStats(null, new ActionStats(), new ActionStats(), new ActionStats(), 0, 0, 0, 0);
List<TabletStats> tsStats = new ArrayList<TabletStats>();
try {
- TabletClientService.Iface client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, Monitor.getSystemConfiguration());
+ TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, Monitor.getSystemConfiguration());
try {
for (String tableId : Monitor.getMmi().tableMap.keySet()) {
- tsStats.addAll(client.getTabletStats(null, SecurityConstants.getSystemCredentials(), tableId));
+ tsStats.addAll(client.getTabletStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), tableId));
}
- historical = client.getHistoricalStats(null, SecurityConstants.getSystemCredentials());
+ historical = client.getHistoricalStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
} finally {
ThriftUtil.returnClient(client);
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java Tue Jul 10 12:39:52 2012
@@ -118,6 +118,8 @@ import org.apache.accumulo.core.tabletse
import org.apache.accumulo.core.tabletserver.thrift.ScanState;
import org.apache.accumulo.core.tabletserver.thrift.ScanType;
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.AddressUtil;
import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -2622,12 +2624,12 @@ public class TabletServer extends Abstra
}
// Connect to the master for posting asynchronous results
- private MasterClientService.Iface masterConnection(String address) {
+ private MasterClientService.Client masterConnection(String address) {
try {
if (address == null) {
return null;
}
- MasterClientService.Iface client = ThriftUtil.getClient(new MasterClientService.Client.Factory(), address, Property.MASTER_CLIENTPORT,
+ MasterClientService.Client client = ThriftUtil.getClient(new MasterClientService.Client.Factory(), address, Property.MASTER_CLIENTPORT,
Property.GENERAL_RPC_TIMEOUT, getSystemConfiguration());
// log.info("Listener API to master has been opened");
return client;
@@ -2637,14 +2639,14 @@ public class TabletServer extends Abstra
return null;
}
- private void returnMasterConnection(MasterClientService.Iface client) {
+ private void returnMasterConnection(MasterClientService.Client client) {
ThriftUtil.returnClient(client);
}
private int startTabletClientService() throws UnknownHostException {
// start listening for client connection last
- TabletClientService.Iface tch = TraceWrap.service(new ThriftClientHandler());
- TabletClientService.Processor processor = new TabletClientService.Processor(tch);
+ Iface tch = TraceWrap.service(new ThriftClientHandler());
+ Processor<Iface> processor = new Processor<Iface>(tch);
int port = startServer(getSystemConfiguration(), Property.TSERV_CLIENTPORT, processor, "Thrift Client Server");
log.info("port = " + port);
return port;
@@ -2745,7 +2747,7 @@ public class TabletServer extends Abstra
// send all of the pending messages
try {
MasterMessage mm = null;
- MasterClientService.Iface iface = null;
+ MasterClientService.Client iface = null;
try {
// wait until a message is ready to send, or a sever stop
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/SplitReportMessage.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/SplitReportMessage.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/SplitReportMessage.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/SplitReportMessage.java Tue Jul 10 12:39:52 2012
@@ -19,6 +19,7 @@ package org.apache.accumulo.server.table
import java.util.Map;
import java.util.TreeMap;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.client.impl.Translator;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.master.thrift.MasterClientService;
@@ -48,7 +49,7 @@ public class SplitReportMessage implemen
TabletSplit split = new TabletSplit();
split.oldTablet = old_extent.toThrift();
split.newTablets = Translator.translate(extents.keySet(), Translator.KET);
- client.reportSplitExtent(null, credentials, serverName, split);
+ client.reportSplitExtent(Tracer.traceInfo(), credentials, serverName, split);
}
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/TabletStatusMessage.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/TabletStatusMessage.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/TabletStatusMessage.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/mastermessage/TabletStatusMessage.java Tue Jul 10 12:39:52 2012
@@ -16,6 +16,7 @@
*/
package org.apache.accumulo.server.tabletserver.mastermessage;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.master.thrift.TabletLoadState;
import org.apache.accumulo.core.master.thrift.MasterClientService.Iface;
@@ -34,6 +35,6 @@ public class TabletStatusMessage impleme
}
public void send(AuthInfo auth, String serverName, Iface client) throws TException, ThriftSecurityException {
- client.reportTabletStatus(null, auth, serverName, status, extent.toThrift());
+ client.reportTabletStatus(Tracer.traceInfo(), auth, serverName, status, extent.toThrift());
}
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/GetMasterStats.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/GetMasterStats.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/GetMasterStats.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/GetMasterStats.java Tue Jul 10 12:39:52 2012
@@ -19,6 +19,7 @@ package org.apache.accumulo.server.test;
import java.io.IOException;
import java.util.Map.Entry;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.client.impl.MasterClient;
import org.apache.accumulo.core.master.MasterNotRunningException;
import org.apache.accumulo.core.master.thrift.MasterClientService;
@@ -43,7 +44,7 @@ public class GetMasterStats {
MasterMonitorInfo stats = null;
try {
client = MasterClient.getConnectionWithRetry(HdfsZooInstance.getInstance());
- stats = client.getMasterStats(null, SecurityConstants.getSystemCredentials());
+ stats = client.getMasterStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
} finally {
if (client != null)
MasterClient.close(client);
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/WrongTabletTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/WrongTabletTest.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/WrongTabletTest.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/WrongTabletTest.java Tue Jul 10 12:39:52 2012
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.test;
import java.nio.ByteBuffer;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.security.thrift.AuthInfo;
@@ -39,7 +40,7 @@ public class WrongTabletTest {
Mutation mutation = new Mutation(new Text("row_0003750001"));
// mutation.set(new Text("colf:colq"), new Value("val".getBytes()));
mutation.putDelete(new Text("colf"), new Text("colq"));
- client.update(null, rootCredentials, new KeyExtent(new Text("test_ingest"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
+ client.update(Tracer.traceInfo(), rootCredentials, new KeyExtent(new Text("test_ingest"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
} catch (Exception e) {
throw new RuntimeException(e);
}
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousStatsCollector.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousStatsCollector.java?rev=1359639&r1=1359638&r2=1359639&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousStatsCollector.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/continuous/ContinuousStatsCollector.java Tue Jul 10 12:39:52 2012
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
+import org.apache.accumulo.cloudtrace.instrument.Tracer;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
@@ -126,7 +127,7 @@ public class ContinuousStatsCollector {
MasterClientService.Iface client = null;
try {
client = MasterClient.getConnectionWithRetry(HdfsZooInstance.getInstance());
- MasterMonitorInfo stats = client.getMasterStats(null, SecurityConstants.getSystemCredentials());
+ MasterMonitorInfo stats = client.getMasterStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
TableInfo all = new TableInfo();
Map<String,TableInfo> tableSummaries = new HashMap<String,TableInfo>();