summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-12-07 16:01:15 +0100
committerSimon Rettberg2018-12-07 16:01:15 +0100
commitf01a417c81a63b809ef788107c391f75c26ff99d (patch)
tree8b4551723fa02ecf36f869547fa37b20743ea478
parentUnify JSON serializer thrift/nonthrift (diff)
downloadmaster-sync-shared-f01a417c81a63b809ef788107c391f75c26ff99d.tar.gz
master-sync-shared-f01a417c81a63b809ef788107c391f75c26ff99d.tar.xz
master-sync-shared-f01a417c81a63b809ef788107c391f75c26ff99d.zip
Update to RPC version 5, break compat
Add some stuff while we're at it..
-rw-r--r--src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java210
-rw-r--r--src/main/java/org/openslx/sat/thrift/version/Feature.java29
-rw-r--r--src/main/java/org/openslx/sat/thrift/version/Version.java4
-rw-r--r--src/main/thrift/bwlp.thrift2
4 files changed, 209 insertions, 36 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java b/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java
index 7095bba..b52289b 100644
--- a/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java
+++ b/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java
@@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-04")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-07")
public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRead, ImageSummaryRead._Fields>, java.io.Serializable, Cloneable, Comparable<ImageSummaryRead> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImageSummaryRead");
@@ -57,6 +57,8 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)17);
private static final org.apache.thrift.protocol.TField DEFAULT_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultPermissions", org.apache.thrift.protocol.TType.STRUCT, (short)18);
private static final org.apache.thrift.protocol.TField USER_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("userPermissions", org.apache.thrift.protocol.TType.STRUCT, (short)19);
+ private static final org.apache.thrift.protocol.TField FILE_SIZE_SUM_FIELD_DESC = new org.apache.thrift.protocol.TField("fileSizeSum", org.apache.thrift.protocol.TType.I64, (short)21);
+ private static final org.apache.thrift.protocol.TField VERSION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("versionCount", org.apache.thrift.protocol.TType.I32, (short)22);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -87,6 +89,8 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
public boolean isTemplate; // required
public ImagePermissions defaultPermissions; // required
public ImagePermissions userPermissions; // optional
+ public long fileSizeSum; // optional
+ public int versionCount; // 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 {
@@ -112,7 +116,9 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
IS_PROCESSED((short)16, "isProcessed"),
IS_TEMPLATE((short)17, "isTemplate"),
DEFAULT_PERMISSIONS((short)18, "defaultPermissions"),
- USER_PERMISSIONS((short)19, "userPermissions");
+ USER_PERMISSIONS((short)19, "userPermissions"),
+ FILE_SIZE_SUM((short)21, "fileSizeSum"),
+ VERSION_COUNT((short)22, "versionCount");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -165,6 +171,10 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
return DEFAULT_PERMISSIONS;
case 19: // USER_PERMISSIONS
return USER_PERMISSIONS;
+ case 21: // FILE_SIZE_SUM
+ return FILE_SIZE_SUM;
+ case 22: // VERSION_COUNT
+ return VERSION_COUNT;
default:
return null;
}
@@ -215,8 +225,10 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
private static final int __ISVALID_ISSET_ID = 7;
private static final int __ISPROCESSED_ISSET_ID = 8;
private static final int __ISTEMPLATE_ISSET_ID = 9;
+ private static final int __FILESIZESUM_ISSET_ID = 10;
+ private static final int __VERSIONCOUNT_ISSET_ID = 11;
private short __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.USER_PERMISSIONS};
+ private static final _Fields optionals[] = {_Fields.USER_PERMISSIONS,_Fields.FILE_SIZE_SUM,_Fields.VERSION_COUNT};
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);
@@ -258,6 +270,10 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImagePermissions.class)));
tmpMap.put(_Fields.USER_PERMISSIONS, new org.apache.thrift.meta_data.FieldMetaData("userPermissions", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImagePermissions.class)));
+ tmpMap.put(_Fields.FILE_SIZE_SUM, new org.apache.thrift.meta_data.FieldMetaData("fileSizeSum", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.VERSION_COUNT, new org.apache.thrift.meta_data.FieldMetaData("versionCount", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ImageSummaryRead.class, metaDataMap);
}
@@ -358,6 +374,8 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
if (other.isSetUserPermissions()) {
this.userPermissions = new ImagePermissions(other.userPermissions);
}
+ this.fileSizeSum = other.fileSizeSum;
+ this.versionCount = other.versionCount;
}
public ImageSummaryRead deepCopy() {
@@ -395,6 +413,10 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
this.isTemplate = false;
this.defaultPermissions = null;
this.userPermissions = null;
+ setFileSizeSumIsSet(false);
+ this.fileSizeSum = 0;
+ setVersionCountIsSet(false);
+ this.versionCount = 0;
}
public String getImageBaseId() {
@@ -851,6 +873,52 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
}
}
+ public long getFileSizeSum() {
+ return this.fileSizeSum;
+ }
+
+ public ImageSummaryRead setFileSizeSum(long fileSizeSum) {
+ this.fileSizeSum = fileSizeSum;
+ setFileSizeSumIsSet(true);
+ return this;
+ }
+
+ public void unsetFileSizeSum() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZESUM_ISSET_ID);
+ }
+
+ /** Returns true if field fileSizeSum is set (has been assigned a value) and false otherwise */
+ public boolean isSetFileSizeSum() {
+ return EncodingUtils.testBit(__isset_bitfield, __FILESIZESUM_ISSET_ID);
+ }
+
+ public void setFileSizeSumIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZESUM_ISSET_ID, value);
+ }
+
+ public int getVersionCount() {
+ return this.versionCount;
+ }
+
+ public ImageSummaryRead setVersionCount(int versionCount) {
+ this.versionCount = versionCount;
+ setVersionCountIsSet(true);
+ return this;
+ }
+
+ public void unsetVersionCount() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSIONCOUNT_ISSET_ID);
+ }
+
+ /** Returns true if field versionCount is set (has been assigned a value) and false otherwise */
+ public boolean isSetVersionCount() {
+ return EncodingUtils.testBit(__isset_bitfield, __VERSIONCOUNT_ISSET_ID);
+ }
+
+ public void setVersionCountIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSIONCOUNT_ISSET_ID, value);
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case IMAGE_BASE_ID:
@@ -1005,6 +1073,22 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
}
break;
+ case FILE_SIZE_SUM:
+ if (value == null) {
+ unsetFileSizeSum();
+ } else {
+ setFileSizeSum((Long)value);
+ }
+ break;
+
+ case VERSION_COUNT:
+ if (value == null) {
+ unsetVersionCount();
+ } else {
+ setVersionCount((Integer)value);
+ }
+ break;
+
}
}
@@ -1067,6 +1151,12 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
case USER_PERMISSIONS:
return getUserPermissions();
+ case FILE_SIZE_SUM:
+ return getFileSizeSum();
+
+ case VERSION_COUNT:
+ return getVersionCount();
+
}
throw new IllegalStateException();
}
@@ -1116,6 +1206,10 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
return isSetDefaultPermissions();
case USER_PERMISSIONS:
return isSetUserPermissions();
+ case FILE_SIZE_SUM:
+ return isSetFileSizeSum();
+ case VERSION_COUNT:
+ return isSetVersionCount();
}
throw new IllegalStateException();
}
@@ -1304,6 +1398,24 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
return false;
}
+ boolean this_present_fileSizeSum = true && this.isSetFileSizeSum();
+ boolean that_present_fileSizeSum = true && that.isSetFileSizeSum();
+ if (this_present_fileSizeSum || that_present_fileSizeSum) {
+ if (!(this_present_fileSizeSum && that_present_fileSizeSum))
+ return false;
+ if (this.fileSizeSum != that.fileSizeSum)
+ return false;
+ }
+
+ boolean this_present_versionCount = true && this.isSetVersionCount();
+ boolean that_present_versionCount = true && that.isSetVersionCount();
+ if (this_present_versionCount || that_present_versionCount) {
+ if (!(this_present_versionCount && that_present_versionCount))
+ return false;
+ if (this.versionCount != that.versionCount)
+ return false;
+ }
+
return true;
}
@@ -1406,6 +1518,16 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
if (present_userPermissions)
list.add(userPermissions);
+ boolean present_fileSizeSum = true && (isSetFileSizeSum());
+ list.add(present_fileSizeSum);
+ if (present_fileSizeSum)
+ list.add(fileSizeSum);
+
+ boolean present_versionCount = true && (isSetVersionCount());
+ list.add(present_versionCount);
+ if (present_versionCount)
+ list.add(versionCount);
+
return list.hashCode();
}
@@ -1607,6 +1729,26 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetFileSizeSum()).compareTo(other.isSetFileSizeSum());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFileSizeSum()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileSizeSum, other.fileSizeSum);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetVersionCount()).compareTo(other.isSetVersionCount());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetVersionCount()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.versionCount, other.versionCount);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -1740,6 +1882,18 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
}
first = false;
}
+ if (isSetFileSizeSum()) {
+ if (!first) sb.append(", ");
+ sb.append("fileSizeSum:");
+ sb.append(this.fileSizeSum);
+ first = false;
+ }
+ if (isSetVersionCount()) {
+ if (!first) sb.append(", ");
+ sb.append("versionCount:");
+ sb.append(this.versionCount);
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -1945,6 +2099,22 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 21: // FILE_SIZE_SUM
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.fileSizeSum = iprot.readI64();
+ struct.setFileSizeSumIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 22: // VERSION_COUNT
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.versionCount = iprot.readI32();
+ struct.setVersionCountIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -2037,6 +2207,16 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
oprot.writeFieldBegin(UPLOAD_TIME_FIELD_DESC);
oprot.writeI64(struct.uploadTime);
oprot.writeFieldEnd();
+ if (struct.isSetFileSizeSum()) {
+ oprot.writeFieldBegin(FILE_SIZE_SUM_FIELD_DESC);
+ oprot.writeI64(struct.fileSizeSum);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetVersionCount()) {
+ oprot.writeFieldBegin(VERSION_COUNT_FIELD_DESC);
+ oprot.writeI32(struct.versionCount);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -2112,7 +2292,13 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
if (struct.isSetUserPermissions()) {
optionals.set(18);
}
- oprot.writeBitSet(optionals, 19);
+ if (struct.isSetFileSizeSum()) {
+ optionals.set(19);
+ }
+ if (struct.isSetVersionCount()) {
+ optionals.set(20);
+ }
+ oprot.writeBitSet(optionals, 21);
if (struct.isSetImageBaseId()) {
oprot.writeString(struct.imageBaseId);
}
@@ -2170,12 +2356,18 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
if (struct.isSetUserPermissions()) {
struct.userPermissions.write(oprot);
}
+ if (struct.isSetFileSizeSum()) {
+ oprot.writeI64(struct.fileSizeSum);
+ }
+ if (struct.isSetVersionCount()) {
+ oprot.writeI32(struct.versionCount);
+ }
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ImageSummaryRead struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(19);
+ BitSet incoming = iprot.readBitSet(21);
if (incoming.get(0)) {
struct.imageBaseId = iprot.readString();
struct.setImageBaseIdIsSet(true);
@@ -2254,6 +2446,14 @@ public class ImageSummaryRead implements org.apache.thrift.TBase<ImageSummaryRea
struct.userPermissions.read(iprot);
struct.setUserPermissionsIsSet(true);
}
+ if (incoming.get(19)) {
+ struct.fileSizeSum = iprot.readI64();
+ struct.setFileSizeSumIsSet(true);
+ }
+ if (incoming.get(20)) {
+ struct.versionCount = iprot.readI32();
+ struct.setVersionCountIsSet(true);
+ }
}
}
diff --git a/src/main/java/org/openslx/sat/thrift/version/Feature.java b/src/main/java/org/openslx/sat/thrift/version/Feature.java
index e06c78a..3c40b3e 100644
--- a/src/main/java/org/openslx/sat/thrift/version/Feature.java
+++ b/src/main/java/org/openslx/sat/thrift/version/Feature.java
@@ -1,34 +1,5 @@
package org.openslx.sat.thrift.version;
public enum Feature {
-
- /**
- * Server can properly extend the expiration time of an image version that
- * is already expired, but has not been deleted yet. (Early versions of dmsd
- * did not handle this case properly.)
- */
- EXTEND_EXPIRED_VM,
-
- /**
- * Server supports configuring network shares for individual lectures. Whether
- * these will function on the clients further depends on the minilinux version!
- */
- NETWORK_SHARES,
-
- /**
- * Server supports multiple hypervisors which requires special handling since
- * multiple components needs to be compatible to fully support them.
- */
- MULTIPLE_HYPERVISORS,
-
- /**
- * Server supports copying existing blocks server side.
- */
- SERVER_SIDE_COPY,
-
- /**
- * Server supports filtering lectures by LDAP/AD attributes
- */
- LECTURE_FILTER_LDAP,
}
diff --git a/src/main/java/org/openslx/sat/thrift/version/Version.java b/src/main/java/org/openslx/sat/thrift/version/Version.java
index 16e00f8..404a01b 100644
--- a/src/main/java/org/openslx/sat/thrift/version/Version.java
+++ b/src/main/java/org/openslx/sat/thrift/version/Version.java
@@ -8,8 +8,8 @@ package org.openslx.sat.thrift.version;
*/
public class Version {
- public static final long MIN_VERSION = 2;
+ public static final long MIN_VERSION = 5;
- public static final long VERSION = 4;
+ public static final long VERSION = 5;
}
diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift
index 0d82503..a9a7301 100644
--- a/src/main/thrift/bwlp.thrift
+++ b/src/main/thrift/bwlp.thrift
@@ -186,6 +186,8 @@ struct ImageSummaryRead {
17: bool isTemplate,
18: ImagePermissions defaultPermissions,
19: optional ImagePermissions userPermissions,
+ 21: optional i64 fileSizeSum,
+ 22: optional i32 versionCount,
}
struct ImageVersionDetails {