Skip to content

Commit

Permalink
downgrade hadoop to released version. add timezones to thrift proto.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Blackman committed Apr 2, 2012
1 parent 34a3611 commit f547ac2
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 30 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class GeocodeFeature implements TBase<GeocodeFeature, GeocodeFeature._Fie
private static final TField IDS_FIELD_DESC = new TField("ids", TType.LIST, (short)6); private static final TField IDS_FIELD_DESC = new TField("ids", TType.LIST, (short)6);
private static final TField NAMES_FIELD_DESC = new TField("names", TType.LIST, (short)7); private static final TField NAMES_FIELD_DESC = new TField("names", TType.LIST, (short)7);
private static final TField ATTRIBUTION_FIELD_DESC = new TField("attribution", TType.LIST, (short)8); private static final TField ATTRIBUTION_FIELD_DESC = new TField("attribution", TType.LIST, (short)8);
private static final TField TIMEZONES_FIELD_DESC = new TField("timezones", TType.LIST, (short)9);


public String cc; public String cc;
public FeatureGeometry geometry; public FeatureGeometry geometry;
Expand All @@ -52,6 +53,7 @@ public class GeocodeFeature implements TBase<GeocodeFeature, GeocodeFeature._Fie
public List<FeatureId> ids; public List<FeatureId> ids;
public List<FeatureName> names; public List<FeatureName> names;
public List<String> attribution; public List<String> attribution;
public List<String> timezones;


/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum { public enum _Fields implements TFieldIdEnum {
Expand All @@ -66,7 +68,8 @@ public enum _Fields implements TFieldIdEnum {
WOE_TYPE((short)5, "woeType"), WOE_TYPE((short)5, "woeType"),
IDS((short)6, "ids"), IDS((short)6, "ids"),
NAMES((short)7, "names"), NAMES((short)7, "names"),
ATTRIBUTION((short)8, "attribution"); ATTRIBUTION((short)8, "attribution"),
TIMEZONES((short)9, "timezones");


private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();


Expand Down Expand Up @@ -97,6 +100,8 @@ public static _Fields findByThriftId(int fieldId) {
return NAMES; return NAMES;
case 8: // ATTRIBUTION case 8: // ATTRIBUTION
return ATTRIBUTION; return ATTRIBUTION;
case 9: // TIMEZONES
return TIMEZONES;
default: default:
return null; return null;
} }
Expand Down Expand Up @@ -160,6 +165,9 @@ public String getFieldName() {
tmpMap.put(_Fields.ATTRIBUTION, new FieldMetaData("attribution", TFieldRequirementType.OPTIONAL, tmpMap.put(_Fields.ATTRIBUTION, new FieldMetaData("attribution", TFieldRequirementType.OPTIONAL,
new ListMetaData(TType.LIST, new ListMetaData(TType.LIST,
new FieldValueMetaData(TType.STRING)))); new FieldValueMetaData(TType.STRING))));
tmpMap.put(_Fields.TIMEZONES, new FieldMetaData("timezones", TFieldRequirementType.OPTIONAL,
new ListMetaData(TType.LIST,
new FieldValueMetaData(TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap); metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(GeocodeFeature.class, metaDataMap); FieldMetaData.addStructMetaDataMap(GeocodeFeature.class, metaDataMap);
} }
Expand Down Expand Up @@ -216,6 +224,13 @@ public GeocodeFeature(GeocodeFeature other) {
} }
this.attribution = __this__attribution; this.attribution = __this__attribution;
} }
if (other.isSetTimezones()) {
List<String> __this__timezones = new ArrayList<String>();
for (String other_element : other.timezones) {
__this__timezones.add(other_element);
}
this.timezones = __this__timezones;
}
} }


public GeocodeFeature deepCopy() { public GeocodeFeature deepCopy() {
Expand All @@ -232,6 +247,7 @@ public void clear() {
this.ids = null; this.ids = null;
this.names = null; this.names = null;
this.attribution = null; this.attribution = null;
this.timezones = null;
} }


public String getCc() { public String getCc() {
Expand Down Expand Up @@ -479,6 +495,45 @@ public void setAttributionIsSet(boolean value) {
} }
} }


public int getTimezonesSize() {
return (this.timezones == null) ? 0 : this.timezones.size();
}

public java.util.Iterator<String> getTimezonesIterator() {
return (this.timezones == null) ? null : this.timezones.iterator();
}

public void addToTimezones(String elem) {
if (this.timezones == null) {
this.timezones = new ArrayList<String>();
}
this.timezones.add(elem);
}

public List<String> getTimezones() {
return this.timezones;
}

public GeocodeFeature setTimezones(List<String> timezones) {
this.timezones = timezones;
return this;
}

public void unsetTimezones() {
this.timezones = null;
}

/** Returns true if field timezones is set (has been asigned a value) and false otherwise */
public boolean isSetTimezones() {
return this.timezones != null;
}

public void setTimezonesIsSet(boolean value) {
if (!value) {
this.timezones = null;
}
}

