From e18a37ac197916933304dff89d43561f71135af8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 1 Sep 2015 16:18:31 +0200 Subject: Make machineDescription binary in TransferInformation --- .../bwlp/thrift/iface/TransferInformation.java | 35 ++++++++++++++-------- .../org/openslx/filetransfer/util/ChunkList.java | 13 +++++++- src/main/thrift/bwlp.thrift | 2 +- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java index 9381d0c..19a1d8c 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java @@ -51,7 +51,7 @@ public class TransferInformation implements org.apache.thrift.TBase blockHashes; // optional - public String machineDescription; // optional + public ByteBuffer machineDescription; // 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 { @@ -141,7 +141,7 @@ public class TransferInformation implements org.apache.thrift.TBase( missingChunks ); + allChunks = Collections.unmodifiableList( new ArrayList<>( missingChunks ) ); } /** @@ -234,4 +235,14 @@ public class ChunkList return sb.toString(); } + public synchronized boolean isEmpty() + { + return allChunks.isEmpty(); + } + + public List getAll() + { + return allChunks; + } + } diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index 7189842..91e904d 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -314,7 +314,7 @@ struct TransferInformation { 2: i32 plainPort, 3: i32 sslPort, 4: optional list blockHashes, // Only if transfer is a download (and list is known) - 5: optional string machineDescription, // Only if transfer is a download + 5: optional binary machineDescription, // Only if transfer is a download } // Used to tell status of an upload. The blockStatus is one byte per 16MB block, -- cgit v1.2.3-55-g7522