Repository: giraph
Updated Branches:
  refs/heads/trunk a6f2a4fc9 -> d11da6779


[GIRAPH-986] Add no-arg constructor to BasicSet

Summary:
https://reviews.facebook.net/D31731 added empty constructors for BasicArrayList,
we need them for BasicSet as well (contract of Writable is two methods and 
no-arg constructor)

Test Plan: mvn clean install

Reviewers: maja.kabiljo, sergey.edunov

Reviewed By: sergey.edunov

Differential Revision: https://reviews.facebook.net/D32091


Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/d11da677
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/d11da677
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/d11da677

Branch: refs/heads/trunk
Commit: d11da67793bd4729bd7db63194b57684e82e89fe
Parents: a6f2a4f
Author: Igor Kabiljo <[email protected]>
Authored: Fri Jan 23 16:29:25 2015 -0800
Committer: Sergey Edunov <[email protected]>
Committed: Fri Jan 23 17:08:04 2015 -0800

----------------------------------------------------------------------
 CHANGELOG                                                 |  2 ++
 .../main/java/org/apache/giraph/types/ops/IntTypeOps.java |  5 +++++
 .../java/org/apache/giraph/types/ops/LongTypeOps.java     |  5 +++++
 .../org/apache/giraph/types/ops/PrimitiveIdTypeOps.java   |  6 ++++++
 .../org/apache/giraph/types/ops/collections/BasicSet.java | 10 ++++++++++
 5 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/d11da677/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 527ac04..cf366f2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 Giraph Change Log
 
 Release 1.2.0 - unreleased
+  GIRAPH-986: Add no-arg constructor to BasicSet (ikabiljo via edunov)
+
   GIRAPH-985: Add more metrics (majakabiljo)
 
   GIRAPH-986: Add more stuff to TypeOps (ikabiljo via majakabiljo)

http://git-wip-us.apache.org/repos/asf/giraph/blob/d11da677/giraph-core/src/main/java/org/apache/giraph/types/ops/IntTypeOps.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/IntTypeOps.java 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/IntTypeOps.java
index 9be0ebd..4ac06da 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/ops/IntTypeOps.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/ops/IntTypeOps.java
@@ -62,6 +62,11 @@ public enum IntTypeOps
   }
 
   @Override
+  public BasicSet<IntWritable> createOpenHashSet() {
+    return new BasicIntOpenHashSet();
+  }
+
+  @Override
   public BasicSet<IntWritable> createOpenHashSet(int capacity) {
     return new BasicIntOpenHashSet(capacity);
   }

http://git-wip-us.apache.org/repos/asf/giraph/blob/d11da677/giraph-core/src/main/java/org/apache/giraph/types/ops/LongTypeOps.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/LongTypeOps.java 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/LongTypeOps.java
index 90f81f8..3e2ab31 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/ops/LongTypeOps.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/ops/LongTypeOps.java
@@ -62,6 +62,11 @@ public enum LongTypeOps
   }
 
   @Override
+  public BasicSet<LongWritable> createOpenHashSet() {
+    return new BasicLongOpenHashSet();
+  }
+
+  @Override
   public BasicSet<LongWritable> createOpenHashSet(int capacity) {
     return new BasicLongOpenHashSet(capacity);
   }

http://git-wip-us.apache.org/repos/asf/giraph/blob/d11da677/giraph-core/src/main/java/org/apache/giraph/types/ops/PrimitiveIdTypeOps.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/PrimitiveIdTypeOps.java 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/PrimitiveIdTypeOps.java
index 29b0c6e..55b2737 100644
--- 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/PrimitiveIdTypeOps.java
+++ 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/PrimitiveIdTypeOps.java
@@ -37,6 +37,12 @@ public interface PrimitiveIdTypeOps<T> extends 
PrimitiveTypeOps<T> {
   // primitive collections
 
   /**
+   * Create BasicSet of type T.
+   * @return BasicSet
+   */
+  BasicSet<T> createOpenHashSet();
+
+  /**
    * Create BasicSet of type T, given capacity.
    * @param capacity Capacity
    * @return BasicSet

http://git-wip-us.apache.org/repos/asf/giraph/blob/d11da677/giraph-core/src/main/java/org/apache/giraph/types/ops/collections/BasicSet.java
----------------------------------------------------------------------
diff --git 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/collections/BasicSet.java
 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/collections/BasicSet.java
index c8cd72e..65a614e 100644
--- 
a/giraph-core/src/main/java/org/apache/giraph/types/ops/collections/BasicSet.java
+++ 
b/giraph-core/src/main/java/org/apache/giraph/types/ops/collections/BasicSet.java
@@ -82,6 +82,11 @@ public interface BasicSet<T> extends Writable {
     /** Set */
     private final IntOpenHashSet set;
 
+    /** Constructor */
+    public BasicIntOpenHashSet() {
+      set = new IntOpenHashSet();
+    }
+
     /**
      * Constructor
      * @param capacity Capacity
@@ -146,6 +151,11 @@ public interface BasicSet<T> extends Writable {
     /** Set */
     private final LongOpenHashSet set;
 
+    /** Constructor */
+    public BasicLongOpenHashSet() {
+      set = new LongOpenHashSet();
+    }
+
     /**
      * Constructor
      * @param capacity Capacity

Reply via email to