public void setFieldValue(_Fields field, Object value) { public void setFieldValue(_Fields field, Object value) {
switch (field) { switch (field) {
case CC: case CC:
Expand Down Expand Up @@ -545,6 +600,14 @@ public void setFieldValue(_Fields field, Object value) {
} }
break; break;


case TIMEZONES:
if (value == null) {
unsetTimezones();
} else {
setTimezones((List<String>)value);
}
break;

} }
} }


Expand Down Expand Up @@ -574,6 +637,9 @@ public Object getFieldValue(_Fields field) {
case ATTRIBUTION: case ATTRIBUTION:
return getAttribution(); return getAttribution();


case TIMEZONES:
return getTimezones();

} }
throw new IllegalStateException(); throw new IllegalStateException();
} }
Expand Down Expand Up @@ -601,6 +667,8 @@ public boolean isSet(_Fields field) {
return isSetNames(); return isSetNames();
case ATTRIBUTION: case ATTRIBUTION:
return isSetAttribution(); return isSetAttribution();
case TIMEZONES:
return isSetTimezones();
} }
throw new IllegalStateException(); throw new IllegalStateException();
} }
Expand Down Expand Up @@ -690,6 +758,15 @@ public boolean equals(GeocodeFeature that) {
return false; return false;
} }


boolean this_present_timezones = true && this.isSetTimezones();
boolean that_present_timezones = true && that.isSetTimezones();
if (this_present_timezones || that_present_timezones) {
if (!(this_present_timezones && that_present_timezones))
return false;
if (!this.timezones.equals(that.timezones))
return false;
}

return true; return true;
} }


Expand Down Expand Up @@ -786,6 +863,16 @@ public int compareTo(GeocodeFeature other) {
return lastComparison; return lastComparison;
} }
} }
lastComparison = Boolean.valueOf(isSetTimezones()).compareTo(typedOther.isSetTimezones());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTimezones()) {
lastComparison = TBaseHelper.compareTo(this.timezones, typedOther.timezones);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0; return 0;
} }


