You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/04/08 05:03:45 UTC
[49/53] [abbrv] ACCUMULO-2573 First stab at changes to IDL for
replication
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java b/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
new file mode 100644
index 0000000..b4942d4
--- /dev/null
+++ b/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.accumulo.core.replication.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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WalEdits");
+
+ private static final org.apache.thrift.protocol.TField EDITS_FIELD_DESC = new org.apache.thrift.protocol.TField("edits", org.apache.thrift.protocol.TType.LIST, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new WalEditsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new WalEditsTupleSchemeFactory());
+ }
+
+ public List<ByteBuffer> edits; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ EDITS((short)1, "edits");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // EDITS
+ return EDITS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // 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);
+ tmpMap.put(_Fields.EDITS, new org.apache.thrift.meta_data.FieldMetaData("edits", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WalEdits.class, metaDataMap);
+ }
+
+ public WalEdits() {
+ }
+
+ public WalEdits(
+ List<ByteBuffer> edits)
+ {
+ this();
+ this.edits = edits;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public WalEdits(WalEdits other) {
+ if (other.isSetEdits()) {
+ List<ByteBuffer> __this__edits = new ArrayList<ByteBuffer>();
+ for (ByteBuffer other_element : other.edits) {
+ ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
+;
+ __this__edits.add(temp_binary_element);
+ }
+ this.edits = __this__edits;
+ }
+ }
+
+ public WalEdits deepCopy() {
+ return new WalEdits(this);
+ }
+
+ @Override
+ public void clear() {
+ this.edits = null;
+ }
+
+ public int getEditsSize() {
+ return (this.edits == null) ? 0 : this.edits.size();
+ }
+
+ public java.util.Iterator<ByteBuffer> getEditsIterator() {
+ return (this.edits == null) ? null : this.edits.iterator();
+ }
+
+ public void addToEdits(ByteBuffer elem) {
+ if (this.edits == null) {
+ this.edits = new ArrayList<ByteBuffer>();
+ }
+ this.edits.add(elem);
+ }
+
+ public List<ByteBuffer> getEdits() {
+ return this.edits;
+ }
+
+ public WalEdits setEdits(List<ByteBuffer> edits) {
+ this.edits = edits;
+ return this;
+ }
+
+ public void unsetEdits() {
+ this.edits = null;
+ }
+
+ /** Returns true if field edits is set (has been assigned a value) and false otherwise */
+ public boolean isSetEdits() {
+ return this.edits != null;
+ }
+
+ public void setEditsIsSet(boolean value) {
+ if (!value) {
+ this.edits = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case EDITS:
+ if (value == null) {
+ unsetEdits();
+ } else {
+ setEdits((List<ByteBuffer>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case EDITS:
+ return getEdits();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case EDITS:
+ return isSetEdits();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof WalEdits)
+ return this.equals((WalEdits)that);
+ return false;
+ }
+
+ public boolean equals(WalEdits that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_edits = true && this.isSetEdits();
+ boolean that_present_edits = true && that.isSetEdits();
+ if (this_present_edits || that_present_edits) {
+ if (!(this_present_edits && that_present_edits))
+ return false;
+ if (!this.edits.equals(that.edits))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(WalEdits other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ WalEdits typedOther = (WalEdits)other;
+
+ lastComparison = Boolean.valueOf(isSetEdits()).compareTo(typedOther.isSetEdits());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEdits()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.edits, typedOther.edits);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("WalEdits(");
+ boolean first = true;
+
+ sb.append("edits:");
+ if (this.edits == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.edits);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class WalEditsStandardSchemeFactory implements SchemeFactory {
+ public WalEditsStandardScheme getScheme() {
+ return new WalEditsStandardScheme();
+ }
+ }
+
+ private static class WalEditsStandardScheme extends StandardScheme<WalEdits> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, WalEdits 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: // EDITS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ struct.edits = new ArrayList<ByteBuffer>(_list0.size);
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1)
+ {
+ ByteBuffer _elem2; // required
+ _elem2 = iprot.readBinary();
+ struct.edits.add(_elem2);
+ }
+ iprot.readListEnd();
+ }
+ struct.setEditsIsSet(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, WalEdits struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.edits != null) {
+ oprot.writeFieldBegin(EDITS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.edits.size()));
+ for (ByteBuffer _iter3 : struct.edits)
+ {
+ oprot.writeBinary(_iter3);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class WalEditsTupleSchemeFactory implements SchemeFactory {
+ public WalEditsTupleScheme getScheme() {
+ return new WalEditsTupleScheme();
+ }
+ }
+
+ private static class WalEditsTupleScheme extends TupleScheme<WalEdits> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, WalEdits struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetEdits()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetEdits()) {
+ {
+ oprot.writeI32(struct.edits.size());
+ for (ByteBuffer _iter4 : struct.edits)
+ {
+ oprot.writeBinary(_iter4);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, WalEdits struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.edits = new ArrayList<ByteBuffer>(_list5.size);
+ for (int _i6 = 0; _i6 < _list5.size; ++_i6)
+ {
+ ByteBuffer _elem7; // required
+ _elem7 = iprot.readBinary();
+ struct.edits.add(_elem7);
+ }
+ }
+ struct.setEditsIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ReplicationFailedException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ReplicationFailedException.java b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ReplicationFailedException.java
new file mode 100644
index 0000000..63c6e00
--- /dev/null
+++ b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ReplicationFailedException.java
@@ -0,0 +1,402 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class ReplicationFailedException extends TException implements org.apache.thrift.TBase<ReplicationFailedException, ReplicationFailedException._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReplicationFailedException");
+
+ private static final org.apache.thrift.protocol.TField REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("reason", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new ReplicationFailedExceptionStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ReplicationFailedExceptionTupleSchemeFactory());
+ }
+
+ public String reason; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ REASON((short)1, "reason");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // REASON
+ return REASON;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // 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);
+ tmpMap.put(_Fields.REASON, new org.apache.thrift.meta_data.FieldMetaData("reason", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReplicationFailedException.class, metaDataMap);
+ }
+
+ public ReplicationFailedException() {
+ }
+
+ public ReplicationFailedException(
+ String reason)
+ {
+ this();
+ this.reason = reason;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public ReplicationFailedException(ReplicationFailedException other) {
+ if (other.isSetReason()) {
+ this.reason = other.reason;
+ }
+ }
+
+ public ReplicationFailedException deepCopy() {
+ return new ReplicationFailedException(this);
+ }
+
+ @Override
+ public void clear() {
+ this.reason = null;
+ }
+
+ public String getReason() {
+ return this.reason;
+ }
+
+ public ReplicationFailedException setReason(String reason) {
+ this.reason = reason;
+ return this;
+ }
+
+ public void unsetReason() {
+ this.reason = null;
+ }
+
+ /** Returns true if field reason is set (has been assigned a value) and false otherwise */
+ public boolean isSetReason() {
+ return this.reason != null;
+ }
+
+ public void setReasonIsSet(boolean value) {
+ if (!value) {
+ this.reason = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case REASON:
+ if (value == null) {
+ unsetReason();
+ } else {
+ setReason((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case REASON:
+ return getReason();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case REASON:
+ return isSetReason();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof ReplicationFailedException)
+ return this.equals((ReplicationFailedException)that);
+ return false;
+ }
+
+ public boolean equals(ReplicationFailedException that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_reason = true && this.isSetReason();
+ boolean that_present_reason = true && that.isSetReason();
+ if (this_present_reason || that_present_reason) {
+ if (!(this_present_reason && that_present_reason))
+ return false;
+ if (!this.reason.equals(that.reason))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(ReplicationFailedException other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ ReplicationFailedException typedOther = (ReplicationFailedException)other;
+
+ lastComparison = Boolean.valueOf(isSetReason()).compareTo(typedOther.isSetReason());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetReason()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reason, typedOther.reason);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("ReplicationFailedException(");
+ boolean first = true;
+
+ sb.append("reason:");
+ if (this.reason == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.reason);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class ReplicationFailedExceptionStandardSchemeFactory implements SchemeFactory {
+ public ReplicationFailedExceptionStandardScheme getScheme() {
+ return new ReplicationFailedExceptionStandardScheme();
+ }
+ }
+
+ private static class ReplicationFailedExceptionStandardScheme extends StandardScheme<ReplicationFailedException> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ReplicationFailedException 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: // REASON
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.reason = iprot.readString();
+ struct.setReasonIsSet(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, ReplicationFailedException struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.reason != null) {
+ oprot.writeFieldBegin(REASON_FIELD_DESC);
+ oprot.writeString(struct.reason);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ReplicationFailedExceptionTupleSchemeFactory implements SchemeFactory {
+ public ReplicationFailedExceptionTupleScheme getScheme() {
+ return new ReplicationFailedExceptionTupleScheme();
+ }
+ }
+
+ private static class ReplicationFailedExceptionTupleScheme extends TupleScheme<ReplicationFailedException> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ReplicationFailedException struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetReason()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetReason()) {
+ oprot.writeString(struct.reason);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ReplicationFailedException struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.reason = iprot.readString();
+ struct.setReasonIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
index d02b5da..9b9d17c 100644
--- a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
+++ b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
@@ -110,6 +110,8 @@ import org.slf4j.LoggerFactory;
public void removeLogs(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<String> filenames) throws org.apache.thrift.TException;
+ public boolean replicateData(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, ReplicationFailedException, org.apache.thrift.TException;
+
}
public interface AsyncIface extends org.apache.accumulo.core.client.impl.thrift.ClientService .AsyncIface {
@@ -174,6 +176,8 @@ import org.slf4j.LoggerFactory;
public void removeLogs(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<String> filenames, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeLogs_call> resultHandler) throws org.apache.thrift.TException;
+ public void replicateData(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.replicateData_call> resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.accumulo.core.client.impl.thrift.ClientService.Client implements Iface {
@@ -905,6 +909,39 @@ import org.slf4j.LoggerFactory;
sendBase("removeLogs", args);
}
+ public boolean replicateData(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, ReplicationFailedException, org.apache.thrift.TException
+ {
+ send_replicateData(tinfo, credentials, file, offset, count);
+ return recv_replicateData();
+ }
+
+ public void send_replicateData(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count) throws org.apache.thrift.TException
+ {
+ replicateData_args args = new replicateData_args();
+ args.setTinfo(tinfo);
+ args.setCredentials(credentials);
+ args.setFile(file);
+ args.setOffset(offset);
+ args.setCount(count);
+ sendBase("replicateData", args);
+ }
+
+ public boolean recv_replicateData() throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, ReplicationFailedException, org.apache.thrift.TException
+ {
+ replicateData_result result = new replicateData_result();
+ receiveBase(result, "replicateData");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.sec != null) {
+ throw result.sec;
+ }
+ if (result.rfe != null) {
+ throw result.rfe;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "replicateData failed: unknown result");
+ }
+
}
public static class AsyncClient extends org.apache.accumulo.core.client.impl.thrift.ClientService.AsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -2112,6 +2149,50 @@ import org.slf4j.LoggerFactory;
}
}
+ public void replicateData(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count, org.apache.thrift.async.AsyncMethodCallback<replicateData_call> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ replicateData_call method_call = new replicateData_call(tinfo, credentials, file, offset, count, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class replicateData_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private org.apache.accumulo.trace.thrift.TInfo tinfo;
+ private org.apache.accumulo.core.security.thrift.TCredentials credentials;
+ private String file;
+ private long offset;
+ private long count;
+ public replicateData_call(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String file, long offset, long count, org.apache.thrift.async.AsyncMethodCallback<replicateData_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.tinfo = tinfo;
+ this.credentials = credentials;
+ this.file = file;
+ this.offset = offset;
+ this.count = count;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("replicateData", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ replicateData_args args = new replicateData_args();
+ args.setTinfo(tinfo);
+ args.setCredentials(credentials);
+ args.setFile(file);
+ args.setOffset(offset);
+ args.setCount(count);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, ReplicationFailedException, org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_replicateData();
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.accumulo.core.client.impl.thrift.ClientService.Processor<I> implements org.apache.thrift.TProcessor {
@@ -2155,6 +2236,7 @@ import org.slf4j.LoggerFactory;
processMap.put("getActiveScans", new getActiveScans());
processMap.put("getActiveCompactions", new getActiveCompactions());
processMap.put("removeLogs", new removeLogs());
+ processMap.put("replicateData", new replicateData());
return processMap;
}
@@ -2834,6 +2916,33 @@ import org.slf4j.LoggerFactory;
}
}
+ public static class replicateData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, replicateData_args> {
+ public replicateData() {
+ super("replicateData");
+ }
+
+ public replicateData_args getEmptyArgsInstance() {
+ return new replicateData_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public replicateData_result getResult(I iface, replicateData_args args) throws org.apache.thrift.TException {
+ replicateData_result result = new replicateData_result();
+ try {
+ result.success = iface.replicateData(args.tinfo, args.credentials, args.file, args.offset, args.count);
+ result.setSuccessIsSet(true);
+ } catch (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) {
+ result.sec = sec;
+ } catch (ReplicationFailedException rfe) {
+ result.rfe = rfe;
+ }
+ return result;
+ }
+ }
+
}
public static class startScan_args implements org.apache.thrift.TBase<startScan_args, startScan_args._Fields>, java.io.Serializable, Cloneable {
@@ -31869,4 +31978,1318 @@ import org.slf4j.LoggerFactory;
}
+ public static class replicateData_args implements org.apache.thrift.TBase<replicateData_args, replicateData_args._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("replicateData_args");
+
+ private static final org.apache.thrift.protocol.TField TINFO_FIELD_DESC = new org.apache.thrift.protocol.TField("tinfo", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField CREDENTIALS_FIELD_DESC = new org.apache.thrift.protocol.TField("credentials", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("file", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I64, (short)4);
+ private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I64, (short)5);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new replicateData_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new replicateData_argsTupleSchemeFactory());
+ }
+
+ public org.apache.accumulo.trace.thrift.TInfo tinfo; // required
+ public org.apache.accumulo.core.security.thrift.TCredentials credentials; // required
+ public String file; // required
+ public long offset; // required
+ public long count; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ TINFO((short)1, "tinfo"),
+ CREDENTIALS((short)2, "credentials"),
+ FILE((short)3, "file"),
+ OFFSET((short)4, "offset"),
+ COUNT((short)5, "count");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // TINFO
+ return TINFO;
+ case 2: // CREDENTIALS
+ return CREDENTIALS;
+ case 3: // FILE
+ return FILE;
+ case 4: // OFFSET
+ return OFFSET;
+ case 5: // COUNT
+ return COUNT;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __OFFSET_ISSET_ID = 0;
+ private static final int __COUNT_ISSET_ID = 1;
+ private byte __isset_bitfield = 0;
+ 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);
+ tmpMap.put(_Fields.TINFO, new org.apache.thrift.meta_data.FieldMetaData("tinfo", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.trace.thrift.TInfo.class)));
+ tmpMap.put(_Fields.CREDENTIALS, new org.apache.thrift.meta_data.FieldMetaData("credentials", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.security.thrift.TCredentials.class)));
+ tmpMap.put(_Fields.FILE, new org.apache.thrift.meta_data.FieldMetaData("file", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.COUNT, new org.apache.thrift.meta_data.FieldMetaData("count", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(replicateData_args.class, metaDataMap);
+ }
+
+ public replicateData_args() {
+ }
+
+ public replicateData_args(
+ org.apache.accumulo.trace.thrift.TInfo tinfo,
+ org.apache.accumulo.core.security.thrift.TCredentials credentials,
+ String file,
+ long offset,
+ long count)
+ {
+ this();
+ this.tinfo = tinfo;
+ this.credentials = credentials;
+ this.file = file;
+ this.offset = offset;
+ setOffsetIsSet(true);
+ this.count = count;
+ setCountIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public replicateData_args(replicateData_args other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetTinfo()) {
+ this.tinfo = new org.apache.accumulo.trace.thrift.TInfo(other.tinfo);
+ }
+ if (other.isSetCredentials()) {
+ this.credentials = new org.apache.accumulo.core.security.thrift.TCredentials(other.credentials);
+ }
+ if (other.isSetFile()) {
+ this.file = other.file;
+ }
+ this.offset = other.offset;
+ this.count = other.count;
+ }
+
+ public replicateData_args deepCopy() {
+ return new replicateData_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.tinfo = null;
+ this.credentials = null;
+ this.file = null;
+ setOffsetIsSet(false);
+ this.offset = 0;
+ setCountIsSet(false);
+ this.count = 0;
+ }
+
+ public org.apache.accumulo.trace.thrift.TInfo getTinfo() {
+ return this.tinfo;
+ }
+
+ public replicateData_args setTinfo(org.apache.accumulo.trace.thrift.TInfo tinfo) {
+ this.tinfo = tinfo;
+ return this;
+ }
+
+ public void unsetTinfo() {
+ this.tinfo = null;
+ }
+
+ /** Returns true if field tinfo is set (has been assigned a value) and false otherwise */
+ public boolean isSetTinfo() {
+ return this.tinfo != null;
+ }
+
+ public void setTinfoIsSet(boolean value) {
+ if (!value) {
+ this.tinfo = null;
+ }
+ }
+
+ public org.apache.accumulo.core.security.thrift.TCredentials getCredentials() {
+ return this.credentials;
+ }
+
+ public replicateData_args setCredentials(org.apache.accumulo.core.security.thrift.TCredentials credentials) {
+ this.credentials = credentials;
+ return this;
+ }
+
+ public void unsetCredentials() {
+ this.credentials = null;
+ }
+
+ /** Returns true if field credentials is set (has been assigned a value) and false otherwise */
+ public boolean isSetCredentials() {
+ return this.credentials != null;
+ }
+
+ public void setCredentialsIsSet(boolean value) {
+ if (!value) {
+ this.credentials = null;
+ }
+ }
+
+ public String getFile() {
+ return this.file;
+ }
+
+ public replicateData_args setFile(String file) {
+ this.file = file;
+ return this;
+ }
+
+ public void unsetFile() {
+ this.file = null;
+ }
+
+ /** Returns true if field file is set (has been assigned a value) and false otherwise */
+ public boolean isSetFile() {
+ return this.file != null;
+ }
+
+ public void setFileIsSet(boolean value) {
+ if (!value) {
+ this.file = null;
+ }
+ }
+
+ public long getOffset() {
+ return this.offset;
+ }
+
+ public replicateData_args setOffset(long offset) {
+ this.offset = offset;
+ setOffsetIsSet(true);
+ return this;
+ }
+
+ public void unsetOffset() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
+ }
+
+ /** Returns true if field offset is set (has been assigned a value) and false otherwise */
+ public boolean isSetOffset() {
+ return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
+ }
+
+ public void setOffsetIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
+ }
+
+ public long getCount() {
+ return this.count;
+ }
+
+ public replicateData_args setCount(long count) {
+ this.count = count;
+ setCountIsSet(true);
+ return this;
+ }
+
+ public void unsetCount() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
+ }
+
+ /** Returns true if field count is set (has been assigned a value) and false otherwise */
+ public boolean isSetCount() {
+ return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
+ }
+
+ public void setCountIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case TINFO:
+ if (value == null) {
+ unsetTinfo();
+ } else {
+ setTinfo((org.apache.accumulo.trace.thrift.TInfo)value);
+ }
+ break;
+
+ case CREDENTIALS:
+ if (value == null) {
+ unsetCredentials();
+ } else {
+ setCredentials((org.apache.accumulo.core.security.thrift.TCredentials)value);
+ }
+ break;
+
+ case FILE:
+ if (value == null) {
+ unsetFile();
+ } else {
+ setFile((String)value);
+ }
+ break;
+
+ case OFFSET:
+ if (value == null) {
+ unsetOffset();
+ } else {
+ setOffset((Long)value);
+ }
+ break;
+
+ case COUNT:
+ if (value == null) {
+ unsetCount();
+ } else {
+ setCount((Long)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case TINFO:
+ return getTinfo();
+
+ case CREDENTIALS:
+ return getCredentials();
+
+ case FILE:
+ return getFile();
+
+ case OFFSET:
+ return Long.valueOf(getOffset());
+
+ case COUNT:
+ return Long.valueOf(getCount());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case TINFO:
+ return isSetTinfo();
+ case CREDENTIALS:
+ return isSetCredentials();
+ case FILE:
+ return isSetFile();
+ case OFFSET:
+ return isSetOffset();
+ case COUNT:
+ return isSetCount();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof replicateData_args)
+ return this.equals((replicateData_args)that);
+ return false;
+ }
+
+ public boolean equals(replicateData_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_tinfo = true && this.isSetTinfo();
+ boolean that_present_tinfo = true && that.isSetTinfo();
+ if (this_present_tinfo || that_present_tinfo) {
+ if (!(this_present_tinfo && that_present_tinfo))
+ return false;
+ if (!this.tinfo.equals(that.tinfo))
+ return false;
+ }
+
+ boolean this_present_credentials = true && this.isSetCredentials();
+ boolean that_present_credentials = true && that.isSetCredentials();
+ if (this_present_credentials || that_present_credentials) {
+ if (!(this_present_credentials && that_present_credentials))
+ return false;
+ if (!this.credentials.equals(that.credentials))
+ return false;
+ }
+
+ boolean this_present_file = true && this.isSetFile();
+ boolean that_present_file = true && that.isSetFile();
+ if (this_present_file || that_present_file) {
+ if (!(this_present_file && that_present_file))
+ return false;
+ if (!this.file.equals(that.file))
+ return false;
+ }
+
+ boolean this_present_offset = true;
+ boolean that_present_offset = true;
+ if (this_present_offset || that_present_offset) {
+ if (!(this_present_offset && that_present_offset))
+ return false;
+ if (this.offset != that.offset)
+ return false;
+ }
+
+ boolean this_present_count = true;
+ boolean that_present_count = true;
+ if (this_present_count || that_present_count) {
+ if (!(this_present_count && that_present_count))
+ return false;
+ if (this.count != that.count)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(replicateData_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ replicateData_args typedOther = (replicateData_args)other;
+
+ lastComparison = Boolean.valueOf(isSetTinfo()).compareTo(typedOther.isSetTinfo());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTinfo()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, typedOther.tinfo);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetCredentials()).compareTo(typedOther.isSetCredentials());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCredentials()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, typedOther.credentials);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFile()).compareTo(typedOther.isSetFile());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFile()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file, typedOther.file);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetOffset()).compareTo(typedOther.isSetOffset());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOffset()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, typedOther.offset);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCount()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, typedOther.count);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("replicateData_args(");
+ boolean first = true;
+
+ sb.append("tinfo:");
+ if (this.tinfo == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.tinfo);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("credentials:");
+ if (this.credentials == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.credentials);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("file:");
+ if (this.file == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.file);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("offset:");
+ sb.append(this.offset);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("count:");
+ sb.append(this.count);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ if (tinfo != null) {
+ tinfo.validate();
+ }
+ if (credentials != null) {
+ credentials.validate();
+ }
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class replicateData_argsStandardSchemeFactory implements SchemeFactory {
+ public replicateData_argsStandardScheme getScheme() {
+ return new replicateData_argsStandardScheme();
+ }
+ }
+
+ private static class replicateData_argsStandardScheme extends StandardScheme<replicateData_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, replicateData_args struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // TINFO
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.tinfo = new org.apache.accumulo.trace.thrift.TInfo();
+ struct.tinfo.read(iprot);
+ struct.setTinfoIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // CREDENTIALS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.credentials = new org.apache.accumulo.core.security.thrift.TCredentials();
+ struct.credentials.read(iprot);
+ struct.setCredentialsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // FILE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.file = iprot.readString();
+ struct.setFileIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // OFFSET
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.offset = iprot.readI64();
+ struct.setOffsetIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // COUNT
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.count = iprot.readI64();
+ struct.setCountIsSet(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, replicateData_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.tinfo != null) {
+ oprot.writeFieldBegin(TINFO_FIELD_DESC);
+ struct.tinfo.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.credentials != null) {
+ oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
+ struct.credentials.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.file != null) {
+ oprot.writeFieldBegin(FILE_FIELD_DESC);
+ oprot.writeString(struct.file);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(OFFSET_FIELD_DESC);
+ oprot.writeI64(struct.offset);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(COUNT_FIELD_DESC);
+ oprot.writeI64(struct.count);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class replicateData_argsTupleSchemeFactory implements SchemeFactory {
+ public replicateData_argsTupleScheme getScheme() {
+ return new replicateData_argsTupleScheme();
+ }
+ }
+
+ private static class replicateData_argsTupleScheme extends TupleScheme<replicateData_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, replicateData_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTinfo()) {
+ optionals.set(0);
+ }
+ if (struct.isSetCredentials()) {
+ optionals.set(1);
+ }
+ if (struct.isSetFile()) {
+ optionals.set(2);
+ }
+ if (struct.isSetOffset()) {
+ optionals.set(3);
+ }
+ if (struct.isSetCount()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetTinfo()) {
+ struct.tinfo.write(oprot);
+ }
+ if (struct.isSetCredentials()) {
+ struct.credentials.write(oprot);
+ }
+ if (struct.isSetFile()) {
+ oprot.writeString(struct.file);
+ }
+ if (struct.isSetOffset()) {
+ oprot.writeI64(struct.offset);
+ }
+ if (struct.isSetCount()) {
+ oprot.writeI64(struct.count);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, replicateData_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.tinfo = new org.apache.accumulo.trace.thrift.TInfo();
+ struct.tinfo.read(iprot);
+ struct.setTinfoIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.credentials = new org.apache.accumulo.core.security.thrift.TCredentials();
+ struct.credentials.read(iprot);
+ struct.setCredentialsIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.file = iprot.readString();
+ struct.setFileIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.offset = iprot.readI64();
+ struct.setOffsetIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.count = iprot.readI64();
+ struct.setCountIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class replicateData_result implements org.apache.thrift.TBase<replicateData_result, replicateData_result._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("replicateData_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+ private static final org.apache.thrift.protocol.TField SEC_FIELD_DESC = new org.apache.thrift.protocol.TField("sec", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField RFE_FIELD_DESC = new org.apache.thrift.protocol.TField("rfe", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new replicateData_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new replicateData_resultTupleSchemeFactory());
+ }
+
+ public boolean success; // required
+ public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec; // required
+ public ReplicationFailedException rfe; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success"),
+ SEC((short)1, "sec"),
+ RFE((short)2, "rfe");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ case 1: // SEC
+ return SEC;
+ case 2: // RFE
+ return RFE;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __SUCCESS_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ 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);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.SEC, new org.apache.thrift.meta_data.FieldMetaData("sec", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.RFE, new org.apache.thrift.meta_data.FieldMetaData("rfe", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(replicateData_result.class, metaDataMap);
+ }
+
+ public replicateData_result() {
+ }
+
+ public replicateData_result(
+ boolean success,
+ org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec,
+ ReplicationFailedException rfe)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ this.sec = sec;
+ this.rfe = rfe;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public replicateData_result(replicateData_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ if (other.isSetSec()) {
+ this.sec = new org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException(other.sec);
+ }
+ if (other.isSetRfe()) {
+ this.rfe = new ReplicationFailedException(other.rfe);
+ }
+ }
+
+ public replicateData_result deepCopy() {
+ return new replicateData_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ this.sec = null;
+ this.rfe = null;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public replicateData_result setSuccess(boolean success) {
+ this.success = success;
+ setSuccessIsSet(true);
+ return this;
+ }
+
+ public void unsetSuccess() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ }
+
+ public org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException getSec() {
+ return this.sec;
+ }
+
+ public replicateData_result setSec(org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) {
+ this.sec = sec;
+ return this;
+ }
+
+ public void unsetSec() {
+ this.sec = null;
+ }
+
+ /** Returns true if field sec is set (has been assigned a value) and false otherwise */
+ public boolean isSetSec() {
+ return this.sec != null;
+ }
+
+ public void setSecIsSet(boolean value) {
+ if (!value) {
+ this.sec = null;
+ }
+ }
+
+ public ReplicationFailedException getRfe() {
+ return this.rfe;
+ }
+
+ public replicateData_result setRfe(ReplicationFailedException rfe) {
+ this.rfe = rfe;
+ return this;
+ }
+
+ public void unsetRfe() {
+ this.rfe = null;
+ }
+
+ /** Returns true if field rfe is set (has been assigned a value) and false otherwise */
+ public boolean isSetRfe() {
+ return this.rfe != null;
+ }
+
+ public void setRfeIsSet(boolean value) {
+ if (!value) {
+ this.rfe = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ case SEC:
+ if (value == null) {
+ unsetSec();
+ } else {
+ setSec((org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException)value);
+ }
+ break;
+
+ case RFE:
+ if (value == null) {
+ unsetRfe();
+ } else {
+ setRfe((ReplicationFailedException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return Boolean.valueOf(isSuccess());
+
+ case SEC:
+ return getSec();
+
+ case RFE:
+ return getRfe();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ case SEC:
+ return isSetSec();
+ case RFE:
+ return isSetRfe();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof replicateData_result)
+ return this.equals((replicateData_result)that);
+ return false;
+ }
+
+ public boolean equals(replicateData_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true;
+ boolean that_present_success = true;
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (this.success != that.success)
+ return false;
+ }
+
+ boolean this_present_sec = true && this.isSetSec();
+ boolean that_present_sec = true && that.isSetSec();
+ if (this_present_sec || that_present_sec) {
+ if (!(this_present_sec && that_present_sec))
+ return false;
+ if (!this.sec.equals(that.sec))
+ return false;
+ }
+
+ boolean this_present_rfe = true && this.isSetRfe();
+ boolean that_present_rfe = true && that.isSetRfe();
+ if (this_present_rfe || that_present_rfe) {
+ if (!(this_present_rfe && that_present_rfe))
+ return false;
+ if (!this.rfe.equals(that.rfe))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(replicateData_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ replicateData_result typedOther = (replicateData_result)other;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSec()).compareTo(typedOther.isSetSec());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSec()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sec, typedOther.sec);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRfe()).compareTo(typedOther.isSetRfe());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRfe()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rfe, typedOther.rfe);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("replicateData_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("sec:");
+ if (this.sec == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.sec);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("rfe:");
+ if (this.rfe == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rfe);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class replicateData_resultStandardSchemeFactory implements SchemeFactory {
+ public replicateData_resultStandardScheme getScheme() {
+ return new replicateData_resultStandardScheme();
+ }
+ }
+
+ private static class replicateData_resultStandardScheme extends StandardScheme<replicateData_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, replicateData_result 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 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 1: // SEC
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.sec = new org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException();
+ struct.sec.read(iprot);
+ struct.setSecIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // RFE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.rfe = new ReplicationFailedException();
+ struct.rfe.read(iprot);
+ struct.setRfeIsSet(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, replicateData_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeBool(struct.success);
+ oprot.writeFieldEnd();
+ }
+ if (struct.sec != null) {
+ oprot.writeFieldBegin(SEC_FIELD_DESC);
+ struct.sec.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.rfe != null) {
+ oprot.writeFieldBegin(RFE_FIELD_DESC);
+ struct.rfe.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class replicateData_resultTupleSchemeFactory implements SchemeFactory {
+ public replicateData_resultTupleScheme getScheme() {
+ return new replicateData_resultTupleScheme();
+ }
+ }
+
+ private static class replicateData_resultTupleScheme extends TupleScheme<replicateData_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, replicateData_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetSec()) {
+ optionals.set(1);
+ }
+ if (struct.isSetRfe()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ if (struct.isSetSec()) {
+ struct.sec.write(oprot);
+ }
+ if (struct.isSetRfe()) {
+ struct.rfe.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, replicateData_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.sec = new org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException();
+ struct.sec.read(iprot);
+ struct.setSecIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.rfe = new ReplicationFailedException();
+ struct.rfe.read(iprot);
+ struct.setRfeIsSet(true);
+ }
+ }
+ }
+
+ }
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/scripts/generate-thrift.sh
----------------------------------------------------------------------
diff --git a/core/src/main/scripts/generate-thrift.sh b/core/src/main/scripts/generate-thrift.sh
index 5a5d69f..ee51b11 100755
--- a/core/src/main/scripts/generate-thrift.sh
+++ b/core/src/main/scripts/generate-thrift.sh
@@ -29,7 +29,7 @@
[ -z $REQUIRED_THRIFT_VERSION ] && REQUIRED_THRIFT_VERSION='0.9'
[ -z $INCLUDED_MODULES ] && INCLUDED_MODULES=(../trace)
[ -z $BASE_OUTPUT_PACKAGE ] && BASE_OUTPUT_PACKAGE='org.apache.accumulo.core'
-[ -z $PACKAGES_TO_GENERATE ] && PACKAGES_TO_GENERATE=(gc master tabletserver security client.impl data)
+[ -z $PACKAGES_TO_GENERATE ] && PACKAGES_TO_GENERATE=(gc master tabletserver security client.impl data replication)
[ -z $BUILD_DIR ] && BUILD_DIR='target'
[ -z $LANGUAGES_TO_GENERATE ] && LANGUAGES_TO_GENERATE=(java)
[ -z $FINAL_DIR ] && FINAL_DIR='src/main'
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/thrift/replication.thrift
----------------------------------------------------------------------
diff --git a/core/src/main/thrift/replication.thrift b/core/src/main/thrift/replication.thrift
new file mode 100644
index 0000000..a71d200
--- /dev/null
+++ b/core/src/main/thrift/replication.thrift
@@ -0,0 +1,39 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+namespace java org.apache.accumulo.core.replication.thrift
+namespace cpp org.apache.accumulo.core.replication.thrift
+
+include "data.thrift"
+
+struct WalEdits {
+ 1:list<binary> edits
+}
+
+struct KeyValues {
+ 1:list<data.TKeyValue> keyValues
+}
+
+exception RemoteReplicationException {
+ 1:i32 code,
+ 2:string reason
+}
+
+service RemoteReplication {
+ void replicateLog(1:i32 remoteTableId, 2:WalEdits data) throws (1:RemoteReplicationException e),
+ void replicateKeyValues(1:i32 remoteTableId, 2:KeyValues data) throws (1:RemoteReplicationException e)
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/core/src/main/thrift/tabletserver.thrift
----------------------------------------------------------------------
diff --git a/core/src/main/thrift/tabletserver.thrift b/core/src/main/thrift/tabletserver.thrift
index 25e0b10..8f85ab3 100644
--- a/core/src/main/thrift/tabletserver.thrift
+++ b/core/src/main/thrift/tabletserver.thrift
@@ -38,6 +38,10 @@ exception ConstraintViolationException {
1:list<data.TConstraintViolationSummary> violationSummaries
}
+exception ReplicationFailedException {
+ 1:string reason
+}
+
struct ActionStats {
1:i32 status
2:double elapsed
@@ -197,6 +201,8 @@ service TabletClientService extends client.ClientService {
list<ActiveScan> getActiveScans(2:trace.TInfo tinfo, 1:security.TCredentials credentials) throws (1:client.ThriftSecurityException sec)
list<ActiveCompaction> getActiveCompactions(2:trace.TInfo tinfo, 1:security.TCredentials credentials) throws (1:client.ThriftSecurityException sec)
oneway void removeLogs(1:trace.TInfo tinfo, 2:security.TCredentials credentials, 3:list<string> filenames)
+
+ bool replicateData(1:trace.TInfo tinfo, 2:security.TCredentials credentials, 3:string file, 4:i64 offset, 5:i64 count) throws (1:client.ThriftSecurityException sec, 2:ReplicationFailedException rfe)
}
typedef i32 TabletID
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d257001d/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 9a4b46f..b14c13b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -125,6 +125,7 @@ import org.apache.accumulo.core.tabletserver.thrift.ActiveScan;
import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException;
import org.apache.accumulo.core.tabletserver.thrift.NoSuchScanIDException;
import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
+import org.apache.accumulo.core.tabletserver.thrift.ReplicationFailedException;
import org.apache.accumulo.core.tabletserver.thrift.ScanState;
import org.apache.accumulo.core.tabletserver.thrift.ScanType;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
@@ -222,6 +223,7 @@ import org.apache.accumulo.tserver.metrics.TabletServerMinCMetrics;
import org.apache.accumulo.tserver.metrics.TabletServerScanMetrics;
import org.apache.accumulo.tserver.metrics.TabletServerUpdateMetrics;
import org.apache.commons.collections.map.LRUMap;
+import org.apache.commons.lang.NotImplementedException;
import org.apache.hadoop.fs.FSError;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
@@ -2542,6 +2544,13 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
return ret;
}
+
+ @Override
+ public boolean replicateData(TInfo tinfo, TCredentials credentials, String file, long offset, long count) throws ThriftSecurityException,
+ ReplicationFailedException, TException {
+ // TODO ACCUMULO-2581
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
private class SplitRunner implements Runnable {