pirk-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tellison <...@git.apache.org>
Subject [GitHub] incubator-pirk pull request #107: PIRK-45 Remove dependency on Java serializ...
Date Tue, 11 Oct 2016 15:11:59 GMT
Github user tellison commented on a diff in the pull request:

    https://github.com/apache/incubator-pirk/pull/107#discussion_r82813992
  
    --- Diff: src/main/java/org/apache/pirk/query/wideskies/Query.java ---
    @@ -26,41 +26,51 @@
     import java.util.concurrent.ConcurrentHashMap;
     import java.util.function.Consumer;
     
    +import com.google.gson.annotations.Expose;
     import org.apache.pirk.encryption.ModPowAbstraction;
     import org.apache.pirk.serialization.Storable;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
     /**
      * Class to hold the PIR query vectors
    - *
      */
    +
     public class Query implements Serializable, Storable
     {
    -  private static final long serialVersionUID = 1L;
    +  public static final long querySerialVersionUID = 1L;
    +
    +  // So that we can serialize the version number in gson.
    +  @Expose public final long queryVersion = querySerialVersionUID;
     
       private static final Logger logger = LoggerFactory.getLogger(Query.class);
     
    -  private final QueryInfo queryInfo; // holds all query info
    +  @Expose private final QueryInfo queryInfo; // holds all query info
     
    -  private final SortedMap<Integer,BigInteger> queryElements; // query elements
- ordered on insertion
    +  @Expose private final SortedMap<Integer,BigInteger> queryElements; // query elements
- ordered on insertion
     
       // lookup table for exponentiation of query vectors - based on dataPartitionBitSize
       // element -> <power, element^power mod N^2>
       private Map<BigInteger,Map<Integer,BigInteger>> expTable = new ConcurrentHashMap<>();
     
       // File based lookup table for modular exponentiation
       // element hash -> filename containing it's <power, element^power mod N^2>
modular exponentiations
    -  private Map<Integer,String> expFileBasedLookup = new HashMap<>();
    +  @Expose private Map<Integer,String> expFileBasedLookup = new HashMap<>();
    --- End diff --
    
    Should the hash -> filename map be serialized?
    AFAIK it is only used by the responder to compute the results, so I don't think it needs
serializing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message