/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.server.appenders.flume.config.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class FlumeConfig extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"FlumeConfig\",\"namespace\":\"org.kaaproject.kaa.server.appenders.flume.config.gen\",\"fields\":[{\"name\":\"executorThreadPoolSize\",\"type\":\"int\",\"displayName\":\"Executor thread pool size\",\"by_default\":1},{\"name\":\"callbackThreadPoolSize\",\"type\":\"int\",\"displayName\":\"Callback thread pool size\",\"by_default\":2},{\"name\":\"clientsThreadPoolSize\",\"type\":\"int\",\"displayName\":\"RPC client max thread pool size\",\"by_default\":2},{\"name\":\"includeClientProfile\",\"type\":[\"boolean\",\"null\"],\"displayName\":\"Include client profile data\",\"by_default\":false},{\"name\":\"includeServerProfile\",\"type\":[\"boolean\",\"null\"],\"displayName\":\"Include server profile data\",\"by_default\":false},{\"name\":\"flumeEventFormat\",\"type\":{\"type\":\"enum\",\"name\":\"FlumeEventFormat\",\"symbols\":[\"RECORDS_CONTAINER\",\"GENERIC\"]},\"displayName\":\"Flume event format\",\"by_default\":\"RECORDS_CONTAINER\",\"displayNames\":[\"Records container\",\"Generic\"]},{\"name\":\"hostsBalancing\",\"type\":[{\"type\":\"record\",\"name\":\"PrioritizedFlumeNodes\",\"fields\":[{\"name\":\"flumeNodes\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"PrioritizedFlumeNode\",\"fields\":[{\"name\":\"host\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"displayName\":\"Host\",\"weight\":0.8,\"by_default\":\"localhost\"},{\"name\":\"port\",\"type\":\"int\",\"displayName\":\"Port\",\"weight\":0.1,\"by_default\":7070},{\"name\":\"priority\",\"type\":\"int\",\"displayName\":\"Priority\",\"weight\":0.1,\"by_default\":1}]}},\"displayName\":\"Flume nodes\",\"minRowCount\":1}],\"displayName\":\"Prioritized\"},{\"type\":\"record\",\"name\":\"FlumeNodes\",\"fields\":[{\"name\":\"flumeNodes\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"FlumeNode\",\"fields\":[{\"name\":\"host\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"displayName\":\"Host\",\"weight\":0.75,\"by_default\":\"localhost\"},{\"name\":\"port\",\"type\":\"int\",\"displayName\":\"Port\",\"weight\":0.25,\"by_default\":7070}]}},\"displayName\":\"Flume nodes\",\"minRowCount\":2}],\"displayName\":\"Round Robin\"}],\"displayName\":\"Hosts balancing\"}]}");
private int executorThreadPoolSize;
private int callbackThreadPoolSize;
private int clientsThreadPoolSize;
private java.lang.Boolean includeClientProfile;
private java.lang.Boolean includeServerProfile;
private org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat flumeEventFormat;
private java.lang.Object hostsBalancing;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use {@link \#newBuilder()}.
*/
public FlumeConfig() {
}
/**
* All-args constructor.
*/
public FlumeConfig(java.lang.Integer executorThreadPoolSize, java.lang.Integer callbackThreadPoolSize, java.lang.Integer clientsThreadPoolSize, java.lang.Boolean includeClientProfile, java.lang.Boolean includeServerProfile, org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat flumeEventFormat, java.lang.Object hostsBalancing) {
this.executorThreadPoolSize = executorThreadPoolSize;
this.callbackThreadPoolSize = callbackThreadPoolSize;
this.clientsThreadPoolSize = clientsThreadPoolSize;
this.includeClientProfile = includeClientProfile;
this.includeServerProfile = includeServerProfile;
this.flumeEventFormat = flumeEventFormat;
this.hostsBalancing = hostsBalancing;
}
public static org.apache.avro.Schema getClassSchema() {
return SCHEMA$;
}
/**
* Creates a new FlumeConfig RecordBuilder
*/
public static org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder newBuilder() {
return new org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder();
}
/**
* Creates a new FlumeConfig RecordBuilder by copying an existing Builder
*/
public static org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder newBuilder(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder other) {
return new org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder(other);
}
/**
* Creates a new FlumeConfig RecordBuilder by copying an existing FlumeConfig instance
*/
public static org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder newBuilder(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig other) {
return new org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder(other);
}
public org.apache.avro.Schema getSchema() {
return SCHEMA$;
}
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0:
return executorThreadPoolSize;
case 1:
return callbackThreadPoolSize;
case 2:
return clientsThreadPoolSize;
case 3:
return includeClientProfile;
case 4:
return includeServerProfile;
case 5:
return flumeEventFormat;
case 6:
return hostsBalancing;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0:
executorThreadPoolSize = (java.lang.Integer) value$;
break;
case 1:
callbackThreadPoolSize = (java.lang.Integer) value$;
break;
case 2:
clientsThreadPoolSize = (java.lang.Integer) value$;
break;
case 3:
includeClientProfile = (java.lang.Boolean) value$;
break;
case 4:
includeServerProfile = (java.lang.Boolean) value$;
break;
case 5:
flumeEventFormat = (org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat) value$;
break;
case 6:
hostsBalancing = (java.lang.Object) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'executorThreadPoolSize' field.
*/
public java.lang.Integer getExecutorThreadPoolSize() {
return executorThreadPoolSize;
}
/**
* Sets the value of the 'executorThreadPoolSize' field.
*
* @param value the value to set.
*/
public void setExecutorThreadPoolSize(java.lang.Integer value) {
this.executorThreadPoolSize = value;
}
/**
* Gets the value of the 'callbackThreadPoolSize' field.
*/
public java.lang.Integer getCallbackThreadPoolSize() {
return callbackThreadPoolSize;
}
/**
* Sets the value of the 'callbackThreadPoolSize' field.
*
* @param value the value to set.
*/
public void setCallbackThreadPoolSize(java.lang.Integer value) {
this.callbackThreadPoolSize = value;
}
/**
* Gets the value of the 'clientsThreadPoolSize' field.
*/
public java.lang.Integer getClientsThreadPoolSize() {
return clientsThreadPoolSize;
}
/**
* Sets the value of the 'clientsThreadPoolSize' field.
*
* @param value the value to set.
*/
public void setClientsThreadPoolSize(java.lang.Integer value) {
this.clientsThreadPoolSize = value;
}
/**
* Gets the value of the 'includeClientProfile' field.
*/
public java.lang.Boolean getIncludeClientProfile() {
return includeClientProfile;
}
/**
* Sets the value of the 'includeClientProfile' field.
*
* @param value the value to set.
*/
public void setIncludeClientProfile(java.lang.Boolean value) {
this.includeClientProfile = value;
}
/**
* Gets the value of the 'includeServerProfile' field.
*/
public java.lang.Boolean getIncludeServerProfile() {
return includeServerProfile;
}
/**
* Sets the value of the 'includeServerProfile' field.
*
* @param value the value to set.
*/
public void setIncludeServerProfile(java.lang.Boolean value) {
this.includeServerProfile = value;
}
/**
* Gets the value of the 'flumeEventFormat' field.
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat getFlumeEventFormat() {
return flumeEventFormat;
}
/**
* Sets the value of the 'flumeEventFormat' field.
*
* @param value the value to set.
*/
public void setFlumeEventFormat(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat value) {
this.flumeEventFormat = value;
}
/**
* Gets the value of the 'hostsBalancing' field.
*/
public java.lang.Object getHostsBalancing() {
return hostsBalancing;
}
/**
* Sets the value of the 'hostsBalancing' field.
*
* @param value the value to set.
*/
public void setHostsBalancing(java.lang.Object value) {
this.hostsBalancing = value;
}
/**
* RecordBuilder for FlumeConfig instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FlumeConfig>
implements org.apache.avro.data.RecordBuilder<FlumeConfig> {
private int executorThreadPoolSize;
private int callbackThreadPoolSize;
private int clientsThreadPoolSize;
private java.lang.Boolean includeClientProfile;
private java.lang.Boolean includeServerProfile;
private org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat flumeEventFormat;
private java.lang.Object hostsBalancing;
/**
* Creates a new Builder
*/
private Builder() {
super(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder
*/
private Builder(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder other) {
super(other);
if (isValidValue(fields()[0], other.executorThreadPoolSize)) {
this.executorThreadPoolSize = data().deepCopy(fields()[0].schema(), other.executorThreadPoolSize);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.callbackThreadPoolSize)) {
this.callbackThreadPoolSize = data().deepCopy(fields()[1].schema(), other.callbackThreadPoolSize);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.clientsThreadPoolSize)) {
this.clientsThreadPoolSize = data().deepCopy(fields()[2].schema(), other.clientsThreadPoolSize);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.includeClientProfile)) {
this.includeClientProfile = data().deepCopy(fields()[3].schema(), other.includeClientProfile);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.includeServerProfile)) {
this.includeServerProfile = data().deepCopy(fields()[4].schema(), other.includeServerProfile);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.flumeEventFormat)) {
this.flumeEventFormat = data().deepCopy(fields()[5].schema(), other.flumeEventFormat);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.hostsBalancing)) {
this.hostsBalancing = data().deepCopy(fields()[6].schema(), other.hostsBalancing);
fieldSetFlags()[6] = true;
}
}
/**
* Creates a Builder by copying an existing FlumeConfig instance
*/
private Builder(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig other) {
super(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.SCHEMA$);
if (isValidValue(fields()[0], other.executorThreadPoolSize)) {
this.executorThreadPoolSize = data().deepCopy(fields()[0].schema(), other.executorThreadPoolSize);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.callbackThreadPoolSize)) {
this.callbackThreadPoolSize = data().deepCopy(fields()[1].schema(), other.callbackThreadPoolSize);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.clientsThreadPoolSize)) {
this.clientsThreadPoolSize = data().deepCopy(fields()[2].schema(), other.clientsThreadPoolSize);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.includeClientProfile)) {
this.includeClientProfile = data().deepCopy(fields()[3].schema(), other.includeClientProfile);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.includeServerProfile)) {
this.includeServerProfile = data().deepCopy(fields()[4].schema(), other.includeServerProfile);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.flumeEventFormat)) {
this.flumeEventFormat = data().deepCopy(fields()[5].schema(), other.flumeEventFormat);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.hostsBalancing)) {
this.hostsBalancing = data().deepCopy(fields()[6].schema(), other.hostsBalancing);
fieldSetFlags()[6] = true;
}
}
/**
* Gets the value of the 'executorThreadPoolSize' field
*/
public java.lang.Integer getExecutorThreadPoolSize() {
return executorThreadPoolSize;
}
/**
* Sets the value of the 'executorThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setExecutorThreadPoolSize(int value) {
validate(fields()[0], value);
this.executorThreadPoolSize = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'executorThreadPoolSize' field has been set
*/
public boolean hasExecutorThreadPoolSize() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'executorThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearExecutorThreadPoolSize() {
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'callbackThreadPoolSize' field
*/
public java.lang.Integer getCallbackThreadPoolSize() {
return callbackThreadPoolSize;
}
/**
* Sets the value of the 'callbackThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setCallbackThreadPoolSize(int value) {
validate(fields()[1], value);
this.callbackThreadPoolSize = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'callbackThreadPoolSize' field has been set
*/
public boolean hasCallbackThreadPoolSize() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'callbackThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearCallbackThreadPoolSize() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'clientsThreadPoolSize' field
*/
public java.lang.Integer getClientsThreadPoolSize() {
return clientsThreadPoolSize;
}
/**
* Sets the value of the 'clientsThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setClientsThreadPoolSize(int value) {
validate(fields()[2], value);
this.clientsThreadPoolSize = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'clientsThreadPoolSize' field has been set
*/
public boolean hasClientsThreadPoolSize() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'clientsThreadPoolSize' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearClientsThreadPoolSize() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'includeClientProfile' field
*/
public java.lang.Boolean getIncludeClientProfile() {
return includeClientProfile;
}
/**
* Sets the value of the 'includeClientProfile' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setIncludeClientProfile(java.lang.Boolean value) {
validate(fields()[3], value);
this.includeClientProfile = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'includeClientProfile' field has been set
*/
public boolean hasIncludeClientProfile() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'includeClientProfile' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearIncludeClientProfile() {
includeClientProfile = null;
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'includeServerProfile' field
*/
public java.lang.Boolean getIncludeServerProfile() {
return includeServerProfile;
}
/**
* Sets the value of the 'includeServerProfile' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setIncludeServerProfile(java.lang.Boolean value) {
validate(fields()[4], value);
this.includeServerProfile = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'includeServerProfile' field has been set
*/
public boolean hasIncludeServerProfile() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'includeServerProfile' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearIncludeServerProfile() {
includeServerProfile = null;
fieldSetFlags()[4] = false;
return this;
}
/**
* Gets the value of the 'flumeEventFormat' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat getFlumeEventFormat() {
return flumeEventFormat;
}
/**
* Sets the value of the 'flumeEventFormat' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setFlumeEventFormat(org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat value) {
validate(fields()[5], value);
this.flumeEventFormat = value;
fieldSetFlags()[5] = true;
return this;
}
/**
* Checks whether the 'flumeEventFormat' field has been set
*/
public boolean hasFlumeEventFormat() {
return fieldSetFlags()[5];
}
/**
* Clears the value of the 'flumeEventFormat' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearFlumeEventFormat() {
flumeEventFormat = null;
fieldSetFlags()[5] = false;
return this;
}
/**
* Gets the value of the 'hostsBalancing' field
*/
public java.lang.Object getHostsBalancing() {
return hostsBalancing;
}
/**
* Sets the value of the 'hostsBalancing' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder setHostsBalancing(java.lang.Object value) {
validate(fields()[6], value);
this.hostsBalancing = value;
fieldSetFlags()[6] = true;
return this;
}
/**
* Checks whether the 'hostsBalancing' field has been set
*/
public boolean hasHostsBalancing() {
return fieldSetFlags()[6];
}
/**
* Clears the value of the 'hostsBalancing' field
*/
public org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeConfig.Builder clearHostsBalancing() {
hostsBalancing = null;
fieldSetFlags()[6] = false;
return this;
}
@Override
public FlumeConfig build() {
try {
FlumeConfig record = new FlumeConfig();
record.executorThreadPoolSize = fieldSetFlags()[0] ? this.executorThreadPoolSize : (java.lang.Integer) defaultValue(fields()[0]);
record.callbackThreadPoolSize = fieldSetFlags()[1] ? this.callbackThreadPoolSize : (java.lang.Integer) defaultValue(fields()[1]);
record.clientsThreadPoolSize = fieldSetFlags()[2] ? this.clientsThreadPoolSize : (java.lang.Integer) defaultValue(fields()[2]);
record.includeClientProfile = fieldSetFlags()[3] ? this.includeClientProfile : (java.lang.Boolean) defaultValue(fields()[3]);
record.includeServerProfile = fieldSetFlags()[4] ? this.includeServerProfile : (java.lang.Boolean) defaultValue(fields()[4]);
record.flumeEventFormat = fieldSetFlags()[5] ? this.flumeEventFormat : (org.kaaproject.kaa.server.appenders.flume.config.gen.FlumeEventFormat) defaultValue(fields()[5]);
record.hostsBalancing = fieldSetFlags()[6] ? this.hostsBalancing : (java.lang.Object) defaultValue(fields()[6]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}