Permalink
Browse files

Update Thrift generated bindings to work with 0.7.0-beta3

  • Loading branch information...
1 parent 131be66 commit dbcd8dafa8bbab7bc5da03831d666e3e4af6ebb7 @thobbs committed Nov 12, 2010
@@ -6,7 +6,6 @@
import java.util.List;
import java.util.TimeZone;
-import org.apache.cassandra.thrift.Clock;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.safehaus.uuid.UUID;
@@ -66,7 +65,7 @@ public void open() throws IOException {
@Override
public void append(Event event) throws IOException {
- Clock clock = new Clock(System.currentTimeMillis() * MILLI_TO_MICRO);
+ long timestamp = System.currentTimeMillis() * MILLI_TO_MICRO;
UUID uuid = uuidGen.generateTimeBasedUUID();
@@ -97,14 +96,14 @@ public void append(Event event) throws IOException {
finalBytes[i + eventInfoBytes.length] = eventBody[i];
}
- Column identColumn = new Column(IDENT_NAME, "ident".getBytes(), clock);
- Column sourceColumn = new Column(SOURCE_NAME, host.getBytes(), clock);
- Column dateColumn = new Column(DATE_NAME, date.getBytes(), clock);
- Column entryColumn = new Column(ENTRY_NAME, finalBytes, clock);
+ Column identColumn = new Column(IDENT_NAME, "ident".getBytes(), timestamp);
+ Column sourceColumn = new Column(SOURCE_NAME, host.getBytes(), timestamp);
+ Column dateColumn = new Column(DATE_NAME, date.getBytes(), timestamp);
+ Column entryColumn = new Column(ENTRY_NAME, finalBytes, timestamp);
Column[] entryColumns = {identColumn, sourceColumn, dateColumn, entryColumn};
Long time = System.currentTimeMillis() * MILLI_TO_MICRO;
- Column timeColumn = new Column(toBytes(time), uuid.toString().getBytes(), clock);
+ Column timeColumn = new Column(toBytes(time), uuid.toString().getBytes(), timestamp);
Column[] byDateColumns = {timeColumn};
// Insert the entry
@@ -198,4 +197,4 @@ public EventSink build(Context context, String ... args) {
builders.add(new Pair<String, SinkBuilder>("logsandraSyslogSink", builder()));
return builders;
}
-}
+}
@@ -62,14 +62,14 @@ public void open() throws IOException {
@Override
public void append(Event event) throws IOException {
- Clock clock = new Clock(System.currentTimeMillis() * MILLI_TO_MICRO);
+ long timestamp = System.currentTimeMillis() * MILLI_TO_MICRO;
// Make the index column
UUID uuid = uuidGen.generateTimeBasedUUID();
- Column indexColumn = new Column(uuid.toByteArray(), new byte[0], clock);
+ Column indexColumn = new Column(uuid.toByteArray(), new byte[0], timestamp);
// Make the data column
- Column dataColumn = new Column("data".getBytes(), event.getBody(), clock);
+ Column dataColumn = new Column("data".getBytes(), event.getBody(), timestamp);
// Insert the index
this.cClient.insert(this.getKey(), this.indexColumnFamily, new Column[] {indexColumn}, ConsistencyLevel.QUORUM);
@@ -133,4 +133,4 @@ public EventSink build(Context context, String ... args) {
builders.add(new Pair<String, SinkBuilder>("simpleCassandraSink", builder()));
return builders;
}
-}
+}
@@ -29,13 +29,13 @@
public class AuthenticationException extends Exception implements TBase<AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> {
private static final TStruct STRUCT_DESC = new TStruct("AuthenticationException");
- private static final TField WHY_FIELD_DESC = new TField("why", TType.STRING, (short)1);
+ private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
- public String why;
+ public String message;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- WHY((short)1, "why");
+ MESSAGE((short)1, "message");
private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -91,7 +91,7 @@ public String getFieldName() {
// isset id assignments
public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.WHY, new FieldMetaData("why", TFieldRequirementType.REQUIRED,
+ put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
}});
@@ -103,18 +103,18 @@ public AuthenticationException() {
}
public AuthenticationException(
- String why)
+ String message)
{
this();
- this.why = why;
+ this.message = message;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AuthenticationException(AuthenticationException other) {
- if (other.isSetWhy()) {
- this.why = other.why;
+ if (other.isSetMessage()) {
+ this.message = other.message;
}
}
@@ -127,37 +127,37 @@ public AuthenticationException clone() {
return new AuthenticationException(this);
}
- public String getWhy() {
- return this.why;
+ public String getMessage() {
+ return this.message;
}
- public AuthenticationException setWhy(String why) {
- this.why = why;
+ public AuthenticationException setMessage(String message) {
+ this.message = message;
return this;
}
- public void unsetWhy() {
- this.why = null;
+ public void unsetMessage() {
+ this.message = null;
}
- /** Returns true if field why is set (has been asigned a value) and false otherwise */
- public boolean isSetWhy() {
- return this.why != null;
+ /** Returns true if field message is set (has been asigned a value) and false otherwise */
+ public boolean isSetMessage() {
+ return this.message != null;
}
- public void setWhyIsSet(boolean value) {
+ public void setMessageIsSet(boolean value) {
if (!value) {
- this.why = null;
+ this.message = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case WHY:
+ case MESSAGE:
if (value == null) {
- unsetWhy();
+ unsetMessage();
} else {
- setWhy((String)value);
+ setMessage((String)value);
}
break;
@@ -170,8 +170,8 @@ public void setFieldValue(int fieldID, Object value) {
public Object getFieldValue(_Fields field) {
switch (field) {
- case WHY:
- return getWhy();
+ case MESSAGE:
+ return getMessage();
}
throw new IllegalStateException();
@@ -184,8 +184,8 @@ public Object getFieldValue(int fieldId) {
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
switch (field) {
- case WHY:
- return isSetWhy();
+ case MESSAGE:
+ return isSetMessage();
}
throw new IllegalStateException();
}
@@ -207,12 +207,12 @@ public boolean equals(AuthenticationException that) {
if (that == null)
return false;
- boolean this_present_why = true && this.isSetWhy();
- boolean that_present_why = true && that.isSetWhy();
- if (this_present_why || that_present_why) {
- if (!(this_present_why && that_present_why))
+ boolean this_present_message = true && this.isSetMessage();
+ boolean that_present_message = true && that.isSetMessage();
+ if (this_present_message || that_present_message) {
+ if (!(this_present_message && that_present_message))
return false;
- if (!this.why.equals(that.why))
+ if (!this.message.equals(that.message))
return false;
}
@@ -232,11 +232,11 @@ public int compareTo(AuthenticationException other) {
int lastComparison = 0;
AuthenticationException typedOther = (AuthenticationException)other;
- lastComparison = Boolean.valueOf(isSetWhy()).compareTo(isSetWhy());
+ lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(why, typedOther.why);
+ lastComparison = TBaseHelper.compareTo(message, typedOther.message);
if (lastComparison != 0) {
return lastComparison;
}
@@ -257,9 +257,9 @@ public void read(TProtocol iprot) throws TException {
TProtocolUtil.skip(iprot, field.type);
} else {
switch (fieldId) {
- case WHY:
+ case MESSAGE:
if (field.type == TType.STRING) {
- this.why = iprot.readString();
+ this.message = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
@@ -278,9 +278,9 @@ public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
- if (this.why != null) {
- oprot.writeFieldBegin(WHY_FIELD_DESC);
- oprot.writeString(this.why);
+ if (this.message != null) {
+ oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+ oprot.writeString(this.message);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
@@ -292,11 +292,11 @@ public String toString() {
StringBuilder sb = new StringBuilder("AuthenticationException(");
boolean first = true;
- sb.append("why:");
- if (this.why == null) {
+ sb.append("message:");
+ if (this.message == null) {
sb.append("null");
} else {
- sb.append(this.why);
+ sb.append(this.message);
}
first = false;
sb.append(")");
@@ -305,8 +305,8 @@ public String toString() {
public void validate() throws TException {
// check for required fields
- if (why == null) {
- throw new TProtocolException("Required field 'why' was not present! Struct: " + toString());
+ if (message == null) {
+ throw new TProtocolException("Required field 'message' was not present! Struct: " + toString());
}
}
Oops, something went wrong.

0 comments on commit dbcd8da

Please sign in to comment.