You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/07/13 22:34:49 UTC
svn commit: r1361382 [12/16] - in /accumulo/branches/ACCUMULO-259: ./ bin/
conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/
conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/
conf/examples/3GB/native-standalone/ conf/e...
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletMutations.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.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-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletStats.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.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-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java Fri Jul 13 20:34:44 2012
@@ -1,10 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.accumulo.core.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-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/Merge.java Fri Jul 13 20:34:44 2012
@@ -62,7 +62,7 @@ public class Merge {
String table = null;
long goalSize = -1;
String user = "root";
- String password = "secret";
+ byte[] password = "secret".getBytes();
boolean force = false;
Text begin = null;
Text end = null;
@@ -90,6 +90,12 @@ public class Merge {
if (commandLine.hasOption("s")) {
goalSize = AccumuloConfiguration.getMemoryInBytes(commandLine.getOptionValue("s"));
}
+ if (commandLine.hasOption("u")) {
+ table = commandLine.getOptionValue("u");
+ }
+ if (commandLine.hasOption("p")) {
+ password = commandLine.getOptionValue("p").getBytes();
+ }
if (commandLine.hasOption("f")) {
force = true;
}
@@ -97,7 +103,7 @@ public class Merge {
begin = new Text(commandLine.getOptionValue("b"));
}
if (commandLine.hasOption("e")) {
- end = new Text(commandLine.getOptionValue("e"));
+ end = new Text(commandLine.getOptionValue("e"));
}
if (table == null) {
System.err.println("Specify the table to merge");
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java Fri Jul 13 20:34:44 2012
@@ -22,12 +22,13 @@ import java.util.concurrent.TimeUnit;
/**
- *
+ * Create a simple thread pool using common parameters.
*/
public class SimpleThreadPool extends ThreadPoolExecutor {
public SimpleThreadPool(int max, final String name) {
- super(0, Integer.MAX_VALUE, 1l, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamingThreadFactory(name));
+ super(max, max, 1l, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamingThreadFactory(name));
+ allowCoreThreadTimeOut(true);
}
}
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java Fri Jul 13 20:34:44 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/branches/ACCUMULO-259/core/src/main/thrift/security.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift Fri Jul 13 20:34:44 2012
@@ -26,7 +26,8 @@ enum SecurityErrorCode {
GRANT_INVALID = 6,
BAD_AUTHORIZATIONS = 7,
INVALID_INSTANCEID = 8,
- TABLE_DOESNT_EXIST = 9
+ TABLE_DOESNT_EXIST = 9,
+ UNSUPPORTED_OPERATION = 10
}
struct AuthInfo {
Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/thrift.sh
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/thrift.sh?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/thrift.sh (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/thrift.sh Fri Jul 13 20:34:44 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-259/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowTest.java Fri Jul 13 20:34:44 2012
@@ -124,3 +124,4 @@ public class FirstEntryInRowTest {
assertFalse(fei.hasTop());
}
}
+
Modified: accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/AndIterator.java Fri Jul 13 20:34:44 2012
@@ -18,8 +18,10 @@ package org.apache.accumulo.examples.wik
import java.io.IOException;
import java.util.Collection;
+import java.util.Collections;
import java.util.Map;
+import org.apache.accumulo.core.data.ArrayByteSequence;
import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.PartialKey;
@@ -45,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;
/**
@@ -58,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;
}
@@ -86,7 +84,8 @@ public class AndIterator implements Sort
}
/*
- * | Row | Column Family | Column Qualifier | Value | {RowID} | {dataLocation} | {term}\0{dataType}\0{UID} | Empty
+ * | Row | Column Family | Column Qualifier | Value
+ * | {RowID} | {dataLocation} | {term}\0{dataType}\0{UID} | Empty
*/
protected Text getPartition(Key key) {
return key.getRow();
@@ -200,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() {
@@ -302,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;
}
@@ -349,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;
@@ -382,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;
@@ -404,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;
@@ -448,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;
@@ -483,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;
}
@@ -746,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]);
}
@@ -761,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);
@@ -772,27 +768,25 @@ 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;
if (range.getStartKey() != null) {
// Build a key with the DocID if one is given
if (range.getStartKey().getColumnFamily() != null) {
- sourceKey = buildKey(getPartition(range.getStartKey()), (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation,
+ 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.
else {
- sourceKey = buildKey(getPartition(range.getStartKey()), (sources[i].dataLocation == null) ? nullText : sources[i].dataLocation,
+ sourceKey = buildKey(getPartition(range.getStartKey()), dataLocation,
(sources[i].term == null) ? nullText : sources[i].term);
}
if (!range.isStartKeyInclusive())
sourceKey = sourceKey.followingKey(PartialKey.ROW_COLFAM_COLQUAL);
- sources[i].iter.seek(new Range(sourceKey, true, null, false), seekColumnFamilies, inclusive);
+ sources[i].iter.seek(new Range(sourceKey, true, null, false), sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
} else {
- sources[i].iter.seek(range, seekColumnFamilies, inclusive);
+ sources[i].iter.seek(range, sources[i].seekColumnFamilies, SEEK_INCLUSIVE);
}
}
@@ -876,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
@@ -906,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/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/query/Query.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/query/Query.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/query/Query.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/query/Query.java Fri Jul 13 20:34:44 2012
@@ -175,11 +175,10 @@ public class Query implements IQuery {
Connector connector = null;
if (null == instanceName || null == zooKeepers || null == username || null == password)
throw new EJBException("Required parameters not set. [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = "
- + this.username + ", password = " + this.password + "]. Check values in ejb-jar.xml");
+ + this.username + (password==null?", password = null":"") + "]. Check values in ejb-jar.xml");
Instance instance = new ZooKeeperInstance(this.instanceName, this.zooKeepers);
try {
- log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + ", password = "
- + this.password + "].");
+ log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + "].");
connector = instance.getConnector(this.username, this.password.getBytes());
} catch (Exception e) {
throw new EJBException("Error getting connector from instance", e);
@@ -209,11 +208,10 @@ public class Query implements IQuery {
Connector connector = null;
if (null == instanceName || null == zooKeepers || null == username || null == password)
throw new EJBException("Required parameters not set. [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = "
- + this.username + ", password = " + this.password + "]. Check values in ejb-jar.xml");
+ + this.username + (password==null?", password = null":"") + "]. Check values in ejb-jar.xml");
Instance instance = new ZooKeeperInstance(this.instanceName, this.zooKeepers);
try {
- log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + ", password = "
- + this.password + "].");
+ log.info("Connecting to [instanceName = " + this.instanceName + ", zookeepers = " + this.zooKeepers + ", username = " + this.username + "].");
connector = instance.getConnector(this.username, this.password.getBytes());
} catch (Exception e) {
throw new EJBException("Error getting connector from instance", e);
Modified: accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java (original)
+++ accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java Fri Jul 13 20:34:44 2012
@@ -48,6 +48,8 @@ public interface IZooReaderWriter extend
public abstract String putEphemeralSequential(String zPath, byte[] data) throws KeeperException, InterruptedException;
+ public String putEphemeralData(String zPath, byte[] data) throws KeeperException, InterruptedException;
+
public abstract void recursiveCopyPersistent(String source, String destination, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
public abstract void delete(String path, int version) throws InterruptedException, KeeperException;
@@ -58,4 +60,6 @@ public interface IZooReaderWriter extend
public abstract void mkdirs(String path) throws KeeperException, InterruptedException;
+ public abstract void sync(String path) throws KeeperException, InterruptedException;
+
}
Modified: accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java (original)
+++ accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java Fri Jul 13 20:34:44 2012
@@ -22,11 +22,13 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.security.SecurityPermission;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.accumulo.fate.util.UtilWaitThread;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy;
import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
import org.apache.log4j.Logger;
+import org.apache.zookeeper.AsyncCallback.VoidCallback;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.BadVersionException;
@@ -93,6 +95,11 @@ public class ZooReaderWriter extends Zoo
}
@Override
+ public String putEphemeralData(String zPath, byte[] data) throws KeeperException, InterruptedException {
+ return ZooUtil.putEphemeralData(getZooKeeper(), zPath, data);
+ }
+
+ @Override
public String putEphemeralSequential(String zPath, byte[] data) throws KeeperException, InterruptedException {
return ZooUtil.putEphemeralSequential(getZooKeeper(), zPath, data);
}
@@ -195,5 +202,22 @@ public class ZooReaderWriter extends Zoo
mkdirs(parent);
putPersistentData(path, new byte[] {}, NodeExistsPolicy.SKIP);
}
+
+ @Override
+ public void sync(final String path) throws KeeperException, InterruptedException {
+ final AtomicBoolean waiter = new AtomicBoolean(false);
+ getZooKeeper().sync(path, new VoidCallback() {
+ @Override
+ public void processResult(int arg0, String arg1, Object arg2) {
+ synchronized (waiter) {
+ waiter.set(true);
+ waiter.notifyAll();
+ }
+ }}, null);
+ synchronized (waiter) {
+ if (!waiter.get())
+ waiter.wait();
+ }
+ }
}
Modified: accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java (original)
+++ accumulo/branches/ACCUMULO-259/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java Fri Jul 13 20:34:44 2012
@@ -211,6 +211,10 @@ public class ZooUtil {
return zk.create(zPath, data, ZooUtil.PUBLIC, CreateMode.PERSISTENT_SEQUENTIAL);
}
+ public static String putEphemeralData(ZooKeeper zk, String zPath, byte[] data) throws KeeperException, InterruptedException {
+ return zk.create(zPath, data, ZooUtil.PUBLIC, CreateMode.EPHEMERAL);
+ }
+
public static String putEphemeralSequential(ZooKeeper zk, String zPath, byte[] data) throws KeeperException, InterruptedException {
return zk.create(zPath, data, ZooUtil.PUBLIC, CreateMode.EPHEMERAL_SEQUENTIAL);
}
@@ -219,7 +223,7 @@ public class ZooUtil {
List<String> children = zc.getChildren(path);
- if (children.size() == 0) {
+ if (children == null || children.size() == 0) {
return null;
}
Modified: accumulo/branches/ACCUMULO-259/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/pom.xml?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/pom.xml (original)
+++ accumulo/branches/ACCUMULO-259/pom.xml Fri Jul 13 20:34:44 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/branches/ACCUMULO-259/server/
------------------------------------------------------------------------------
Merged /accumulo/trunk/src/server:r1341000,1342373,1351691,1356400
Merged /accumulo/branches/ACCUMULO-672/server:r1357826,1357829,1357842,1357858,1358236,1359163
Merged /accumulo/branches/1.4/src/server:r1339309-1342420,1343897-1343898,1343943-1349971,1349973-1351424,1351426-1354669,1354673-1356900,1358206
Merged /accumulo/branches/1.3/src/server:r1354669
Merged /accumulo/branches/1.4/server:r1343943-1349971,1349973-1351424,1351426-1354668,1354673-1356923,1358206
Merged /accumulo/trunk/server:r1355557-1361354
Modified: accumulo/branches/ACCUMULO-259/server/src/main/c++/nativeMap/Makefile
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/c%2B%2B/nativeMap/Makefile?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/c++/nativeMap/Makefile (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/c++/nativeMap/Makefile Fri Jul 13 20:34:44 2012
@@ -24,7 +24,7 @@ endif
ifeq ($(shell uname),Darwin)
LIBS:= libNativeMap-Mac_OS_X-x86_64-64.jnilib
-CXXFLAGS=-m64 -dynamiclib -O3 -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
+CXXFLAGS=-m64 -dynamiclib -O3 -I/System/Library/Frameworks/JavaVM.framework/Headers
endif
INSTALL_DIR=../../../../../lib/native/map
Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java Fri Jul 13 20:34:44 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;
@@ -64,8 +65,6 @@ import org.apache.accumulo.core.util.Uti
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.SequenceFile;
-import org.apache.hadoop.io.SequenceFile.Writer;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
import org.apache.thrift.TServiceClient;
@@ -132,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 {
@@ -299,48 +298,16 @@ public class BulkImporter {
if (completeFailures.size() == 0)
return Collections.emptySet();
- log.error("The following map files failed completely, saving this info to : " + new Path(failureDir, "failures.seq"));
+ log.debug("The following map files failed ");
for (Entry<Path,List<KeyExtent>> entry : es) {
List<KeyExtent> extents = entry.getValue();
for (KeyExtent keyExtent : extents)
- log.error("\t" + entry.getKey() + " -> " + keyExtent);
+ log.debug("\t" + entry.getKey() + " -> " + keyExtent);
}
-
- try {
-
- Writer outSeq = SequenceFile.createWriter(fs, conf, new Path(failureDir, "failures.seq"), Text.class, KeyExtent.class);
-
- for (Entry<Path,List<KeyExtent>> entry : es) {
- List<KeyExtent> extents = entry.getValue();
-
- for (KeyExtent keyExtent : extents)
- outSeq.append(new Text(entry.getKey().toString()), keyExtent);
- }
-
- outSeq.close();
- } catch (IOException ioe) {
- log.error("Failed to create " + new Path(failureDir, "failures.seq") + " : " + ioe.getMessage());
- }
-
- // we should make copying multi-threaded
- Set<Path> failedCopies = new HashSet<Path>();
-
- for (Entry<Path,List<KeyExtent>> entry : es) {
- Path dest = new Path(failureDir, entry.getKey().getName());
-
- log.debug("Copying " + entry.getKey() + " to " + dest);
-
- try {
- org.apache.hadoop.fs.FileUtil.copy(fs, entry.getKey(), fs, dest, false, conf);
- } catch (IOException ioe) {
- log.error("Failed to copy " + entry.getKey() + " : " + ioe.getMessage());
- failedCopies.add(entry.getKey());
- }
- }
-
- return failedCopies;
+
+ return Collections.emptySet();
}
private class AssignmentInfo {
@@ -625,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/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java Fri Jul 13 20:34:44 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/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Fri Jul 13 20:34:44 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/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java Fri Jul 13 20:34:44 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/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1361382&r1=1361381&r2=1361382&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/master/Master.java Fri Jul 13 20:34:44 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;
@@ -1242,10 +1243,13 @@ public class Master implements LiveTServ
private class TabletGroupWatcher extends Daemon {
final TabletStateStore store;
+ final TabletGroupWatcher dependentWatcher;
+
final TableStats stats = new TableStats();
- TabletGroupWatcher(TabletStateStore store) {
+ TabletGroupWatcher(TabletStateStore store, TabletGroupWatcher dependentWatcher) {
this.store = store;
+ this.dependentWatcher = dependentWatcher;
}
Map<Text,TableCounts> getStats() {
@@ -1325,6 +1329,15 @@ public class Master implements LiveTServ
goal = TabletGoalState.HOSTED;
}
+ // if we are shutting down all the tabletservers, we have to do it in order
+ if (goal == TabletGoalState.UNASSIGNED && state == TabletState.HOSTED) {
+ if (serversToShutdown.equals(currentTServers.keySet())) {
+ if (dependentWatcher != null && dependentWatcher.assignedOrHosted() > 0) {
+ goal = TabletGoalState.HOSTED;
+ }
+ }
+ }
+
if (goal == TabletGoalState.HOSTED) {
if (state != TabletState.HOSTED && !tls.walogs.isEmpty()) {
if (recoverLogs(tls.extent, tls.walogs))
@@ -1416,6 +1429,14 @@ public class Master implements LiveTServ
}
}
+ private int assignedOrHosted() {
+ int result = 0;
+ for (TableCounts counts : stats.getLast().values()) {
+ result += counts.assigned() + counts.hosted();
+ }
+ return result;
+ }
+
private void sendSplitRequest(MergeInfo info, TabletState state, TabletLocationState tls) {
// Already split?
if (!info.getState().equals(MergeState.SPLITTING))
@@ -2061,9 +2082,9 @@ public class Master implements LiveTServ
AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new RootTabletStateStore(instance, systemAuths, this),
new MetaDataStateStore(instance, systemAuths, this)};
- for (int i = 0; i < stores.length; i++) {
- watchers.add(new TabletGroupWatcher(stores[i]));
- }
+ watchers.add(new TabletGroupWatcher(stores[2], null));
+ watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
+ watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
for (TabletGroupWatcher watcher : watchers) {
watcher.start();
}
@@ -2078,7 +2099,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;