public ClientMetadata deepCopy() { return new ClientMetadata(this); }
public Object getFieldValue(_Fields field) { switch (field) { case HOST: return get_host(); case CONNECTED_AT: return Long.valueOf(get_connected_at()); case TYPE: return get_type(); case VERSION: return get_version(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ClientMetadata) return this.equals((ClientMetadata)that); return false; }
/** * Performs a deep copy on <i>other</i>. */ public ClientMetadata(ClientMetadata other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_host()) { this.host = other.host; } this.connected_at = other.connected_at; if (other.is_set_type()) { this.type = other.type; } if (other.is_set_version()) { this.version = other.version; } }
/** 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 HOST: return is_set_host(); case CONNECTED_AT: return is_set_connected_at(); case TYPE: return is_set_type(); case VERSION: return is_set_version(); } throw new IllegalStateException(); }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host = iprot.readString(); struct.set_host_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.connected_at = iprot.readI64(); struct.set_connected_at_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.type = iprot.readString(); struct.set_type_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.version = iprot.readString(); struct.set_version_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (!struct.is_set_connected_at()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'connected_at' was not found in serialized data! Struct: " + toString()); struct.validate();
lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); if (lastComparison != 0) { return lastComparison; if (is_set_host()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); if (lastComparison != 0) { lastComparison = Boolean.valueOf(is_set_connected_at()).compareTo(typedOther.is_set_connected_at()); if (lastComparison != 0) { return lastComparison; if (is_set_connected_at()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connected_at, typedOther.connected_at); if (lastComparison != 0) { lastComparison = Boolean.valueOf(is_set_type()).compareTo(typedOther.is_set_type()); if (lastComparison != 0) { return lastComparison; if (is_set_type()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); if (lastComparison != 0) { lastComparison = Boolean.valueOf(is_set_version()).compareTo(typedOther.is_set_version()); if (lastComparison != 0) { return lastComparison; if (is_set_version()) {
return false; boolean this_present_host = true && this.is_set_host(); boolean that_present_host = true && that.is_set_host(); if (this_present_host || that_present_host) { if (!(this_present_host && that_present_host)) boolean this_present_type = true && this.is_set_type(); boolean that_present_type = true && that.is_set_type(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) boolean this_present_version = true && this.is_set_version(); boolean that_present_version = true && that.is_set_version(); if (this_present_version || that_present_version) { if (!(this_present_version && that_present_version))
protected RingGroupData getRingGroupData(RingGroup ringGroup) throws IOException { RingGroupData data = new RingGroupData(); data.name = ringGroup.getName(); data.isRingGroupConductorOnline = ringGroup.isRingGroupConductorOnline(); data.ringGroupConductorMode = ringGroup.getRingGroupConductorMode(); data.domainGroupName = ringGroup.getDomainGroup().getName(); ServingStatus servingStatus = RingGroups.computeServingStatusAggregator(ringGroup, ringGroup.getDomainGroup()).computeServingStatus(); data.numPartitions = servingStatus.getNumPartitions(); data.numPartitionsServedAndUpToDate = servingStatus.getNumPartitionsServedAndUpToDate(); Map<Integer, RingData> ringsMap = new HashMap<Integer, RingData>(); for (Ring ring : ringGroup.getRings()) { ringsMap.put(ring.getRingNumber(), getRingData(ring)); } data.ringsMap = ringsMap; data.clients = Maps.newHashMap(); for (ClientMetadata clientData : ringGroup.getClients()) { data.clients.put(clientData.get_host(), new ConnectedHostData( clientData.get_host(), Long.toString(clientData.get_connected_at()), clientData.get_type(), clientData.get_version() )); } return data; }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_host = true && (is_set_host()); builder.append(present_host); if (present_host) builder.append(host); boolean present_connected_at = true; builder.append(present_connected_at); if (present_connected_at) builder.append(connected_at); boolean present_type = true && (is_set_type()); builder.append(present_type); if (present_type) builder.append(type); boolean present_version = true && (is_set_version()); builder.append(present_version); if (present_version) builder.append(version); return builder.toHashCode(); }
public static ClientMetadata getClientMetadata(HankClientIface client) { String hostName; try { hostName = LocalHostUtils.getHostName(); } catch (UnknownHostException e) { hostName = "unknown"; } return new ClientMetadata( hostName, System.currentTimeMillis(), client.getClass().getName(), Hank.getGitCommit()); } }
r3.addHost(addy("alpha-3-3"), Collections.<String>emptyList()); for (int i = 0; i < 16; ++i) { rg0.registerClient(new ClientMetadata( LocalHostUtils.getHostName(), System.currentTimeMillis(),