You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by ma...@apache.org on 2018/12/06 01:19:42 UTC
git commit: updated refs/heads/trunk to bb8dab5
Repository: giraph
Updated Branches:
refs/heads/trunk f5dacbbeb -> bb8dab546
GIRAPH-1215
closes #97
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/bb8dab54
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/bb8dab54
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/bb8dab54
Branch: refs/heads/trunk
Commit: bb8dab546215a602108d29d8026111cf099b7609
Parents: f5dacbb
Author: Maja Kabiljo <ma...@fb.com>
Authored: Wed Dec 5 09:54:55 2018 -0800
Committer: Maja Kabiljo <ma...@fb.com>
Committed: Wed Dec 5 17:18:20 2018 -0800
----------------------------------------------------------------------
.../apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java | 3 ++-
.../org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java | 3 ++-
.../apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java | 3 ++-
giraph-core/templates/FixedCapacityType2TypeMinHeap.java | 3 ++-
11 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java
index d3dd1e0..a71472a 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntByteMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityIntByteMinHeap
* @param value Value
*/
public void add(int key, byte value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java
index aef4509..85debf8 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntDoubleMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityIntDoubleMinHeap
* @param value Value
*/
public void add(int key, double value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java
index a9c2f37..4f88844 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntFloatMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityIntFloatMinHeap
* @param value Value
*/
public void add(int key, float value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java
index 3cb15e1..4f76739 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntIntMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityIntIntMinHeap
* @param value Value
*/
public void add(int key, int value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java
index 3c8c1f6..ae64070 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityIntLongMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityIntLongMinHeap
* @param value Value
*/
public void add(int key, long value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java
index 65fadf4..9859b4d 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongByteMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityLongByteMinHeap
* @param value Value
*/
public void add(long key, byte value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java
index 4350655..f572ac5 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongDoubleMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityLongDoubleMinHeap
* @param value Value
*/
public void add(long key, double value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java
index 1d79015..5fc0d6b 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongFloatMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityLongFloatMinHeap
* @param value Value
*/
public void add(long key, float value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java
index 67b4154..6eb65a2 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongIntMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityLongIntMinHeap
* @param value Value
*/
public void add(long key, int value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java
index b318d17..b94dda5 100644
--- a/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java
+++ b/giraph-core/src/main/java/org/apache/giraph/types/heaps/FixedCapacityLongLongMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacityLongLongMinHeap
* @param value Value
*/
public void add(long key, long value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;
http://git-wip-us.apache.org/repos/asf/giraph/blob/bb8dab54/giraph-core/templates/FixedCapacityType2TypeMinHeap.java
----------------------------------------------------------------------
diff --git a/giraph-core/templates/FixedCapacityType2TypeMinHeap.java b/giraph-core/templates/FixedCapacityType2TypeMinHeap.java
index 5dc37bc..70ad2a2 100644
--- a/giraph-core/templates/FixedCapacityType2TypeMinHeap.java
+++ b/giraph-core/templates/FixedCapacityType2TypeMinHeap.java
@@ -81,7 +81,8 @@ public class FixedCapacity${type1.camel}${type2.camel}MinHeap
* @param value Value
*/
public void add(${type1.lower} key, ${type2.lower} value) {
- if (size == capacity && compare(keys[0], values[0], key, value) >= 0) {
+ if (capacity == 0 ||
+ (size == capacity && compare(keys[0], values[0], key, value) >= 0)) {
// If the heap is full and smallest element in it is not smaller
// than value, do nothing
return;