DL-204: Bump libthrift to latest version for distributedlog-core
Currently finagle heavily depends on an out-of-dated version - libthrift 5.0. Proxy modules (client, server) depend on this version, however the core library doesn't really depend on libthrift.
This change is to change libthrift to 0.9.* in distributedlog-core and shade it to avoid it conflict with the version used by finagle.
This change is based on #131 . The main change is at gitsha [6e58786](https://github.com/apache/incubator-distributedlog/commit/6e587869f87cdce50ae93ba3d52767719d1ab5a6)
Author: Sijie Guo <sijie@apache.org>
Reviewers: Jia Zhai <None>, Leigh Stewart <lstewart@apache.org>
Closes #132 from sijie/change_thrift_for_core_module
diff --git a/.gitignore b/.gitignore
index 914de41..e895020 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,6 @@
# vagrant
.vagrant
+
+# shade plugins
+*dependency-reduced-pom.xml
diff --git a/distributedlog-benchmark/pom.xml b/distributedlog-benchmark/pom.xml
index 26651ad..bd9889c 100644
--- a/distributedlog-benchmark/pom.xml
+++ b/distributedlog-benchmark/pom.xml
@@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.apache.distributedlog</groupId>
- <artifactId>distributedlog-service</artifactId>
+ <artifactId>distributedlog-proxy-server</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
diff --git a/distributedlog-core/pom.xml b/distributedlog-core/pom.xml
index 9c7afc7..a4f7568 100644
--- a/distributedlog-core/pom.xml
+++ b/distributedlog-core/pom.xml
@@ -87,12 +87,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
- <version>${libthrift.version}</version>
- </dependency>
- <dependency>
- <groupId>com.twitter</groupId>
- <artifactId>scrooge-core_2.11</artifactId>
- <version>${scrooge.version}</version>
+ <version>0.9.3</version>
</dependency>
<dependency>
<groupId>org.apache.bookkeeper</groupId>
@@ -150,23 +145,6 @@
<build>
<plugins>
<plugin>
- <groupId>com.twitter</groupId>
- <artifactId>scrooge-maven-plugin</artifactId>
- <version>${scrooge-maven-plugin.version}</version>
- <configuration>
- <language>java</language>
- </configuration>
- <executions>
- <execution>
- <id>thrift-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
@@ -206,6 +184,37 @@
<excludeFilterFile>${basedir}/src/main/resources/findbugsExclude.xml</excludeFilterFile>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>${maven-shade-plugin.version}</version>
+ <configuration>
+ <!-- put your configurations here -->
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createDependencyReducedPom>true</createDependencyReducedPom>
+ <artifactSet>
+ <includes>
+ <include>org.apache.thrift:libthrift</include>
+ </includes>
+ </artifactSet>
+ <minimizeJar>true</minimizeJar>
+ <relocations>
+ <relocation>
+ <pattern>org.apache.thrift</pattern>
+ <shadedPattern>dl-shade.org.apache.thrift</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<profiles>
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/AccessControlEntry.java b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/AccessControlEntry.java
new file mode 100644
index 0000000..35056d9
--- /dev/null
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/AccessControlEntry.java
@@ -0,0 +1,793 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.distributedlog.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 org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+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 javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-05-27")
+public class AccessControlEntry implements org.apache.thrift.TBase<AccessControlEntry, AccessControlEntry._Fields>, java.io.Serializable, Cloneable, Comparable<AccessControlEntry> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AccessControlEntry");
+
+ private static final org.apache.thrift.protocol.TField DENY_WRITE_FIELD_DESC = new org.apache.thrift.protocol.TField("denyWrite", org.apache.thrift.protocol.TType.BOOL, (short)1);
+ private static final org.apache.thrift.protocol.TField DENY_TRUNCATE_FIELD_DESC = new org.apache.thrift.protocol.TField("denyTruncate", org.apache.thrift.protocol.TType.BOOL, (short)2);
+ private static final org.apache.thrift.protocol.TField DENY_DELETE_FIELD_DESC = new org.apache.thrift.protocol.TField("denyDelete", org.apache.thrift.protocol.TType.BOOL, (short)3);
+ private static final org.apache.thrift.protocol.TField DENY_ACQUIRE_FIELD_DESC = new org.apache.thrift.protocol.TField("denyAcquire", org.apache.thrift.protocol.TType.BOOL, (short)4);
+ private static final org.apache.thrift.protocol.TField DENY_RELEASE_FIELD_DESC = new org.apache.thrift.protocol.TField("denyRelease", org.apache.thrift.protocol.TType.BOOL, (short)5);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new AccessControlEntryStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new AccessControlEntryTupleSchemeFactory());
+ }
+
+ public boolean denyWrite; // optional
+ public boolean denyTruncate; // optional
+ public boolean denyDelete; // optional
+ public boolean denyAcquire; // optional
+ public boolean denyRelease; // optional
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ DENY_WRITE((short)1, "denyWrite"),
+ DENY_TRUNCATE((short)2, "denyTruncate"),
+ DENY_DELETE((short)3, "denyDelete"),
+ DENY_ACQUIRE((short)4, "denyAcquire"),
+ DENY_RELEASE((short)5, "denyRelease");
+
+ 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: // DENY_WRITE
+ return DENY_WRITE;
+ case 2: // DENY_TRUNCATE
+ return DENY_TRUNCATE;
+ case 3: // DENY_DELETE
+ return DENY_DELETE;
+ case 4: // DENY_ACQUIRE
+ return DENY_ACQUIRE;
+ case 5: // DENY_RELEASE
+ return DENY_RELEASE;
+ 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 __DENYWRITE_ISSET_ID = 0;
+ private static final int __DENYTRUNCATE_ISSET_ID = 1;
+ private static final int __DENYDELETE_ISSET_ID = 2;
+ private static final int __DENYACQUIRE_ISSET_ID = 3;
+ private static final int __DENYRELEASE_ISSET_ID = 4;
+ private byte __isset_bitfield = 0;
+ private static final _Fields optionals[] = {_Fields.DENY_WRITE,_Fields.DENY_TRUNCATE,_Fields.DENY_DELETE,_Fields.DENY_ACQUIRE,_Fields.DENY_RELEASE};
+ 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.DENY_WRITE, new org.apache.thrift.meta_data.FieldMetaData("denyWrite", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.DENY_TRUNCATE, new org.apache.thrift.meta_data.FieldMetaData("denyTruncate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.DENY_DELETE, new org.apache.thrift.meta_data.FieldMetaData("denyDelete", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.DENY_ACQUIRE, new org.apache.thrift.meta_data.FieldMetaData("denyAcquire", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.DENY_RELEASE, new org.apache.thrift.meta_data.FieldMetaData("denyRelease", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AccessControlEntry.class, metaDataMap);
+ }
+
+ public AccessControlEntry() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public AccessControlEntry(AccessControlEntry other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.denyWrite = other.denyWrite;
+ this.denyTruncate = other.denyTruncate;
+ this.denyDelete = other.denyDelete;
+ this.denyAcquire = other.denyAcquire;
+ this.denyRelease = other.denyRelease;
+ }
+
+ public AccessControlEntry deepCopy() {
+ return new AccessControlEntry(this);
+ }
+
+ @Override
+ public void clear() {
+ setDenyWriteIsSet(false);
+ this.denyWrite = false;
+ setDenyTruncateIsSet(false);
+ this.denyTruncate = false;
+ setDenyDeleteIsSet(false);
+ this.denyDelete = false;
+ setDenyAcquireIsSet(false);
+ this.denyAcquire = false;
+ setDenyReleaseIsSet(false);
+ this.denyRelease = false;
+ }
+
+ public boolean isDenyWrite() {
+ return this.denyWrite;
+ }
+
+ public AccessControlEntry setDenyWrite(boolean denyWrite) {
+ this.denyWrite = denyWrite;
+ setDenyWriteIsSet(true);
+ return this;
+ }
+
+ public void unsetDenyWrite() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DENYWRITE_ISSET_ID);
+ }
+
+ /** Returns true if field denyWrite is set (has been assigned a value) and false otherwise */
+ public boolean isSetDenyWrite() {
+ return EncodingUtils.testBit(__isset_bitfield, __DENYWRITE_ISSET_ID);
+ }
+
+ public void setDenyWriteIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DENYWRITE_ISSET_ID, value);
+ }
+
+ public boolean isDenyTruncate() {
+ return this.denyTruncate;
+ }
+
+ public AccessControlEntry setDenyTruncate(boolean denyTruncate) {
+ this.denyTruncate = denyTruncate;
+ setDenyTruncateIsSet(true);
+ return this;
+ }
+
+ public void unsetDenyTruncate() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DENYTRUNCATE_ISSET_ID);
+ }
+
+ /** Returns true if field denyTruncate is set (has been assigned a value) and false otherwise */
+ public boolean isSetDenyTruncate() {
+ return EncodingUtils.testBit(__isset_bitfield, __DENYTRUNCATE_ISSET_ID);
+ }
+
+ public void setDenyTruncateIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DENYTRUNCATE_ISSET_ID, value);
+ }
+
+ public boolean isDenyDelete() {
+ return this.denyDelete;
+ }
+
+ public AccessControlEntry setDenyDelete(boolean denyDelete) {
+ this.denyDelete = denyDelete;
+ setDenyDeleteIsSet(true);
+ return this;
+ }
+
+ public void unsetDenyDelete() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DENYDELETE_ISSET_ID);
+ }
+
+ /** Returns true if field denyDelete is set (has been assigned a value) and false otherwise */
+ public boolean isSetDenyDelete() {
+ return EncodingUtils.testBit(__isset_bitfield, __DENYDELETE_ISSET_ID);
+ }
+
+ public void setDenyDeleteIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DENYDELETE_ISSET_ID, value);
+ }
+
+ public boolean isDenyAcquire() {
+ return this.denyAcquire;
+ }
+
+ public AccessControlEntry setDenyAcquire(boolean denyAcquire) {
+ this.denyAcquire = denyAcquire;
+ setDenyAcquireIsSet(true);
+ return this;
+ }
+
+ public void unsetDenyAcquire() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DENYACQUIRE_ISSET_ID);
+ }
+
+ /** Returns true if field denyAcquire is set (has been assigned a value) and false otherwise */
+ public boolean isSetDenyAcquire() {
+ return EncodingUtils.testBit(__isset_bitfield, __DENYACQUIRE_ISSET_ID);
+ }
+
+ public void setDenyAcquireIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DENYACQUIRE_ISSET_ID, value);
+ }
+
+ public boolean isDenyRelease() {
+ return this.denyRelease;
+ }
+
+ public AccessControlEntry setDenyRelease(boolean denyRelease) {
+ this.denyRelease = denyRelease;
+ setDenyReleaseIsSet(true);
+ return this;
+ }
+
+ public void unsetDenyRelease() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DENYRELEASE_ISSET_ID);
+ }
+
+ /** Returns true if field denyRelease is set (has been assigned a value) and false otherwise */
+ public boolean isSetDenyRelease() {
+ return EncodingUtils.testBit(__isset_bitfield, __DENYRELEASE_ISSET_ID);
+ }
+
+ public void setDenyReleaseIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DENYRELEASE_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case DENY_WRITE:
+ if (value == null) {
+ unsetDenyWrite();
+ } else {
+ setDenyWrite((Boolean)value);
+ }
+ break;
+
+ case DENY_TRUNCATE:
+ if (value == null) {
+ unsetDenyTruncate();
+ } else {
+ setDenyTruncate((Boolean)value);
+ }
+ break;
+
+ case DENY_DELETE:
+ if (value == null) {
+ unsetDenyDelete();
+ } else {
+ setDenyDelete((Boolean)value);
+ }
+ break;
+
+ case DENY_ACQUIRE:
+ if (value == null) {
+ unsetDenyAcquire();
+ } else {
+ setDenyAcquire((Boolean)value);
+ }
+ break;
+
+ case DENY_RELEASE:
+ if (value == null) {
+ unsetDenyRelease();
+ } else {
+ setDenyRelease((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case DENY_WRITE:
+ return isDenyWrite();
+
+ case DENY_TRUNCATE:
+ return isDenyTruncate();
+
+ case DENY_DELETE:
+ return isDenyDelete();
+
+ case DENY_ACQUIRE:
+ return isDenyAcquire();
+
+ case DENY_RELEASE:
+ return isDenyRelease();
+
+ }
+ 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 DENY_WRITE:
+ return isSetDenyWrite();
+ case DENY_TRUNCATE:
+ return isSetDenyTruncate();
+ case DENY_DELETE:
+ return isSetDenyDelete();
+ case DENY_ACQUIRE:
+ return isSetDenyAcquire();
+ case DENY_RELEASE:
+ return isSetDenyRelease();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof AccessControlEntry)
+ return this.equals((AccessControlEntry)that);
+ return false;
+ }
+
+ public boolean equals(AccessControlEntry that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_denyWrite = true && this.isSetDenyWrite();
+ boolean that_present_denyWrite = true && that.isSetDenyWrite();
+ if (this_present_denyWrite || that_present_denyWrite) {
+ if (!(this_present_denyWrite && that_present_denyWrite))
+ return false;
+ if (this.denyWrite != that.denyWrite)
+ return false;
+ }
+
+ boolean this_present_denyTruncate = true && this.isSetDenyTruncate();
+ boolean that_present_denyTruncate = true && that.isSetDenyTruncate();
+ if (this_present_denyTruncate || that_present_denyTruncate) {
+ if (!(this_present_denyTruncate && that_present_denyTruncate))
+ return false;
+ if (this.denyTruncate != that.denyTruncate)
+ return false;
+ }
+
+ boolean this_present_denyDelete = true && this.isSetDenyDelete();
+ boolean that_present_denyDelete = true && that.isSetDenyDelete();
+ if (this_present_denyDelete || that_present_denyDelete) {
+ if (!(this_present_denyDelete && that_present_denyDelete))
+ return false;
+ if (this.denyDelete != that.denyDelete)
+ return false;
+ }
+
+ boolean this_present_denyAcquire = true && this.isSetDenyAcquire();
+ boolean that_present_denyAcquire = true && that.isSetDenyAcquire();
+ if (this_present_denyAcquire || that_present_denyAcquire) {
+ if (!(this_present_denyAcquire && that_present_denyAcquire))
+ return false;
+ if (this.denyAcquire != that.denyAcquire)
+ return false;
+ }
+
+ boolean this_present_denyRelease = true && this.isSetDenyRelease();
+ boolean that_present_denyRelease = true && that.isSetDenyRelease();
+ if (this_present_denyRelease || that_present_denyRelease) {
+ if (!(this_present_denyRelease && that_present_denyRelease))
+ return false;
+ if (this.denyRelease != that.denyRelease)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_denyWrite = true && (isSetDenyWrite());
+ list.add(present_denyWrite);
+ if (present_denyWrite)
+ list.add(denyWrite);
+
+ boolean present_denyTruncate = true && (isSetDenyTruncate());
+ list.add(present_denyTruncate);
+ if (present_denyTruncate)
+ list.add(denyTruncate);
+
+ boolean present_denyDelete = true && (isSetDenyDelete());
+ list.add(present_denyDelete);
+ if (present_denyDelete)
+ list.add(denyDelete);
+
+ boolean present_denyAcquire = true && (isSetDenyAcquire());
+ list.add(present_denyAcquire);
+ if (present_denyAcquire)
+ list.add(denyAcquire);
+
+ boolean present_denyRelease = true && (isSetDenyRelease());
+ list.add(present_denyRelease);
+ if (present_denyRelease)
+ list.add(denyRelease);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(AccessControlEntry other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetDenyWrite()).compareTo(other.isSetDenyWrite());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDenyWrite()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.denyWrite, other.denyWrite);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDenyTruncate()).compareTo(other.isSetDenyTruncate());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDenyTruncate()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.denyTruncate, other.denyTruncate);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDenyDelete()).compareTo(other.isSetDenyDelete());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDenyDelete()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.denyDelete, other.denyDelete);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDenyAcquire()).compareTo(other.isSetDenyAcquire());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDenyAcquire()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.denyAcquire, other.denyAcquire);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDenyRelease()).compareTo(other.isSetDenyRelease());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDenyRelease()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.denyRelease, other.denyRelease);
+ 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("AccessControlEntry(");
+ boolean first = true;
+
+ if (isSetDenyWrite()) {
+ sb.append("denyWrite:");
+ sb.append(this.denyWrite);
+ first = false;
+ }
+ if (isSetDenyTruncate()) {
+ if (!first) sb.append(", ");
+ sb.append("denyTruncate:");
+ sb.append(this.denyTruncate);
+ first = false;
+ }
+ if (isSetDenyDelete()) {
+ if (!first) sb.append(", ");
+ sb.append("denyDelete:");
+ sb.append(this.denyDelete);
+ first = false;
+ }
+ if (isSetDenyAcquire()) {
+ if (!first) sb.append(", ");
+ sb.append("denyAcquire:");
+ sb.append(this.denyAcquire);
+ first = false;
+ }
+ if (isSetDenyRelease()) {
+ if (!first) sb.append(", ");
+ sb.append("denyRelease:");
+ sb.append(this.denyRelease);
+ 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 AccessControlEntryStandardSchemeFactory implements SchemeFactory {
+ public AccessControlEntryStandardScheme getScheme() {
+ return new AccessControlEntryStandardScheme();
+ }
+ }
+
+ private static class AccessControlEntryStandardScheme extends StandardScheme<AccessControlEntry> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, AccessControlEntry 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: // DENY_WRITE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.denyWrite = iprot.readBool();
+ struct.setDenyWriteIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // DENY_TRUNCATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.denyTruncate = iprot.readBool();
+ struct.setDenyTruncateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // DENY_DELETE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.denyDelete = iprot.readBool();
+ struct.setDenyDeleteIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // DENY_ACQUIRE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.denyAcquire = iprot.readBool();
+ struct.setDenyAcquireIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // DENY_RELEASE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.denyRelease = iprot.readBool();
+ struct.setDenyReleaseIsSet(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, AccessControlEntry struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.isSetDenyWrite()) {
+ oprot.writeFieldBegin(DENY_WRITE_FIELD_DESC);
+ oprot.writeBool(struct.denyWrite);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetDenyTruncate()) {
+ oprot.writeFieldBegin(DENY_TRUNCATE_FIELD_DESC);
+ oprot.writeBool(struct.denyTruncate);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetDenyDelete()) {
+ oprot.writeFieldBegin(DENY_DELETE_FIELD_DESC);
+ oprot.writeBool(struct.denyDelete);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetDenyAcquire()) {
+ oprot.writeFieldBegin(DENY_ACQUIRE_FIELD_DESC);
+ oprot.writeBool(struct.denyAcquire);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetDenyRelease()) {
+ oprot.writeFieldBegin(DENY_RELEASE_FIELD_DESC);
+ oprot.writeBool(struct.denyRelease);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class AccessControlEntryTupleSchemeFactory implements SchemeFactory {
+ public AccessControlEntryTupleScheme getScheme() {
+ return new AccessControlEntryTupleScheme();
+ }
+ }
+
+ private static class AccessControlEntryTupleScheme extends TupleScheme<AccessControlEntry> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, AccessControlEntry struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetDenyWrite()) {
+ optionals.set(0);
+ }
+ if (struct.isSetDenyTruncate()) {
+ optionals.set(1);
+ }
+ if (struct.isSetDenyDelete()) {
+ optionals.set(2);
+ }
+ if (struct.isSetDenyAcquire()) {
+ optionals.set(3);
+ }
+ if (struct.isSetDenyRelease()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
+ if (struct.isSetDenyWrite()) {
+ oprot.writeBool(struct.denyWrite);
+ }
+ if (struct.isSetDenyTruncate()) {
+ oprot.writeBool(struct.denyTruncate);
+ }
+ if (struct.isSetDenyDelete()) {
+ oprot.writeBool(struct.denyDelete);
+ }
+ if (struct.isSetDenyAcquire()) {
+ oprot.writeBool(struct.denyAcquire);
+ }
+ if (struct.isSetDenyRelease()) {
+ oprot.writeBool(struct.denyRelease);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, AccessControlEntry struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(5);
+ if (incoming.get(0)) {
+ struct.denyWrite = iprot.readBool();
+ struct.setDenyWriteIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.denyTruncate = iprot.readBool();
+ struct.setDenyTruncateIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.denyDelete = iprot.readBool();
+ struct.setDenyDeleteIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.denyAcquire = iprot.readBool();
+ struct.setDenyAcquireIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.denyRelease = iprot.readBool();
+ struct.setDenyReleaseIsSet(true);
+ }
+ }
+ }
+
+}
+
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/BKDLConfigFormat.java b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/BKDLConfigFormat.java
new file mode 100644
index 0000000..6fb0dd6
--- /dev/null
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/BKDLConfigFormat.java
@@ -0,0 +1,1335 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.distributedlog.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 org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+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 javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-05-27")
+public class BKDLConfigFormat implements org.apache.thrift.TBase<BKDLConfigFormat, BKDLConfigFormat._Fields>, java.io.Serializable, Cloneable, Comparable<BKDLConfigFormat> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BKDLConfigFormat");
+
+ private static final org.apache.thrift.protocol.TField BK_ZK_SERVERS_FIELD_DESC = new org.apache.thrift.protocol.TField("bkZkServers", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField BK_LEDGERS_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("bkLedgersPath", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField SANITY_CHECK_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sanityCheckTxnID", org.apache.thrift.protocol.TType.BOOL, (short)3);
+ private static final org.apache.thrift.protocol.TField ENCODE_REGION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("encodeRegionID", org.apache.thrift.protocol.TType.BOOL, (short)4);
+ private static final org.apache.thrift.protocol.TField BK_ZK_SERVERS_FOR_READER_FIELD_DESC = new org.apache.thrift.protocol.TField("bkZkServersForReader", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField DL_ZK_SERVERS_FOR_WRITER_FIELD_DESC = new org.apache.thrift.protocol.TField("dlZkServersForWriter", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField DL_ZK_SERVERS_FOR_READER_FIELD_DESC = new org.apache.thrift.protocol.TField("dlZkServersForReader", org.apache.thrift.protocol.TType.STRING, (short)7);
+ private static final org.apache.thrift.protocol.TField ACL_ROOT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("aclRootPath", org.apache.thrift.protocol.TType.STRING, (short)8);
+ private static final org.apache.thrift.protocol.TField FIRST_LOG_SEGMENT_SEQ_NO_FIELD_DESC = new org.apache.thrift.protocol.TField("firstLogSegmentSeqNo", org.apache.thrift.protocol.TType.I64, (short)9);
+ private static final org.apache.thrift.protocol.TField FEDERATED_NAMESPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("federatedNamespace", org.apache.thrift.protocol.TType.BOOL, (short)10);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new BKDLConfigFormatStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new BKDLConfigFormatTupleSchemeFactory());
+ }
+
+ public String bkZkServers; // optional
+ public String bkLedgersPath; // optional
+ public boolean sanityCheckTxnID; // optional
+ public boolean encodeRegionID; // optional
+ public String bkZkServersForReader; // optional
+ public String dlZkServersForWriter; // optional
+ public String dlZkServersForReader; // optional
+ public String aclRootPath; // optional
+ public long firstLogSegmentSeqNo; // optional
+ public boolean federatedNamespace; // optional
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ BK_ZK_SERVERS((short)1, "bkZkServers"),
+ BK_LEDGERS_PATH((short)2, "bkLedgersPath"),
+ SANITY_CHECK_TXN_ID((short)3, "sanityCheckTxnID"),
+ ENCODE_REGION_ID((short)4, "encodeRegionID"),
+ BK_ZK_SERVERS_FOR_READER((short)5, "bkZkServersForReader"),
+ DL_ZK_SERVERS_FOR_WRITER((short)6, "dlZkServersForWriter"),
+ DL_ZK_SERVERS_FOR_READER((short)7, "dlZkServersForReader"),
+ ACL_ROOT_PATH((short)8, "aclRootPath"),
+ FIRST_LOG_SEGMENT_SEQ_NO((short)9, "firstLogSegmentSeqNo"),
+ FEDERATED_NAMESPACE((short)10, "federatedNamespace");
+
+ 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: // BK_ZK_SERVERS
+ return BK_ZK_SERVERS;
+ case 2: // BK_LEDGERS_PATH
+ return BK_LEDGERS_PATH;
+ case 3: // SANITY_CHECK_TXN_ID
+ return SANITY_CHECK_TXN_ID;
+ case 4: // ENCODE_REGION_ID
+ return ENCODE_REGION_ID;
+ case 5: // BK_ZK_SERVERS_FOR_READER
+ return BK_ZK_SERVERS_FOR_READER;
+ case 6: // DL_ZK_SERVERS_FOR_WRITER
+ return DL_ZK_SERVERS_FOR_WRITER;
+ case 7: // DL_ZK_SERVERS_FOR_READER
+ return DL_ZK_SERVERS_FOR_READER;
+ case 8: // ACL_ROOT_PATH
+ return ACL_ROOT_PATH;
+ case 9: // FIRST_LOG_SEGMENT_SEQ_NO
+ return FIRST_LOG_SEGMENT_SEQ_NO;
+ case 10: // FEDERATED_NAMESPACE
+ return FEDERATED_NAMESPACE;
+ 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 __SANITYCHECKTXNID_ISSET_ID = 0;
+ private static final int __ENCODEREGIONID_ISSET_ID = 1;
+ private static final int __FIRSTLOGSEGMENTSEQNO_ISSET_ID = 2;
+ private static final int __FEDERATEDNAMESPACE_ISSET_ID = 3;
+ private byte __isset_bitfield = 0;
+ private static final _Fields optionals[] = {_Fields.BK_ZK_SERVERS,_Fields.BK_LEDGERS_PATH,_Fields.SANITY_CHECK_TXN_ID,_Fields.ENCODE_REGION_ID,_Fields.BK_ZK_SERVERS_FOR_READER,_Fields.DL_ZK_SERVERS_FOR_WRITER,_Fields.DL_ZK_SERVERS_FOR_READER,_Fields.ACL_ROOT_PATH,_Fields.FIRST_LOG_SEGMENT_SEQ_NO,_Fields.FEDERATED_NAMESPACE};
+ 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.BK_ZK_SERVERS, new org.apache.thrift.meta_data.FieldMetaData("bkZkServers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.BK_LEDGERS_PATH, new org.apache.thrift.meta_data.FieldMetaData("bkLedgersPath", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.SANITY_CHECK_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("sanityCheckTxnID", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.ENCODE_REGION_ID, new org.apache.thrift.meta_data.FieldMetaData("encodeRegionID", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.BK_ZK_SERVERS_FOR_READER, new org.apache.thrift.meta_data.FieldMetaData("bkZkServersForReader", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.DL_ZK_SERVERS_FOR_WRITER, new org.apache.thrift.meta_data.FieldMetaData("dlZkServersForWriter", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.DL_ZK_SERVERS_FOR_READER, new org.apache.thrift.meta_data.FieldMetaData("dlZkServersForReader", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ACL_ROOT_PATH, new org.apache.thrift.meta_data.FieldMetaData("aclRootPath", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FIRST_LOG_SEGMENT_SEQ_NO, new org.apache.thrift.meta_data.FieldMetaData("firstLogSegmentSeqNo", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.FEDERATED_NAMESPACE, new org.apache.thrift.meta_data.FieldMetaData("federatedNamespace", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BKDLConfigFormat.class, metaDataMap);
+ }
+
+ public BKDLConfigFormat() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public BKDLConfigFormat(BKDLConfigFormat other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetBkZkServers()) {
+ this.bkZkServers = other.bkZkServers;
+ }
+ if (other.isSetBkLedgersPath()) {
+ this.bkLedgersPath = other.bkLedgersPath;
+ }
+ this.sanityCheckTxnID = other.sanityCheckTxnID;
+ this.encodeRegionID = other.encodeRegionID;
+ if (other.isSetBkZkServersForReader()) {
+ this.bkZkServersForReader = other.bkZkServersForReader;
+ }
+ if (other.isSetDlZkServersForWriter()) {
+ this.dlZkServersForWriter = other.dlZkServersForWriter;
+ }
+ if (other.isSetDlZkServersForReader()) {
+ this.dlZkServersForReader = other.dlZkServersForReader;
+ }
+ if (other.isSetAclRootPath()) {
+ this.aclRootPath = other.aclRootPath;
+ }
+ this.firstLogSegmentSeqNo = other.firstLogSegmentSeqNo;
+ this.federatedNamespace = other.federatedNamespace;
+ }
+
+ public BKDLConfigFormat deepCopy() {
+ return new BKDLConfigFormat(this);
+ }
+
+ @Override
+ public void clear() {
+ this.bkZkServers = null;
+ this.bkLedgersPath = null;
+ setSanityCheckTxnIDIsSet(false);
+ this.sanityCheckTxnID = false;
+ setEncodeRegionIDIsSet(false);
+ this.encodeRegionID = false;
+ this.bkZkServersForReader = null;
+ this.dlZkServersForWriter = null;
+ this.dlZkServersForReader = null;
+ this.aclRootPath = null;
+ setFirstLogSegmentSeqNoIsSet(false);
+ this.firstLogSegmentSeqNo = 0;
+ setFederatedNamespaceIsSet(false);
+ this.federatedNamespace = false;
+ }
+
+ public String getBkZkServers() {
+ return this.bkZkServers;
+ }
+
+ public BKDLConfigFormat setBkZkServers(String bkZkServers) {
+ this.bkZkServers = bkZkServers;
+ return this;
+ }
+
+ public void unsetBkZkServers() {
+ this.bkZkServers = null;
+ }
+
+ /** Returns true if field bkZkServers is set (has been assigned a value) and false otherwise */
+ public boolean isSetBkZkServers() {
+ return this.bkZkServers != null;
+ }
+
+ public void setBkZkServersIsSet(boolean value) {
+ if (!value) {
+ this.bkZkServers = null;
+ }
+ }
+
+ public String getBkLedgersPath() {
+ return this.bkLedgersPath;
+ }
+
+ public BKDLConfigFormat setBkLedgersPath(String bkLedgersPath) {
+ this.bkLedgersPath = bkLedgersPath;
+ return this;
+ }
+
+ public void unsetBkLedgersPath() {
+ this.bkLedgersPath = null;
+ }
+
+ /** Returns true if field bkLedgersPath is set (has been assigned a value) and false otherwise */
+ public boolean isSetBkLedgersPath() {
+ return this.bkLedgersPath != null;
+ }
+
+ public void setBkLedgersPathIsSet(boolean value) {
+ if (!value) {
+ this.bkLedgersPath = null;
+ }
+ }
+
+ public boolean isSanityCheckTxnID() {
+ return this.sanityCheckTxnID;
+ }
+
+ public BKDLConfigFormat setSanityCheckTxnID(boolean sanityCheckTxnID) {
+ this.sanityCheckTxnID = sanityCheckTxnID;
+ setSanityCheckTxnIDIsSet(true);
+ return this;
+ }
+
+ public void unsetSanityCheckTxnID() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SANITYCHECKTXNID_ISSET_ID);
+ }
+
+ /** Returns true if field sanityCheckTxnID is set (has been assigned a value) and false otherwise */
+ public boolean isSetSanityCheckTxnID() {
+ return EncodingUtils.testBit(__isset_bitfield, __SANITYCHECKTXNID_ISSET_ID);
+ }
+
+ public void setSanityCheckTxnIDIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SANITYCHECKTXNID_ISSET_ID, value);
+ }
+
+ public boolean isEncodeRegionID() {
+ return this.encodeRegionID;
+ }
+
+ public BKDLConfigFormat setEncodeRegionID(boolean encodeRegionID) {
+ this.encodeRegionID = encodeRegionID;
+ setEncodeRegionIDIsSet(true);
+ return this;
+ }
+
+ public void unsetEncodeRegionID() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENCODEREGIONID_ISSET_ID);
+ }
+
+ /** Returns true if field encodeRegionID is set (has been assigned a value) and false otherwise */
+ public boolean isSetEncodeRegionID() {
+ return EncodingUtils.testBit(__isset_bitfield, __ENCODEREGIONID_ISSET_ID);
+ }
+
+ public void setEncodeRegionIDIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENCODEREGIONID_ISSET_ID, value);
+ }
+
+ public String getBkZkServersForReader() {
+ return this.bkZkServersForReader;
+ }
+
+ public BKDLConfigFormat setBkZkServersForReader(String bkZkServersForReader) {
+ this.bkZkServersForReader = bkZkServersForReader;
+ return this;
+ }
+
+ public void unsetBkZkServersForReader() {
+ this.bkZkServersForReader = null;
+ }
+
+ /** Returns true if field bkZkServersForReader is set (has been assigned a value) and false otherwise */
+ public boolean isSetBkZkServersForReader() {
+ return this.bkZkServersForReader != null;
+ }
+
+ public void setBkZkServersForReaderIsSet(boolean value) {
+ if (!value) {
+ this.bkZkServersForReader = null;
+ }
+ }
+
+ public String getDlZkServersForWriter() {
+ return this.dlZkServersForWriter;
+ }
+
+ public BKDLConfigFormat setDlZkServersForWriter(String dlZkServersForWriter) {
+ this.dlZkServersForWriter = dlZkServersForWriter;
+ return this;
+ }
+
+ public void unsetDlZkServersForWriter() {
+ this.dlZkServersForWriter = null;
+ }
+
+ /** Returns true if field dlZkServersForWriter is set (has been assigned a value) and false otherwise */
+ public boolean isSetDlZkServersForWriter() {
+ return this.dlZkServersForWriter != null;
+ }
+
+ public void setDlZkServersForWriterIsSet(boolean value) {
+ if (!value) {
+ this.dlZkServersForWriter = null;
+ }
+ }
+
+ public String getDlZkServersForReader() {
+ return this.dlZkServersForReader;
+ }
+
+ public BKDLConfigFormat setDlZkServersForReader(String dlZkServersForReader) {
+ this.dlZkServersForReader = dlZkServersForReader;
+ return this;
+ }
+
+ public void unsetDlZkServersForReader() {
+ this.dlZkServersForReader = null;
+ }
+
+ /** Returns true if field dlZkServersForReader is set (has been assigned a value) and false otherwise */
+ public boolean isSetDlZkServersForReader() {
+ return this.dlZkServersForReader != null;
+ }
+
+ public void setDlZkServersForReaderIsSet(boolean value) {
+ if (!value) {
+ this.dlZkServersForReader = null;
+ }
+ }
+
+ public String getAclRootPath() {
+ return this.aclRootPath;
+ }
+
+ public BKDLConfigFormat setAclRootPath(String aclRootPath) {
+ this.aclRootPath = aclRootPath;
+ return this;
+ }
+
+ public void unsetAclRootPath() {
+ this.aclRootPath = null;
+ }
+
+ /** Returns true if field aclRootPath is set (has been assigned a value) and false otherwise */
+ public boolean isSetAclRootPath() {
+ return this.aclRootPath != null;
+ }
+
+ public void setAclRootPathIsSet(boolean value) {
+ if (!value) {
+ this.aclRootPath = null;
+ }
+ }
+
+ public long getFirstLogSegmentSeqNo() {
+ return this.firstLogSegmentSeqNo;
+ }
+
+ public BKDLConfigFormat setFirstLogSegmentSeqNo(long firstLogSegmentSeqNo) {
+ this.firstLogSegmentSeqNo = firstLogSegmentSeqNo;
+ setFirstLogSegmentSeqNoIsSet(true);
+ return this;
+ }
+
+ public void unsetFirstLogSegmentSeqNo() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FIRSTLOGSEGMENTSEQNO_ISSET_ID);
+ }
+
+ /** Returns true if field firstLogSegmentSeqNo is set (has been assigned a value) and false otherwise */
+ public boolean isSetFirstLogSegmentSeqNo() {
+ return EncodingUtils.testBit(__isset_bitfield, __FIRSTLOGSEGMENTSEQNO_ISSET_ID);
+ }
+
+ public void setFirstLogSegmentSeqNoIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FIRSTLOGSEGMENTSEQNO_ISSET_ID, value);
+ }
+
+ public boolean isFederatedNamespace() {
+ return this.federatedNamespace;
+ }
+
+ public BKDLConfigFormat setFederatedNamespace(boolean federatedNamespace) {
+ this.federatedNamespace = federatedNamespace;
+ setFederatedNamespaceIsSet(true);
+ return this;
+ }
+
+ public void unsetFederatedNamespace() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FEDERATEDNAMESPACE_ISSET_ID);
+ }
+
+ /** Returns true if field federatedNamespace is set (has been assigned a value) and false otherwise */
+ public boolean isSetFederatedNamespace() {
+ return EncodingUtils.testBit(__isset_bitfield, __FEDERATEDNAMESPACE_ISSET_ID);
+ }
+
+ public void setFederatedNamespaceIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FEDERATEDNAMESPACE_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case BK_ZK_SERVERS:
+ if (value == null) {
+ unsetBkZkServers();
+ } else {
+ setBkZkServers((String)value);
+ }
+ break;
+
+ case BK_LEDGERS_PATH:
+ if (value == null) {
+ unsetBkLedgersPath();
+ } else {
+ setBkLedgersPath((String)value);
+ }
+ break;
+
+ case SANITY_CHECK_TXN_ID:
+ if (value == null) {
+ unsetSanityCheckTxnID();
+ } else {
+ setSanityCheckTxnID((Boolean)value);
+ }
+ break;
+
+ case ENCODE_REGION_ID:
+ if (value == null) {
+ unsetEncodeRegionID();
+ } else {
+ setEncodeRegionID((Boolean)value);
+ }
+ break;
+
+ case BK_ZK_SERVERS_FOR_READER:
+ if (value == null) {
+ unsetBkZkServersForReader();
+ } else {
+ setBkZkServersForReader((String)value);
+ }
+ break;
+
+ case DL_ZK_SERVERS_FOR_WRITER:
+ if (value == null) {
+ unsetDlZkServersForWriter();
+ } else {
+ setDlZkServersForWriter((String)value);
+ }
+ break;
+
+ case DL_ZK_SERVERS_FOR_READER:
+ if (value == null) {
+ unsetDlZkServersForReader();
+ } else {
+ setDlZkServersForReader((String)value);
+ }
+ break;
+
+ case ACL_ROOT_PATH:
+ if (value == null) {
+ unsetAclRootPath();
+ } else {
+ setAclRootPath((String)value);
+ }
+ break;
+
+ case FIRST_LOG_SEGMENT_SEQ_NO:
+ if (value == null) {
+ unsetFirstLogSegmentSeqNo();
+ } else {
+ setFirstLogSegmentSeqNo((Long)value);
+ }
+ break;
+
+ case FEDERATED_NAMESPACE:
+ if (value == null) {
+ unsetFederatedNamespace();
+ } else {
+ setFederatedNamespace((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case BK_ZK_SERVERS:
+ return getBkZkServers();
+
+ case BK_LEDGERS_PATH:
+ return getBkLedgersPath();
+
+ case SANITY_CHECK_TXN_ID:
+ return isSanityCheckTxnID();
+
+ case ENCODE_REGION_ID:
+ return isEncodeRegionID();
+
+ case BK_ZK_SERVERS_FOR_READER:
+ return getBkZkServersForReader();
+
+ case DL_ZK_SERVERS_FOR_WRITER:
+ return getDlZkServersForWriter();
+
+ case DL_ZK_SERVERS_FOR_READER:
+ return getDlZkServersForReader();
+
+ case ACL_ROOT_PATH:
+ return getAclRootPath();
+
+ case FIRST_LOG_SEGMENT_SEQ_NO:
+ return getFirstLogSegmentSeqNo();
+
+ case FEDERATED_NAMESPACE:
+ return isFederatedNamespace();
+
+ }
+ 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 BK_ZK_SERVERS:
+ return isSetBkZkServers();
+ case BK_LEDGERS_PATH:
+ return isSetBkLedgersPath();
+ case SANITY_CHECK_TXN_ID:
+ return isSetSanityCheckTxnID();
+ case ENCODE_REGION_ID:
+ return isSetEncodeRegionID();
+ case BK_ZK_SERVERS_FOR_READER:
+ return isSetBkZkServersForReader();
+ case DL_ZK_SERVERS_FOR_WRITER:
+ return isSetDlZkServersForWriter();
+ case DL_ZK_SERVERS_FOR_READER:
+ return isSetDlZkServersForReader();
+ case ACL_ROOT_PATH:
+ return isSetAclRootPath();
+ case FIRST_LOG_SEGMENT_SEQ_NO:
+ return isSetFirstLogSegmentSeqNo();
+ case FEDERATED_NAMESPACE:
+ return isSetFederatedNamespace();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof BKDLConfigFormat)
+ return this.equals((BKDLConfigFormat)that);
+ return false;
+ }
+
+ public boolean equals(BKDLConfigFormat that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_bkZkServers = true && this.isSetBkZkServers();
+ boolean that_present_bkZkServers = true && that.isSetBkZkServers();
+ if (this_present_bkZkServers || that_present_bkZkServers) {
+ if (!(this_present_bkZkServers && that_present_bkZkServers))
+ return false;
+ if (!this.bkZkServers.equals(that.bkZkServers))
+ return false;
+ }
+
+ boolean this_present_bkLedgersPath = true && this.isSetBkLedgersPath();
+ boolean that_present_bkLedgersPath = true && that.isSetBkLedgersPath();
+ if (this_present_bkLedgersPath || that_present_bkLedgersPath) {
+ if (!(this_present_bkLedgersPath && that_present_bkLedgersPath))
+ return false;
+ if (!this.bkLedgersPath.equals(that.bkLedgersPath))
+ return false;
+ }
+
+ boolean this_present_sanityCheckTxnID = true && this.isSetSanityCheckTxnID();
+ boolean that_present_sanityCheckTxnID = true && that.isSetSanityCheckTxnID();
+ if (this_present_sanityCheckTxnID || that_present_sanityCheckTxnID) {
+ if (!(this_present_sanityCheckTxnID && that_present_sanityCheckTxnID))
+ return false;
+ if (this.sanityCheckTxnID != that.sanityCheckTxnID)
+ return false;
+ }
+
+ boolean this_present_encodeRegionID = true && this.isSetEncodeRegionID();
+ boolean that_present_encodeRegionID = true && that.isSetEncodeRegionID();
+ if (this_present_encodeRegionID || that_present_encodeRegionID) {
+ if (!(this_present_encodeRegionID && that_present_encodeRegionID))
+ return false;
+ if (this.encodeRegionID != that.encodeRegionID)
+ return false;
+ }
+
+ boolean this_present_bkZkServersForReader = true && this.isSetBkZkServersForReader();
+ boolean that_present_bkZkServersForReader = true && that.isSetBkZkServersForReader();
+ if (this_present_bkZkServersForReader || that_present_bkZkServersForReader) {
+ if (!(this_present_bkZkServersForReader && that_present_bkZkServersForReader))
+ return false;
+ if (!this.bkZkServersForReader.equals(that.bkZkServersForReader))
+ return false;
+ }
+
+ boolean this_present_dlZkServersForWriter = true && this.isSetDlZkServersForWriter();
+ boolean that_present_dlZkServersForWriter = true && that.isSetDlZkServersForWriter();
+ if (this_present_dlZkServersForWriter || that_present_dlZkServersForWriter) {
+ if (!(this_present_dlZkServersForWriter && that_present_dlZkServersForWriter))
+ return false;
+ if (!this.dlZkServersForWriter.equals(that.dlZkServersForWriter))
+ return false;
+ }
+
+ boolean this_present_dlZkServersForReader = true && this.isSetDlZkServersForReader();
+ boolean that_present_dlZkServersForReader = true && that.isSetDlZkServersForReader();
+ if (this_present_dlZkServersForReader || that_present_dlZkServersForReader) {
+ if (!(this_present_dlZkServersForReader && that_present_dlZkServersForReader))
+ return false;
+ if (!this.dlZkServersForReader.equals(that.dlZkServersForReader))
+ return false;
+ }
+
+ boolean this_present_aclRootPath = true && this.isSetAclRootPath();
+ boolean that_present_aclRootPath = true && that.isSetAclRootPath();
+ if (this_present_aclRootPath || that_present_aclRootPath) {
+ if (!(this_present_aclRootPath && that_present_aclRootPath))
+ return false;
+ if (!this.aclRootPath.equals(that.aclRootPath))
+ return false;
+ }
+
+ boolean this_present_firstLogSegmentSeqNo = true && this.isSetFirstLogSegmentSeqNo();
+ boolean that_present_firstLogSegmentSeqNo = true && that.isSetFirstLogSegmentSeqNo();
+ if (this_present_firstLogSegmentSeqNo || that_present_firstLogSegmentSeqNo) {
+ if (!(this_present_firstLogSegmentSeqNo && that_present_firstLogSegmentSeqNo))
+ return false;
+ if (this.firstLogSegmentSeqNo != that.firstLogSegmentSeqNo)
+ return false;
+ }
+
+ boolean this_present_federatedNamespace = true && this.isSetFederatedNamespace();
+ boolean that_present_federatedNamespace = true && that.isSetFederatedNamespace();
+ if (this_present_federatedNamespace || that_present_federatedNamespace) {
+ if (!(this_present_federatedNamespace && that_present_federatedNamespace))
+ return false;
+ if (this.federatedNamespace != that.federatedNamespace)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_bkZkServers = true && (isSetBkZkServers());
+ list.add(present_bkZkServers);
+ if (present_bkZkServers)
+ list.add(bkZkServers);
+
+ boolean present_bkLedgersPath = true && (isSetBkLedgersPath());
+ list.add(present_bkLedgersPath);
+ if (present_bkLedgersPath)
+ list.add(bkLedgersPath);
+
+ boolean present_sanityCheckTxnID = true && (isSetSanityCheckTxnID());
+ list.add(present_sanityCheckTxnID);
+ if (present_sanityCheckTxnID)
+ list.add(sanityCheckTxnID);
+
+ boolean present_encodeRegionID = true && (isSetEncodeRegionID());
+ list.add(present_encodeRegionID);
+ if (present_encodeRegionID)
+ list.add(encodeRegionID);
+
+ boolean present_bkZkServersForReader = true && (isSetBkZkServersForReader());
+ list.add(present_bkZkServersForReader);
+ if (present_bkZkServersForReader)
+ list.add(bkZkServersForReader);
+
+ boolean present_dlZkServersForWriter = true && (isSetDlZkServersForWriter());
+ list.add(present_dlZkServersForWriter);
+ if (present_dlZkServersForWriter)
+ list.add(dlZkServersForWriter);
+
+ boolean present_dlZkServersForReader = true && (isSetDlZkServersForReader());
+ list.add(present_dlZkServersForReader);
+ if (present_dlZkServersForReader)
+ list.add(dlZkServersForReader);
+
+ boolean present_aclRootPath = true && (isSetAclRootPath());
+ list.add(present_aclRootPath);
+ if (present_aclRootPath)
+ list.add(aclRootPath);
+
+ boolean present_firstLogSegmentSeqNo = true && (isSetFirstLogSegmentSeqNo());
+ list.add(present_firstLogSegmentSeqNo);
+ if (present_firstLogSegmentSeqNo)
+ list.add(firstLogSegmentSeqNo);
+
+ boolean present_federatedNamespace = true && (isSetFederatedNamespace());
+ list.add(present_federatedNamespace);
+ if (present_federatedNamespace)
+ list.add(federatedNamespace);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(BKDLConfigFormat other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetBkZkServers()).compareTo(other.isSetBkZkServers());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetBkZkServers()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bkZkServers, other.bkZkServers);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetBkLedgersPath()).compareTo(other.isSetBkLedgersPath());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetBkLedgersPath()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bkLedgersPath, other.bkLedgersPath);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetSanityCheckTxnID()).compareTo(other.isSetSanityCheckTxnID());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSanityCheckTxnID()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sanityCheckTxnID, other.sanityCheckTxnID);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetEncodeRegionID()).compareTo(other.isSetEncodeRegionID());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEncodeRegionID()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encodeRegionID, other.encodeRegionID);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetBkZkServersForReader()).compareTo(other.isSetBkZkServersForReader());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetBkZkServersForReader()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bkZkServersForReader, other.bkZkServersForReader);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDlZkServersForWriter()).compareTo(other.isSetDlZkServersForWriter());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDlZkServersForWriter()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dlZkServersForWriter, other.dlZkServersForWriter);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetDlZkServersForReader()).compareTo(other.isSetDlZkServersForReader());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDlZkServersForReader()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dlZkServersForReader, other.dlZkServersForReader);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAclRootPath()).compareTo(other.isSetAclRootPath());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAclRootPath()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aclRootPath, other.aclRootPath);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFirstLogSegmentSeqNo()).compareTo(other.isSetFirstLogSegmentSeqNo());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFirstLogSegmentSeqNo()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstLogSegmentSeqNo, other.firstLogSegmentSeqNo);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFederatedNamespace()).compareTo(other.isSetFederatedNamespace());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFederatedNamespace()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.federatedNamespace, other.federatedNamespace);
+ 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("BKDLConfigFormat(");
+ boolean first = true;
+
+ if (isSetBkZkServers()) {
+ sb.append("bkZkServers:");
+ if (this.bkZkServers == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.bkZkServers);
+ }
+ first = false;
+ }
+ if (isSetBkLedgersPath()) {
+ if (!first) sb.append(", ");
+ sb.append("bkLedgersPath:");
+ if (this.bkLedgersPath == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.bkLedgersPath);
+ }
+ first = false;
+ }
+ if (isSetSanityCheckTxnID()) {
+ if (!first) sb.append(", ");
+ sb.append("sanityCheckTxnID:");
+ sb.append(this.sanityCheckTxnID);
+ first = false;
+ }
+ if (isSetEncodeRegionID()) {
+ if (!first) sb.append(", ");
+ sb.append("encodeRegionID:");
+ sb.append(this.encodeRegionID);
+ first = false;
+ }
+ if (isSetBkZkServersForReader()) {
+ if (!first) sb.append(", ");
+ sb.append("bkZkServersForReader:");
+ if (this.bkZkServersForReader == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.bkZkServersForReader);
+ }
+ first = false;
+ }
+ if (isSetDlZkServersForWriter()) {
+ if (!first) sb.append(", ");
+ sb.append("dlZkServersForWriter:");
+ if (this.dlZkServersForWriter == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.dlZkServersForWriter);
+ }
+ first = false;
+ }
+ if (isSetDlZkServersForReader()) {
+ if (!first) sb.append(", ");
+ sb.append("dlZkServersForReader:");
+ if (this.dlZkServersForReader == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.dlZkServersForReader);
+ }
+ first = false;
+ }
+ if (isSetAclRootPath()) {
+ if (!first) sb.append(", ");
+ sb.append("aclRootPath:");
+ if (this.aclRootPath == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.aclRootPath);
+ }
+ first = false;
+ }
+ if (isSetFirstLogSegmentSeqNo()) {
+ if (!first) sb.append(", ");
+ sb.append("firstLogSegmentSeqNo:");
+ sb.append(this.firstLogSegmentSeqNo);
+ first = false;
+ }
+ if (isSetFederatedNamespace()) {
+ if (!first) sb.append(", ");
+ sb.append("federatedNamespace:");
+ sb.append(this.federatedNamespace);
+ 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 BKDLConfigFormatStandardSchemeFactory implements SchemeFactory {
+ public BKDLConfigFormatStandardScheme getScheme() {
+ return new BKDLConfigFormatStandardScheme();
+ }
+ }
+
+ private static class BKDLConfigFormatStandardScheme extends StandardScheme<BKDLConfigFormat> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, BKDLConfigFormat 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: // BK_ZK_SERVERS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.bkZkServers = iprot.readString();
+ struct.setBkZkServersIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // BK_LEDGERS_PATH
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.bkLedgersPath = iprot.readString();
+ struct.setBkLedgersPathIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // SANITY_CHECK_TXN_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.sanityCheckTxnID = iprot.readBool();
+ struct.setSanityCheckTxnIDIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ENCODE_REGION_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.encodeRegionID = iprot.readBool();
+ struct.setEncodeRegionIDIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // BK_ZK_SERVERS_FOR_READER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.bkZkServersForReader = iprot.readString();
+ struct.setBkZkServersForReaderIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // DL_ZK_SERVERS_FOR_WRITER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.dlZkServersForWriter = iprot.readString();
+ struct.setDlZkServersForWriterIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // DL_ZK_SERVERS_FOR_READER
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.dlZkServersForReader = iprot.readString();
+ struct.setDlZkServersForReaderIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 8: // ACL_ROOT_PATH
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.aclRootPath = iprot.readString();
+ struct.setAclRootPathIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 9: // FIRST_LOG_SEGMENT_SEQ_NO
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.firstLogSegmentSeqNo = iprot.readI64();
+ struct.setFirstLogSegmentSeqNoIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 10: // FEDERATED_NAMESPACE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.federatedNamespace = iprot.readBool();
+ struct.setFederatedNamespaceIsSet(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, BKDLConfigFormat struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.bkZkServers != null) {
+ if (struct.isSetBkZkServers()) {
+ oprot.writeFieldBegin(BK_ZK_SERVERS_FIELD_DESC);
+ oprot.writeString(struct.bkZkServers);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.bkLedgersPath != null) {
+ if (struct.isSetBkLedgersPath()) {
+ oprot.writeFieldBegin(BK_LEDGERS_PATH_FIELD_DESC);
+ oprot.writeString(struct.bkLedgersPath);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetSanityCheckTxnID()) {
+ oprot.writeFieldBegin(SANITY_CHECK_TXN_ID_FIELD_DESC);
+ oprot.writeBool(struct.sanityCheckTxnID);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetEncodeRegionID()) {
+ oprot.writeFieldBegin(ENCODE_REGION_ID_FIELD_DESC);
+ oprot.writeBool(struct.encodeRegionID);
+ oprot.writeFieldEnd();
+ }
+ if (struct.bkZkServersForReader != null) {
+ if (struct.isSetBkZkServersForReader()) {
+ oprot.writeFieldBegin(BK_ZK_SERVERS_FOR_READER_FIELD_DESC);
+ oprot.writeString(struct.bkZkServersForReader);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.dlZkServersForWriter != null) {
+ if (struct.isSetDlZkServersForWriter()) {
+ oprot.writeFieldBegin(DL_ZK_SERVERS_FOR_WRITER_FIELD_DESC);
+ oprot.writeString(struct.dlZkServersForWriter);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.dlZkServersForReader != null) {
+ if (struct.isSetDlZkServersForReader()) {
+ oprot.writeFieldBegin(DL_ZK_SERVERS_FOR_READER_FIELD_DESC);
+ oprot.writeString(struct.dlZkServersForReader);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.aclRootPath != null) {
+ if (struct.isSetAclRootPath()) {
+ oprot.writeFieldBegin(ACL_ROOT_PATH_FIELD_DESC);
+ oprot.writeString(struct.aclRootPath);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetFirstLogSegmentSeqNo()) {
+ oprot.writeFieldBegin(FIRST_LOG_SEGMENT_SEQ_NO_FIELD_DESC);
+ oprot.writeI64(struct.firstLogSegmentSeqNo);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetFederatedNamespace()) {
+ oprot.writeFieldBegin(FEDERATED_NAMESPACE_FIELD_DESC);
+ oprot.writeBool(struct.federatedNamespace);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class BKDLConfigFormatTupleSchemeFactory implements SchemeFactory {
+ public BKDLConfigFormatTupleScheme getScheme() {
+ return new BKDLConfigFormatTupleScheme();
+ }
+ }
+
+ private static class BKDLConfigFormatTupleScheme extends TupleScheme<BKDLConfigFormat> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, BKDLConfigFormat struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetBkZkServers()) {
+ optionals.set(0);
+ }
+ if (struct.isSetBkLedgersPath()) {
+ optionals.set(1);
+ }
+ if (struct.isSetSanityCheckTxnID()) {
+ optionals.set(2);
+ }
+ if (struct.isSetEncodeRegionID()) {
+ optionals.set(3);
+ }
+ if (struct.isSetBkZkServersForReader()) {
+ optionals.set(4);
+ }
+ if (struct.isSetDlZkServersForWriter()) {
+ optionals.set(5);
+ }
+ if (struct.isSetDlZkServersForReader()) {
+ optionals.set(6);
+ }
+ if (struct.isSetAclRootPath()) {
+ optionals.set(7);
+ }
+ if (struct.isSetFirstLogSegmentSeqNo()) {
+ optionals.set(8);
+ }
+ if (struct.isSetFederatedNamespace()) {
+ optionals.set(9);
+ }
+ oprot.writeBitSet(optionals, 10);
+ if (struct.isSetBkZkServers()) {
+ oprot.writeString(struct.bkZkServers);
+ }
+ if (struct.isSetBkLedgersPath()) {
+ oprot.writeString(struct.bkLedgersPath);
+ }
+ if (struct.isSetSanityCheckTxnID()) {
+ oprot.writeBool(struct.sanityCheckTxnID);
+ }
+ if (struct.isSetEncodeRegionID()) {
+ oprot.writeBool(struct.encodeRegionID);
+ }
+ if (struct.isSetBkZkServersForReader()) {
+ oprot.writeString(struct.bkZkServersForReader);
+ }
+ if (struct.isSetDlZkServersForWriter()) {
+ oprot.writeString(struct.dlZkServersForWriter);
+ }
+ if (struct.isSetDlZkServersForReader()) {
+ oprot.writeString(struct.dlZkServersForReader);
+ }
+ if (struct.isSetAclRootPath()) {
+ oprot.writeString(struct.aclRootPath);
+ }
+ if (struct.isSetFirstLogSegmentSeqNo()) {
+ oprot.writeI64(struct.firstLogSegmentSeqNo);
+ }
+ if (struct.isSetFederatedNamespace()) {
+ oprot.writeBool(struct.federatedNamespace);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, BKDLConfigFormat struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(10);
+ if (incoming.get(0)) {
+ struct.bkZkServers = iprot.readString();
+ struct.setBkZkServersIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.bkLedgersPath = iprot.readString();
+ struct.setBkLedgersPathIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.sanityCheckTxnID = iprot.readBool();
+ struct.setSanityCheckTxnIDIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.encodeRegionID = iprot.readBool();
+ struct.setEncodeRegionIDIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.bkZkServersForReader = iprot.readString();
+ struct.setBkZkServersForReaderIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.dlZkServersForWriter = iprot.readString();
+ struct.setDlZkServersForWriterIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.dlZkServersForReader = iprot.readString();
+ struct.setDlZkServersForReaderIsSet(true);
+ }
+ if (incoming.get(7)) {
+ struct.aclRootPath = iprot.readString();
+ struct.setAclRootPathIsSet(true);
+ }
+ if (incoming.get(8)) {
+ struct.firstLogSegmentSeqNo = iprot.readI64();
+ struct.setFirstLogSegmentSeqNoIsSet(true);
+ }
+ if (incoming.get(9)) {
+ struct.federatedNamespace = iprot.readBool();
+ struct.setFederatedNamespaceIsSet(true);
+ }
+ }
+ }
+
+}
+
diff --git a/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/package-info.java b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/package-info.java
new file mode 100644
index 0000000..efee3ca
--- /dev/null
+++ b/distributedlog-core/src/main/java/org/apache/distributedlog/thrift/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+/**
+ * Generated thrift code.
+ */
+package org.apache.distributedlog.thrift;
\ No newline at end of file
diff --git a/distributedlog-proxy-server/bin/dlog-env.sh b/distributedlog-proxy-server/bin/dlog-env.sh
index 50a1960..b5e62f2 100644
--- a/distributedlog-proxy-server/bin/dlog-env.sh
+++ b/distributedlog-proxy-server/bin/dlog-env.sh
@@ -24,7 +24,7 @@
exit 1
fi
-# add the jars from current dir to the class path (should be distributedlog-service)
+# add the jars from current dir to the class path (should be distributedlog-proxy-server)
for i in ./*.jar; do
CLASSPATH="$i:${CLASSPATH}"
done
diff --git a/distributedlog-tutorials/distributedlog-basic/basic-2.md b/distributedlog-tutorials/distributedlog-basic/basic-2.md
index 0459bbf..b28cb9a 100644
--- a/distributedlog-tutorials/distributedlog-basic/basic-2.md
+++ b/distributedlog-tutorials/distributedlog-basic/basic-2.md
@@ -74,7 +74,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-basic/basic-3.md b/distributedlog-tutorials/distributedlog-basic/basic-3.md
index 56972bf..5ddea90 100644
--- a/distributedlog-tutorials/distributedlog-basic/basic-3.md
+++ b/distributedlog-tutorials/distributedlog-basic/basic-3.md
@@ -107,7 +107,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create multi streams under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-basic/basic-4.md b/distributedlog-tutorials/distributedlog-basic/basic-4.md
index 684bdeb..e30d628 100644
--- a/distributedlog-tutorials/distributedlog-basic/basic-4.md
+++ b/distributedlog-tutorials/distributedlog-basic/basic-4.md
@@ -92,7 +92,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-basic/basic-5.md b/distributedlog-tutorials/distributedlog-basic/basic-5.md
index 684f228..ba984ee 100644
--- a/distributedlog-tutorials/distributedlog-basic/basic-5.md
+++ b/distributedlog-tutorials/distributedlog-basic/basic-5.md
@@ -90,7 +90,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-basic/basic-6.md b/distributedlog-tutorials/distributedlog-basic/basic-6.md
index 3edd596..b06998f 100644
--- a/distributedlog-tutorials/distributedlog-basic/basic-6.md
+++ b/distributedlog-tutorials/distributedlog-basic/basic-6.md
@@ -88,7 +88,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-messaging/messaging-1.md b/distributedlog-tutorials/distributedlog-messaging/messaging-1.md
index d2c2d7f..4f72d25 100644
--- a/distributedlog-tutorials/distributedlog-messaging/messaging-1.md
+++ b/distributedlog-tutorials/distributedlog-messaging/messaging-1.md
@@ -44,7 +44,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/distributedlog-tutorials/distributedlog-messaging/messaging-2.md b/distributedlog-tutorials/distributedlog-messaging/messaging-2.md
index 5622888..7c3e79a 100644
--- a/distributedlog-tutorials/distributedlog-messaging/messaging-2.md
+++ b/distributedlog-tutorials/distributedlog-messaging/messaging-2.md
@@ -76,7 +76,7 @@
2. Start the write proxy, listening on port 8000.
```
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
```
3. Create the stream under the distributedlog uri.
diff --git a/docs/admin_guide/bookkeeper.rst b/docs/admin_guide/bookkeeper.rst
index c60fbf1..8155c14 100644
--- a/docs/admin_guide/bookkeeper.rst
+++ b/docs/admin_guide/bookkeeper.rst
@@ -55,10 +55,10 @@
$ cd bookkeeper
$ mvn clean package assembly:single -DskipTests
-However, since `bookkeeper-server` is one of the dependency of `distributedlog-service`.
-You could simply run bookkeeper using same set of scripts provided in `distributedlog-service`.
+However, since `bookkeeper-server` is one of the dependency of `distributedlog-proxy-server`.
+You could simply run bookkeeper using same set of scripts provided in `distributedlog-proxy-server`.
In the following sections, we will describe how to run bookkeeper using the scripts provided in
-`distributedlog-service`.
+`distributedlog-proxy-server`.
Run from distributedlog source
------------------------------
@@ -76,7 +76,7 @@
Configuration
+++++++++++++
-The configuration file `bookie.conf` under `distributedlog-service/conf` is a template of production
+The configuration file `bookie.conf` under `distributedlog-proxy-server/conf` is a template of production
configuration to run a bookie node. Most of the configuration settings are good for production usage.
You might need to configure following settings according to your environment and hardware platform.
@@ -191,21 +191,21 @@
Run
+++
-As `bookkeeper-server` is shipped as part of `distributedlog-service`, you could use the `dlog-daemon.sh`
+As `bookkeeper-server` is shipped as part of `distributedlog-proxy-server`, you could use the `dlog-daemon.sh`
script to start `bookie` as daemon thread.
Start the bookie:
.. code-block:: bash
- $ ./distributedlog-service/bin/dlog-daemon.sh start bookie --conf /path/to/bookie/conf
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie --conf /path/to/bookie/conf
Stop the bookie:
.. code-block:: bash
- $ ./distributedlog-service/bin/dlog-daemon.sh stop bookie
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh stop bookie
Please check bookkeeper_ website for more details.
diff --git a/docs/admin_guide/operations.rst b/docs/admin_guide/operations.rst
index e56c596..99826c4 100644
--- a/docs/admin_guide/operations.rst
+++ b/docs/admin_guide/operations.rst
@@ -158,7 +158,7 @@
or command is the full name of a class with a defined main() method.
Environment variables:
- DLOG_LOG_CONF Log4j configuration file (default $HOME/src/distributedlog/distributedlog-service/conf/log4j.properties)
+ DLOG_LOG_CONF Log4j configuration file (default $HOME/src/distributedlog/distributedlog-proxy-server/conf/log4j.properties)
DLOG_EXTRA_OPTS Extra options to be passed to the jvm
DLOG_EXTRA_CLASSPATH Add extra paths to the dlog classpath
diff --git a/docs/admin_guide/zookeeper.rst b/docs/admin_guide/zookeeper.rst
index 0fee9de..8f5d7bf 100644
--- a/docs/admin_guide/zookeeper.rst
+++ b/docs/admin_guide/zookeeper.rst
@@ -32,10 +32,10 @@
Run ZooKeeper from distributedlog source
----------------------------------------
-Since `zookeeper` is one of the dependency of `distributedlog-service`. You could simply
-run `zookeeper` servers using same set of scripts provided in `distributedlog-service`.
+Since `zookeeper` is one of the dependency of `distributedlog-proxy-server`. You could simply
+run `zookeeper` servers using same set of scripts provided in `distributedlog-proxy-server`.
In the following sections, we will describe how to run zookeeper using the scripts provided
-in `distributedlog-service`.
+in `distributedlog-proxy-server`.
Build
+++++
@@ -49,7 +49,7 @@
Configuration
+++++++++++++
-The configuration file `zookeeper.conf.template` under `distributedlog-service/conf` is a template of
+The configuration file `zookeeper.conf.template` under `distributedlog-proxy-server/conf` is a template of
production configuration to run a zookeeper node. Most of the configuration settings are good for
production usage. You might need to configure following settings according to your environment and
hardware platform.
@@ -84,20 +84,20 @@
Run
+++
-As `zookeeper` is shipped as part of `distributedlog-service`, you could use the `dlog-daemon.sh`
+As `zookeeper` is shipped as part of `distributedlog-proxy-server`, you could use the `dlog-daemon.sh`
script to start `zookeeper` as daemon thread.
Start the zookeeper:
.. code-block:: bash
- $ ./distributedlog-service/bin/dlog-daemon.sh start zookeeper /path/to/zookeeper.conf
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh start zookeeper /path/to/zookeeper.conf
Stop the zookeeper:
.. code-block:: bash
- $ ./distributedlog-service/bin/dlog-daemon.sh stop zookeeper
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh stop zookeeper
Please check zookeeper_ website for more details.
diff --git a/docs/deployment/cluster.rst b/docs/deployment/cluster.rst
index b4caf3f..6edff4e 100644
--- a/docs/deployment/cluster.rst
+++ b/docs/deployment/cluster.rst
@@ -35,7 +35,7 @@
Or run `./scripts/snapshot` to build the release packages from current source. The released
-packages contain the binaries for running `distributedlog-service`, `distributedlog-benchmark`
+packages contain the binaries for running `distributedlog-proxy-server`, `distributedlog-benchmark`
and `distributedlog-tutorials`.
NOTE: we run the following instructions from distributedlog source code after
@@ -54,7 +54,7 @@
.. code-block:: bash
- $ cp distributedlog-service/conf/zookeeper.conf.template distributedlog-service/conf/zookeeper.conf
+ $ cp distributedlog-proxy-server/conf/zookeeper.conf.template distributedlog-proxy-server/conf/zookeeper.conf
Configure the settings in `zookeeper.conf`. By default, it will use `/tmp/data/zookeeper` for storing
the zookeeper data. Let's create the data directories for zookeeper.
@@ -73,14 +73,14 @@
.. code-block:: bash
- $ ./distributedlog-service/bin/dlog-daemon.sh start zookeeper ${DL_HOME}/distributedlog-service/conf/zookeeper.conf
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh start zookeeper ${DL_HOME}/distributedlog-proxy-server/conf/zookeeper.conf
You could verify the zookeeper setup using `zkshell`.
.. code-block:: bash
- // ./distributedlog-service/bin/dlog zkshell ${zkservers}
- $ ./distributedlog-service/bin/dlog zkshell localhost:2181
+ // ./distributedlog-proxy-server/bin/dlog zkshell ${zkservers}
+ $ ./distributedlog-proxy-server/bin/dlog zkshell localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
@@ -109,9 +109,9 @@
.. code-block:: bash
- $ cp distributedlog-service/conf/bookie.conf.template distributedlog-service/conf/bookie-1.conf
- $ cp distributedlog-service/conf/bookie.conf.template distributedlog-service/conf/bookie-2.conf
- $ cp distributedlog-service/conf/bookie.conf.template distributedlog-service/conf/bookie-3.conf
+ $ cp distributedlog-proxy-server/conf/bookie.conf.template distributedlog-proxy-server/conf/bookie-1.conf
+ $ cp distributedlog-proxy-server/conf/bookie.conf.template distributedlog-proxy-server/conf/bookie-2.conf
+ $ cp distributedlog-proxy-server/conf/bookie.conf.template distributedlog-proxy-server/conf/bookie-3.conf
Configure the settings in the bookie configuraiont files.
@@ -141,7 +141,7 @@
::
- $ ./distributedlog-service/bin/dlog zkshell localhost:2181
+ $ ./distributedlog-proxy-server/bin/dlog zkshell localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
@@ -162,7 +162,7 @@
::
- $ BOOKIE_CONF=${DL_HOME}/distributedlog-service/conf/bookie-1.conf ./distributedlog-service/bin/dlog bkshell metaformat
+ $ BOOKIE_CONF=${DL_HOME}/distributedlog-proxy-server/conf/bookie-1.conf ./distributedlog-proxy-server/bin/dlog bkshell metaformat
Are you sure to format bookkeeper metadata ? (Y or N) Y
Add Bookies
@@ -259,9 +259,9 @@
::
- BOOKIE_CONF=${DL_HOME}/distributedlog-service/conf/bookie-1.conf ./distributedlog-service/bin/dlog bkshell bookieformat
- BOOKIE_CONF=${DL_HOME}/distributedlog-service/conf/bookie-2.conf ./distributedlog-service/bin/dlog bkshell bookieformat
- BOOKIE_CONF=${DL_HOME}/distributedlog-service/conf/bookie-3.conf ./distributedlog-service/bin/dlog bkshell bookieformat
+ BOOKIE_CONF=${DL_HOME}/distributedlog-proxy-server/conf/bookie-1.conf ./distributedlog-proxy-server/bin/dlog bkshell bookieformat
+ BOOKIE_CONF=${DL_HOME}/distributedlog-proxy-server/conf/bookie-2.conf ./distributedlog-proxy-server/bin/dlog bkshell bookieformat
+ BOOKIE_CONF=${DL_HOME}/distributedlog-proxy-server/conf/bookie-3.conf ./distributedlog-proxy-server/bin/dlog bkshell bookieformat
Start bookie
@@ -271,16 +271,16 @@
::
- SERVICE_PORT=3181 ./distributedlog-service/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-service/conf/bookie-1.conf
- SERVICE_PORT=3182 ./distributedlog-service/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-service/conf/bookie-2.conf
- SERVICE_PORT=3183 ./distributedlog-service/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-service/conf/bookie-3.conf
+ SERVICE_PORT=3181 ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-proxy-server/conf/bookie-1.conf
+ SERVICE_PORT=3182 ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-proxy-server/conf/bookie-2.conf
+ SERVICE_PORT=3183 ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-proxy-server/conf/bookie-3.conf
Verify whether the bookie is setup correctly. You could simply check whether the bookie is showed up in
zookeeper `zkLedgersRootPath`/available znode.
::
- $ ./distributedlog-service/bin/dlog zkshell localhost:2181
+ $ ./distributedlog-proxy-server/bin/dlog zkshell localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
@@ -310,9 +310,9 @@
::
- $ ./distributedlog-service/bin/dlog-daemon.sh stop bookie
+ $ ./distributedlog-proxy-server/bin/dlog-daemon.sh stop bookie
// Example:
- $ SERVICE_PORT=3181 ./distributedlog-service/bin/dlog-daemon.sh stop bookie
+ $ SERVICE_PORT=3181 ./distributedlog-proxy-server/bin/dlog-daemon.sh stop bookie
doing stop bookie ...
stopping bookie
Shutdown is in progress... Please wait...
@@ -325,13 +325,13 @@
::
- $ SERVICE_PORT=3181 ./distributedlog-service/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-service/conf/bookie-1.conf --readonly
+ $ SERVICE_PORT=3181 ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie --conf ${DL_HOME}/distributedlog-proxy-server/conf/bookie-1.conf --readonly
Verify if the bookie is running in `readonly` mode.
::
- $ ./distributedlog-service/bin/dlog zkshell localhost:2181
+ $ ./distributedlog-proxy-server/bin/dlog zkshell localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
@@ -379,7 +379,7 @@
::
- $ distributedlog-service/bin/dlog admin bind \\
+ $ distributedlog-proxy-server/bin/dlog admin bind \\
-dlzr 127.0.0.1:2181 \\
-dlzw 127.0.0.1:2181 \\
-s 127.0.0.1:2181 \\
@@ -419,16 +419,16 @@
in configuration files. Any environment related settings are stored and configured via `namespace binding`.
The configuration file should contain non-environment related settings.
-There is a `write_proxy.conf` template file available under `distributedlog-service` module.
+There is a `write_proxy.conf` template file available under `distributedlog-proxy-server` module.
Run write proxy
+++++++++++++++
-A write proxy could be started using `dlog-daemon.sh` script under `distributedlog-service`.
+A write proxy could be started using `dlog-daemon.sh` script under `distributedlog-proxy-server`.
::
- WP_SHARD_ID=${WP_SHARD_ID} WP_SERVICE_PORT=${WP_SERVICE_PORT} WP_STATS_PORT=${WP_STATS_PORT} ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
+ WP_SHARD_ID=${WP_SHARD_ID} WP_SERVICE_PORT=${WP_SERVICE_PORT} WP_STATS_PORT=${WP_STATS_PORT} ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
- `WP_SHARD_ID`: A non-negative integer. You don't need to guarantee uniqueness of shard id, as it is just an
indicator to the client for routing the requests. If you are running the `write proxy` using a cluster scheduler
@@ -436,7 +436,7 @@
- `WP_SERVICE_PORT`: The port that write proxy listens on.
- `WP_STATS_PORT`: The port that write proxy exposes stats to a http endpoint.
-Please check `distributedlog-service/conf/dlogenv.sh` for more environment variables on configuring write proxy.
+Please check `distributedlog-proxy-server/conf/dlogenv.sh` for more environment variables on configuring write proxy.
- `WP_CONF_FILE`: The path to the write proxy configuration file.
- `WP_NAMESPACE`: The distributedlog namespace that the write proxy is serving for.
@@ -445,9 +445,9 @@
::
- $ WP_SHARD_ID=1 WP_SERVICE_PORT=4181 WP_STATS_PORT=20001 ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
- $ WP_SHARD_ID=2 WP_SERVICE_PORT=4182 WP_STATS_PORT=20002 ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
- $ WP_SHARD_ID=3 WP_SERVICE_PORT=4183 WP_STATS_PORT=20003 ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
+ $ WP_SHARD_ID=1 WP_SERVICE_PORT=4181 WP_STATS_PORT=20001 ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
+ $ WP_SHARD_ID=2 WP_SERVICE_PORT=4182 WP_STATS_PORT=20002 ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
+ $ WP_SHARD_ID=3 WP_SERVICE_PORT=4183 WP_STATS_PORT=20003 ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
The write proxy will announce itself to the zookeeper path `.write_proxy` under the dl namespace path.
@@ -455,7 +455,7 @@
::
- $ ./distributedlog-service/bin/dlog zkshell localhost:2181
+ $ ./distributedlog-proxy-server/bin/dlog zkshell localhost:2181
Connecting to localhost:2181
Welcome to ZooKeeper!
JLine support is enabled
@@ -480,7 +480,7 @@
::
- WP_SHARD_ID=1 WP_SERVICE_PORT=4181 WP_STATS_PORT=10001 ./distributedlog-service/bin/dlog-daemon.sh stop writeproxy
+ WP_SHARD_ID=1 WP_SERVICE_PORT=4181 WP_STATS_PORT=10001 ./distributedlog-proxy-server/bin/dlog-daemon.sh stop writeproxy
Adding a new write proxy is just adding a new host and starting the write proxy
@@ -501,7 +501,7 @@
::
- $ ./distributedlog-service/bin/dlog tool create -u distributedlog://127.0.0.1:2181/messaging/distributedlog/mynamespace -r stream- -e 0-10
+ $ ./distributedlog-proxy-server/bin/dlog tool create -u distributedlog://127.0.0.1:2181/messaging/distributedlog/mynamespace -r stream- -e 0-10
You are going to create streams : [stream-0, stream-1, stream-2, stream-3, stream-4, stream-5, stream-6, stream-7, stream-8, stream-9, stream-10] (Y or N) Y
diff --git a/docs/start/download.rst b/docs/start/download.rst
index 308f36a..4b39321 100644
--- a/docs/start/download.rst
+++ b/docs/start/download.rst
@@ -76,6 +76,41 @@
<!-- use core library to access DL storage -->
<dependency>
+ <groupId>org.apache.distributedlog</groupId>
+ <artifactId>distributedlog-core_2.11</artifactId>
+ <version>{{ site.DL_VERSION_STABLE }}</version>
+ </dependency>
+ <!-- use thin proxy client to access DL via write proxy -->
+ <dependency>
+ <groupId>org.apache.distributedlog</groupId>
+ <artifactId>distributedlog-proxy-client_2.11</artifactId>
+ <version>{{ site.DL_VERSION_STABLE }}</version>
+ </dependency>
+
+
+Version: 0.4.0 (the package is repackaged from com.twitter to org.apache.distributedlog)
+
+.. code-block:: xml
+
+ <!-- use core library to access DL storage -->
+ <dependency>
+ <groupId>org.apache.distributedlog</groupId>
+ <artifactId>distributedlog-core_2.11</artifactId>
+ <version>{{ site.DL_VERSION_STABLE }}</version>
+ </dependency>
+ <!-- use thin proxy client to access DL via write proxy -->
+ <dependency>
+ <groupId>org.apache.distributedlog</groupId>
+ <artifactId>distributedlog-client_2.11</artifactId>
+ <version>{{ site.DL_VERSION_STABLE }}</version>
+ </dependency>
+
+Version: 0.3.x
+
+.. code-block:: xml
+
+ <!-- use core library to access DL storage -->
+ <dependency>
<groupId>com.twitter</groupId>
<artifactId>distributedlog-core_2.11</artifactId>
<version>{{ site.DL_VERSION_STABLE }}</version>
diff --git a/docs/start/quickstart.rst b/docs/start/quickstart.rst
index 010d323..91d3ba7 100644
--- a/docs/start/quickstart.rst
+++ b/docs/start/quickstart.rst
@@ -35,13 +35,13 @@
DistributedLog uses `ZooKeeper` as the metadata store and `BookKeeper` as the log segment store. So
you need to first start a zookeeper server and a few bookies if you don't already have one. You can
-use the `dlog` script in `distributedlog-service` package to get a standalone bookkeeper sandbox. It
+use the `dlog` script in `distributedlog-proxy-server` package to get a standalone bookkeeper sandbox. It
starts a zookeeper server and `N` bookies (N is 3 by default).
::
// Start the local sandbox instance at port `7000`
- > ./distributedlog-service/bin/dlog local 7000
+ > ./distributedlog-proxy-server/bin/dlog local 7000
DistributedLog Sandbox is running now. You could access distributedlog://127.0.0.1:7000
@@ -54,7 +54,7 @@
::
- > ./distributedlog-service/bin/dlog admin bind -l /ledgers -s 127.0.0.1:7000 -c distributedlog://127.0.0.1:7000/messaging/my_namespace
+ > ./distributedlog-proxy-server/bin/dlog admin bind -l /ledgers -s 127.0.0.1:7000 -c distributedlog://127.0.0.1:7000/messaging/my_namespace
No bookkeeper is bound to distributedlog://127.0.0.1:7000/messaging/my_namespace
Created binding on distributedlog://127.0.0.1:7000/messaging/my_namespace.
@@ -69,14 +69,14 @@
::
- > ./distributedlog-service/bin/dlog tool create -u distributedlog://127.0.0.1:7000/messaging/my_namespace -r messaging-stream- -e 1-5
+ > ./distributedlog-proxy-server/bin/dlog tool create -u distributedlog://127.0.0.1:7000/messaging/my_namespace -r messaging-stream- -e 1-5
We can now see the streams if we run the `list` command from the tool.
::
- > ./distributedlog-service/bin/dlog tool list -u distributedlog://127.0.0.1:7000/messaging/my_namespace
+ > ./distributedlog-proxy-server/bin/dlog tool list -u distributedlog://127.0.0.1:7000/messaging/my_namespace
Streams under distributedlog://127.0.0.1:7000/messaging/my_namespace :
--------------------------------
messaging-stream-1
@@ -94,13 +94,13 @@
::
- > ./distributedlog-service/bin/dlog-daemon.sh start writeproxy -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/my_namespace -mx -c `pwd`/distributedlog-service/conf/distributedlog_proxy.conf
+ > ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/my_namespace -mx -c `pwd`/distributedlog-proxy-server/conf/distributedlog_proxy.conf
From 0.3.51-RC1 and onwards, use the below command to start the write proxy
::
- > WP_SHARD_ID=1 WP_SERVICE_PORT=8000 WP_STATS_PORT=8001 WP_NAMESPACE='distributedlog://127.0.0.1:7000/messaging/my_namespace' ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
+ > WP_SHARD_ID=1 WP_SERVICE_PORT=8000 WP_STATS_PORT=8001 WP_NAMESPACE='distributedlog://127.0.0.1:7000/messaging/my_namespace' ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
Step 6: Tail reading records
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/tutorials/basic-2.rst b/docs/tutorials/basic-2.rst
index ef4c7b6..ae9af4f 100644
--- a/docs/tutorials/basic-2.rst
+++ b/docs/tutorials/basic-2.rst
@@ -125,7 +125,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/docs/tutorials/basic-3.rst b/docs/tutorials/basic-3.rst
index 55de7b0..5f0aa08 100644
--- a/docs/tutorials/basic-3.rst
+++ b/docs/tutorials/basic-3.rst
@@ -172,7 +172,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create multiple streams
diff --git a/docs/tutorials/basic-4.rst b/docs/tutorials/basic-4.rst
index bcbacd1..7bc63b0 100644
--- a/docs/tutorials/basic-4.rst
+++ b/docs/tutorials/basic-4.rst
@@ -150,7 +150,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/docs/tutorials/basic-5.rst b/docs/tutorials/basic-5.rst
index 94220e8..dfa6d33 100644
--- a/docs/tutorials/basic-5.rst
+++ b/docs/tutorials/basic-5.rst
@@ -149,7 +149,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/docs/tutorials/basic-6.rst b/docs/tutorials/basic-6.rst
index 4993fe4..91185d2 100644
--- a/docs/tutorials/basic-6.rst
+++ b/docs/tutorials/basic-6.rst
@@ -139,7 +139,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/docs/tutorials/messaging-1.rst b/docs/tutorials/messaging-1.rst
index 5536811..7c89916 100644
--- a/docs/tutorials/messaging-1.rst
+++ b/docs/tutorials/messaging-1.rst
@@ -73,7 +73,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/docs/tutorials/messaging-2.rst b/docs/tutorials/messaging-2.rst
index dc1cf5d..36ccdb5 100644
--- a/docs/tutorials/messaging-2.rst
+++ b/docs/tutorials/messaging-2.rst
@@ -112,7 +112,7 @@
::
// DistributedLogServerApp -p ${service-port} --shard-id ${shard-id} -sp ${stats-port} -u {distributedlog-uri} -mx -c ${conf-file}
- ./distributedlog-service/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-service/conf/distributedlog_proxy.conf
+ ./distributedlog-proxy-server/bin/dlog org.apache.distributedlog.service.DistributedLogServerApp -p 8000 --shard-id 1 -sp 8001 -u distributedlog://127.0.0.1:7000/messaging/distributedlog -mx -c ${distributedlog-repo}/distributedlog-proxy-server/conf/distributedlog_proxy.conf
Create the stream
diff --git a/pom.xml b/pom.xml
index dafda4a..a24577c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -125,6 +125,7 @@
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-jar-plugin.version>2.2</maven-jar-plugin.version>
<maven-javadoc-plugin.version>2.8</maven-javadoc-plugin.version>
+ <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<scrooge-maven-plugin.version>3.17.0</scrooge-maven-plugin.version>
diff --git a/scripts/dev/repackage.sh b/scripts/dev/repackage.sh
index cb55399..d2bbb2e 100755
--- a/scripts/dev/repackage.sh
+++ b/scripts/dev/repackage.sh
@@ -17,7 +17,7 @@
# limitations under the License.
#
-for module in distributedlog-benchmark distributedlog-client distributedlog-core distributedlog-protocol distributedlog-service distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-kafka distributedlog-tutorials/distributedlog-messaging distributedlog-tutorials/distributedlog-mapreduce; do
+for module in distributedlog-benchmark distributedlog-proxy-client distributedlog-core distributedlog-protocol distributedlog-proxy-server distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-kafka distributedlog-tutorials/distributedlog-messaging distributedlog-tutorials/distributedlog-mapreduce; do
echo "Repackaging module ${module}"
if [[ -d "${module}/src/main/java/com/twitter/distributedlog" ]]; then
mkdir -p ${module}/src/main/java/org/apache/distributedlog
diff --git a/scripts/integration/smoketest.sh b/scripts/integration/smoketest.sh
index 586f21e..cece4fd 100755
--- a/scripts/integration/smoketest.sh
+++ b/scripts/integration/smoketest.sh
@@ -41,7 +41,7 @@
# start the sandbox
echo "start sandbox"
-nohup ${DLOG_ROOT}/distributedlog-service/bin/dlog local ${ZK_PORT} > ${LOG_DIR}/sandbox.out 2>&1&
+nohup ${DLOG_ROOT}/distributedlog-proxy-server/bin/dlog local ${ZK_PORT} > ${LOG_DIR}/sandbox.out 2>&1&
if [ $? -ne 0 ]; then
echo "Failed to start sandbox"
@@ -60,7 +60,7 @@
# create streams
echo "create streams"
-${DLOG_ROOT}/distributedlog-service/bin/dlog tool create -u distributedlog://127.0.0.1:${ZK_PORT}/messaging/${NAMESPACE} -r ${SMOKESTREAM_PREFIX} -e 1-5 -f
+${DLOG_ROOT}/distributedlog-proxy-server/bin/dlog tool create -u distributedlog://127.0.0.1:${ZK_PORT}/messaging/${NAMESPACE} -r ${SMOKESTREAM_PREFIX} -e 1-5 -f
if [ $? -ne 0 ]; then
echo "Failed to create streams prefixed with '${SMOKESTREAM_PREFIX}'."
@@ -69,7 +69,7 @@
# list streams
echo "list streams"
-STREAM_OUTPUT=$(${DLOG_ROOT}/distributedlog-service/bin/dlog tool list -u distributedlog://127.0.0.1:${ZK_PORT}/messaging/${NAMESPACE} | grep "${SMOKESTREAM_PREFIX}")
+STREAM_OUTPUT=$(${DLOG_ROOT}/distributedlog-proxy-server/bin/dlog tool list -u distributedlog://127.0.0.1:${ZK_PORT}/messaging/${NAMESPACE} | grep "${SMOKESTREAM_PREFIX}")
echo "Create streams : ${STREAM_OUTPUT}."
@@ -82,7 +82,7 @@
# start a write proxy
echo "start a write proxy"
-${DLOG_ROOT}/distributedlog-service/bin/dlog-daemon.sh start writeproxy
+${DLOG_ROOT}/distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
# tail the streams
echo "tail the streams"
@@ -132,7 +132,7 @@
# stop the write proxy
echo "stop the write proxy"
-${DLOG_ROOT}/distributedlog-service/bin/dlog-daemon.sh stop writeproxy
+${DLOG_ROOT}/distributedlog-proxy-server/bin/dlog-daemon.sh stop writeproxy
# stop the sandbox
echo "stop the sandbox"
diff --git a/scripts/snapshot b/scripts/snapshot
index 54e88d4..bd61ca3 100755
--- a/scripts/snapshot
+++ b/scripts/snapshot
@@ -29,18 +29,18 @@
rm -rf dist/*
# create the layout
-for module in distributedlog-service distributedlog-benchmark distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-messaging; do
+for module in distributedlog-proxy-server distributedlog-benchmark distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-messaging; do
mkdir -p "dist/release/${module}"/{bin,conf,lib}
done
# build the package
mvn clean install -Ptwitter-ostrich-provider -DskipTests
-# build the distributedlog-service
-cp -rf distributedlog-service/bin/* dist/release/distributedlog-service/bin
-cp -rf distributedlog-service/conf/* dist/release/distributedlog-service/conf
-cp -rf distributedlog-service/lib/* dist/release/distributedlog-service/lib
-cp -rf distributedlog-service/target/distributedlog-service-*.jar dist/release/distributedlog-service/lib
+# build the distributedlog-proxy-server
+cp -rf distributedlog-proxy-server/bin/* dist/release/distributedlog-proxy-server/bin
+cp -rf distributedlog-proxy-server/conf/* dist/release/distributedlog-proxy-server/conf
+cp -rf distributedlog-proxy-server/lib/* dist/release/distributedlog-proxy-server/lib
+cp -rf distributedlog-proxy-server/target/distributedlog-proxy-server-*.jar dist/release/distributedlog-proxy-server/lib
cp -rf vagrant dist/release/
cp -rf scripts dist/release/
@@ -64,7 +64,7 @@
# release
cd dist/release
-zip -r "distributedlog-all-${GITSHA}.zip" distributedlog-service distributedlog-benchmark distributedlog-tutorials > /dev/null
-zip -r "distributedlog-service-${GITSHA}.zip" distributedlog-service >/dev/null
+zip -r "distributedlog-all-${GITSHA}.zip" distributedlog-proxy-server distributedlog-benchmark distributedlog-tutorials > /dev/null
+zip -r "distributedlog-proxy-server-${GITSHA}.zip" distributedlog-proxy-server >/dev/null
zip -r "distributedlog-benchmark-${GITSHA}.zip" distributedlog-benchmark >/dev/null
zip -r "distributedlog-tutorials-${GITSHA}.zip" distributedlog-tutorials >/dev/null
diff --git a/vagrant/bk.sh b/vagrant/bk.sh
index 1eb5ab1..671fe09 100755
--- a/vagrant/bk.sh
+++ b/vagrant/bk.sh
@@ -44,34 +44,34 @@
#Stop the running bookie
echo "Killing bookkeeper server"
-./distributedlog-service/bin/dlog-daemon.sh stop bookie
+./distributedlog-proxy-server/bin/dlog-daemon.sh stop bookie
-cp ./distributedlog-service/conf/bookie.conf.template ./distributedlog-service/conf/bookie-$BROKER_ID.conf
+cp ./distributedlog-proxy-server/conf/bookie.conf.template ./distributedlog-proxy-server/conf/bookie-$BROKER_ID.conf
sed \
-e 's/zkServers=localhost:2181/'zkServers=$PUBLIC_ZOOKEEPER_ADDRESSES'/' \
- ./distributedlog-service/conf/bookie.conf.template > ./distributedlog-service/conf/bookie-$BROKER_ID.conf
+ ./distributedlog-proxy-server/conf/bookie.conf.template > ./distributedlog-proxy-server/conf/bookie-$BROKER_ID.conf
sleep 5
if [ $DEPLOY_BK == true ]; then
if [ $BROKER_ID -eq "1" ]; then
- echo "create /messaging" | ./distributedlog-service/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
- echo "create /messaging/bookkeeper" | ./distributedlog-service/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
- echo "create /messaging/bookkeeper/ledgers" | ./distributedlog-service/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
+ echo "create /messaging" | ./distributedlog-proxy-server/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
+ echo "create /messaging/bookkeeper" | ./distributedlog-proxy-server/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
+ echo "create /messaging/bookkeeper/ledgers" | ./distributedlog-proxy-server/bin/dlog zkshell $PUBLIC_ZOOKEEPER_ADDRESSES
echo "Metaformatting bookie"
- export BOOKIE_CONF=$log_dir/distributedlog-service/conf/bookie-$BROKER_ID.conf
- ./distributedlog-service/bin/dlog bkshell metaformat -n -f
+ export BOOKIE_CONF=$log_dir/distributedlog-proxy-server/conf/bookie-$BROKER_ID.conf
+ ./distributedlog-proxy-server/bin/dlog bkshell metaformat -n -f
fi
echo "Configuring bookkeeper"
- BOOKIE_CONF=$log_dir/distributedlog-service/conf/bookie-$BROKER_ID.conf ./distributedlog-service/bin/dlog bkshell bookieformat
+ BOOKIE_CONF=$log_dir/distributedlog-proxy-server/conf/bookie-$BROKER_ID.conf ./distributedlog-proxy-server/bin/dlog bkshell bookieformat
echo "Starting server"
- SERVICE_PORT=3181 ./distributedlog-service/bin/dlog-daemon.sh start bookie -c $log_dir/distributedlog-service/conf/bookie-$BROKER_ID.conf
+ SERVICE_PORT=3181 ./distributedlog-proxy-server/bin/dlog-daemon.sh start bookie -c $log_dir/distributedlog-proxy-server/conf/bookie-$BROKER_ID.conf
if [ $BROKER_ID -eq "1" ]; then
- ./distributedlog-service/bin/dlog admin bind \
+ ./distributedlog-proxy-server/bin/dlog admin bind \
-dlzr $PUBLIC_ZOOKEEPER_ADDRESSES \
-dlzw $PUBLIC_ZOOKEEPER_ADDRESSES \
-s $PUBLIC_ZOOKEEPER_ADDRESSES \
@@ -88,5 +88,5 @@
WP_SHARD_ID=$BROKER_ID \
WP_SERVICE_PORT=4181 \
WP_STATS_PORT=20001 \
- ./distributedlog-service/bin/dlog-daemon.sh start writeproxy
+ ./distributedlog-proxy-server/bin/dlog-daemon.sh start writeproxy
fi
diff --git a/vagrant/zk.sh b/vagrant/zk.sh
index c690149..8e110d9 100755
--- a/vagrant/zk.sh
+++ b/vagrant/zk.sh
@@ -25,23 +25,23 @@
log_dir=/opt/distributedlog-trunk/dist/release
cd $log_dir
-cp $log_dir/distributedlog-service/conf/zookeeper.conf.template $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
-echo "initLimit=5" >> $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
-echo "syncLimit=2" >> $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
-echo "quorumListenOnAllIPs=true" >> $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
+cp $log_dir/distributedlog-proxy-server/conf/zookeeper.conf.template $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties
+echo "initLimit=5" >> $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties
+echo "syncLimit=2" >> $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties
+echo "quorumListenOnAllIPs=true" >> $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties
sed '/server.1/d' \
- ./distributedlog-service/conf/bookie.conf.template > ./distributedlog-service/conf/zookeeper-$ZKID.conf
+ ./distributedlog-proxy-server/conf/bookie.conf.template > ./distributedlog-proxy-server/conf/zookeeper-$ZKID.conf
for i in $(seq 1 $NUM_ZK); do
- echo "server.${i}=zk${i}:2888:3888" >>$log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
+ echo "server.${i}=zk${i}:2888:3888" >>$log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties
done
mkdir -p /tmp/data/zookeeper
echo "$ZKID" > /tmp/data/zookeeper/myid
echo "Killing ZooKeeper"
-./distributedlog-service/bin/dlog-daemon.sh stop zookeeper || true
+./distributedlog-proxy-server/bin/dlog-daemon.sh stop zookeeper || true
sleep 5
echo "Starting ZooKeeper"
-echo "./distributedlog-service/bin/dlog-daemon.sh start zookeeper $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties"
-./distributedlog-service/bin/dlog-daemon.sh start zookeeper $log_dir/distributedlog-service/conf/zookeeper-$ZKID.properties
+echo "./distributedlog-proxy-server/bin/dlog-daemon.sh start zookeeper $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties"
+./distributedlog-proxy-server/bin/dlog-daemon.sh start zookeeper $log_dir/distributedlog-proxy-server/conf/zookeeper-$ZKID.properties