Expand Down Expand Up @@ -892,6 +979,23 @@ public void read(TProtocol iprot) throws TException {
TProtocolUtil.skip(iprot, field.type); TProtocolUtil.skip(iprot, field.type);
} }
break; break;
case 9: // TIMEZONES
if (field.type == TType.LIST) {
{
TList _list17 = iprot.readListBegin();
this.timezones = new ArrayList<String>(_list17.size);
for (int _i18 = 0; _i18 < _list17.size; ++_i18)
{
String _elem19;
_elem19 = iprot.readString();
this.timezones.add(_elem19);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default: default:
TProtocolUtil.skip(iprot, field.type); TProtocolUtil.skip(iprot, field.type);
} }
Expand Down Expand Up @@ -943,9 +1047,9 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldBegin(IDS_FIELD_DESC); oprot.writeFieldBegin(IDS_FIELD_DESC);
{ {
oprot.writeListBegin(new TList(TType.STRUCT, this.ids.size())); oprot.writeListBegin(new TList(TType.STRUCT, this.ids.size()));
for (FeatureId _iter17 : this.ids) for (FeatureId _iter20 : this.ids)
{ {
_iter17.write(oprot); _iter20.write(oprot);
} }
oprot.writeListEnd(); oprot.writeListEnd();
} }
Expand All @@ -957,9 +1061,9 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldBegin(NAMES_FIELD_DESC); oprot.writeFieldBegin(NAMES_FIELD_DESC);
{ {
oprot.writeListBegin(new TList(TType.STRUCT, this.names.size())); oprot.writeListBegin(new TList(TType.STRUCT, this.names.size()));
for (FeatureName _iter18 : this.names) for (FeatureName _iter21 : this.names)
{ {
_iter18.write(oprot); _iter21.write(oprot);
} }
oprot.writeListEnd(); oprot.writeListEnd();
} }
Expand All @@ -971,9 +1075,23 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldBegin(ATTRIBUTION_FIELD_DESC); oprot.writeFieldBegin(ATTRIBUTION_FIELD_DESC);
{ {
oprot.writeListBegin(new TList(TType.STRING, this.attribution.size())); oprot.writeListBegin(new TList(TType.STRING, this.attribution.size()));
for (String _iter19 : this.attribution) for (String _iter22 : this.attribution)
{
oprot.writeString(_iter22);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.timezones != null) {
if (isSetTimezones()) {
oprot.writeFieldBegin(TIMEZONES_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.timezones.size()));
for (String _iter23 : this.timezones)
{ {
oprot.writeString(_iter19); oprot.writeString(_iter23);
} }
oprot.writeListEnd(); oprot.writeListEnd();
} }
Expand Down Expand Up @@ -1064,6 +1182,16 @@ public String toString() {
} }
first = false; first = false;
} }
if (isSetTimezones()) {
if (!first) sb.append(", ");
sb.append("timezones:");
if (this.timezones == null) {
sb.append("null");
} else {
sb.append(this.timezones);
}
first = false;
}
sb.append(")"); sb.append(")");
return sb.toString(); return sb.toString();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ public void read(TProtocol iprot) throws TException {
case 4: // PARENTS case 4: // PARENTS
if (field.type == TType.LIST) { if (field.type == TType.LIST) {
{ {
TList _list20 = iprot.readListBegin(); TList _list24 = iprot.readListBegin();
this.parents = new ArrayList<GeocodeFeature>(_list20.size); this.parents = new ArrayList<GeocodeFeature>(_list24.size);
for (int _i21 = 0; _i21 < _list20.size; ++_i21) for (int _i25 = 0; _i25 < _list24.size; ++_i25)
{ {
GeocodeFeature _elem22; GeocodeFeature _elem26;
_elem22 = new GeocodeFeature(); _elem26 = new GeocodeFeature();
_elem22.read(iprot); _elem26.read(iprot);
this.parents.add(_elem22); this.parents.add(_elem26);
} }
iprot.readListEnd(); iprot.readListEnd();
} }
Expand Down Expand Up @@ -556,9 +556,9 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldBegin(PARENTS_FIELD_DESC); oprot.writeFieldBegin(PARENTS_FIELD_DESC);
{ {
oprot.writeListBegin(new TList(TType.STRUCT, this.parents.size())); oprot.writeListBegin(new TList(TType.STRUCT, this.parents.size()));
for (GeocodeFeature _iter23 : this.parents) for (GeocodeFeature _iter27 : this.parents)
{ {
_iter23.write(oprot); _iter27.write(oprot);
} }
oprot.writeListEnd(); oprot.writeListEnd();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ public void read(TProtocol iprot) throws TException {
case 1: // INTERPRETATIONS case 1: // INTERPRETATIONS
if (field.type == TType.LIST) { if (field.type == TType.LIST) {
{ {
TList _list24 = iprot.readListBegin(); TList _list28 = iprot.readListBegin();
this.interpretations = new ArrayList<GeocodeInterpretation>(_list24.size); this.interpretations = new ArrayList<GeocodeInterpretation>(_list28.size);
for (int _i25 = 0; _i25 < _list24.size; ++_i25) for (int _i29 = 0; _i29 < _list28.size; ++_i29)
{ {
GeocodeInterpretation _elem26; GeocodeInterpretation _elem30;
_elem26 = new GeocodeInterpretation(); _elem30 = new GeocodeInterpretation();
_elem26.read(iprot); _elem30.read(iprot);
this.interpretations.add(_elem26); this.interpretations.add(_elem30);
} }
iprot.readListEnd(); iprot.readListEnd();
} }
Expand All @@ -313,9 +313,9 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldBegin(INTERPRETATIONS_FIELD_DESC); oprot.writeFieldBegin(INTERPRETATIONS_FIELD_DESC);
{ {
oprot.writeListBegin(new TList(TType.STRUCT, this.interpretations.size())); oprot.writeListBegin(new TList(TType.STRUCT, this.interpretations.size()));
for (GeocodeInterpretation _iter27 : this.interpretations) for (GeocodeInterpretation _iter31 : this.interpretations)
{ {
_iter27.write(oprot); _iter31.write(oprot);
} }
oprot.writeListEnd(); oprot.writeListEnd();
} }
Expand Down
1 change: 1 addition & 0 deletions interface/src/main/thrift/geocoder.thrift
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct GeocodeFeature {
6: optional list<FeatureId> ids, 6: optional list<FeatureId> ids,
7: optional list<FeatureName> names, 7: optional list<FeatureName> names,
8: optional list<string> attribution, 8: optional list<string> attribution,
9: optional list<string> timezones
} }


struct GeocodeServingFeature { struct GeocodeServingFeature {
Expand Down
8 changes: 3 additions & 5 deletions project/GeocoderBuild.scala
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,14 +81,12 @@ object GeocoderBuild extends Build {
"com.twitter" % "util-core_2.9.1" % "1.12.8", "com.twitter" % "util-core_2.9.1" % "1.12.8",
"com.twitter" % "util-logging_2.9.1" % "1.12.8", "com.twitter" % "util-logging_2.9.1" % "1.12.8",
"org.slf4j" % "slf4j-api" % "1.6.1", "org.slf4j" % "slf4j-api" % "1.6.1",
"org.apache.hadoop" % "hadoop-core" % "0.20.2-cdh3u3b", "org.apache.hadoop" % "hadoop-core" % "0.20.2-cdh3u3",
"org.apache.hbase" % "hbase" % "0.92.0-cdh4b1" "org.apache.hbase" % "hbase" % "0.90.4-cdh3u3"
), ),
ivyXML := ( ivyXML := (
<dependencies> <dependencies>
<exclude org="org.mongodb" name="mongo-java-driver"/> <exclude org="org.apache.thrift"/>
<exclude org="org.mortbay.jetty" name="jetty"/>
<exclude org="org.apache.avro" name="avro-ipc"/>
</dependencies> </dependencies>
) )
) )
Expand Down

0 comments on commit f547ac2

Please sign in to comment.