[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331598#comment-15331598
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/2084


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331586#comment-15331586
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/2084
  
Merging


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331575#comment-15331575
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on the issue:

https://github.com/apache/flink/pull/2084
  
Thanks for the update @zentol. +1 to merge


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331574#comment-15331574
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67146087
  
--- Diff: flink-core/src/main/java/org/apache/flink/util/Preconditions.java 
---
@@ -234,6 +234,22 @@ public static void checkElementIndex(int index, int 
size) {
}
}
 
+   /**
+* Ensures that the given index is valid for an array, list or string 
of the given size.
+*
+* @param index index to check
+* @param size size of the array, list or string
+*
+* @throws IllegalArgumentException Thrown, if size is negative.
+* @throws IndexOutOfBoundsException Thrown, if the index negative or 
greater than or equal to size
+*/
+   public static void checkElementIndex(int index, int size, @Nullable 
String errorMessage) {
+   checkArgument(size >= 0, "Size was negative.");
+   if (index < 0 || index >= size) {
+   throw new IndexOutOfBoundsException(errorMessage + " 
Index: " + index + ", Size: " + size);
--- End diff --

OK


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331405#comment-15331405
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/2084
  
@fhueske I've addressed your comments.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331391#comment-15331391
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67120005
  
--- Diff: flink-core/src/main/java/org/apache/flink/util/Preconditions.java 
---
@@ -234,6 +234,22 @@ public static void checkElementIndex(int index, int 
size) {
}
}
 
+   /**
+* Ensures that the given index is valid for an array, list or string 
of the given size.
+*
+* @param index index to check
+* @param size size of the array, list or string
+*
+* @throws IllegalArgumentException Thrown, if size is negative.
+* @throws IndexOutOfBoundsException Thrown, if the index negative or 
greater than or equal to size
+*/
+   public static void checkElementIndex(int index, int size, @Nullable 
String errorMessage) {
+   checkArgument(size >= 0, "Size was negative.");
+   if (index < 0 || index >= size) {
+   throw new IndexOutOfBoundsException(errorMessage + " 
Index: " + index + ", Size: " + size);
--- End diff --

other Preconditions methods print also print "null" if no error message was 
given. granted, they use String.valueOf(errorMessage), but it's essentially the 
same.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331388#comment-15331388
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67119824
  
--- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/FlinkYarnCluster.java ---
@@ -250,7 +250,7 @@ public void disconnect() {
 */
@Override
public void stopAfterJob(JobID jobID) {
-   Preconditions.checkNotNull("The job id must not be null", 
jobID);
+   Preconditions.checkNotNull(jobID, "The job id must not be 
null");
--- End diff --

nice catch!


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331389#comment-15331389
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on the issue:

https://github.com/apache/flink/pull/2084
  
Looks good overall. Added just a few minor comments.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331387#comment-15331387
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67119787
  
--- Diff: tools/maven/checkstyle.xml ---
@@ -60,6 +60,17 @@ under the License.



+   
+   
+   
+   
+   
--- End diff --

`Guava` with capital `G`?


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331385#comment-15331385
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67119642
  
--- Diff: flink-core/src/main/java/org/apache/flink/util/Preconditions.java 
---
@@ -234,6 +234,22 @@ public static void checkElementIndex(int index, int 
size) {
}
}
 
+   /**
+* Ensures that the given index is valid for an array, list or string 
of the given size.
+*
+* @param index index to check
+* @param size size of the array, list or string
--- End diff --

`errorMessage` parameter missing


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331384#comment-15331384
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67119231
  
--- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/util/BloomFilter.java
 ---
@@ -18,10 +18,10 @@
 
 package org.apache.flink.runtime.operators.util;
 
-import com.google.common.base.Preconditions;
 import org.apache.flink.core.memory.MemorySegment;
+import org.apache.flink.util.Preconditions;
--- End diff --

This import can be removed if the two `Preconditions.checkArgument` calls 
in the code are converted into `checkArgument` calls


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15331380#comment-15331380
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2084#discussion_r67118763
  
--- Diff: flink-core/src/main/java/org/apache/flink/util/Preconditions.java 
---
@@ -234,6 +234,22 @@ public static void checkElementIndex(int index, int 
size) {
}
}
 
+   /**
+* Ensures that the given index is valid for an array, list or string 
of the given size.
+*
+* @param index index to check
+* @param size size of the array, list or string
+*
+* @throws IllegalArgumentException Thrown, if size is negative.
+* @throws IndexOutOfBoundsException Thrown, if the index negative or 
greater than or equal to size
+*/
+   public static void checkElementIndex(int index, int size, @Nullable 
String errorMessage) {
+   checkArgument(size >= 0, "Size was negative.");
+   if (index < 0 || index >= size) {
+   throw new IndexOutOfBoundsException(errorMessage + " 
Index: " + index + ", Size: " + size);
--- End diff --

shouldn't we check if `errorMessage == null` if it is `@Nullable`?


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15322198#comment-15322198
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user tzulitai commented on the issue:

https://github.com/apache/flink/pull/2084
  
Oops, my mistake again ;) Thanks.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15322184#comment-15322184
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/2084
  
It is still used in FlinkKinesisProducer.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15322158#comment-15322158
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user tzulitai commented on the issue:

https://github.com/apache/flink/pull/2084
  
Ah right, sorry I was mistaken by the guava dependency in pom.xml. The 
dependency can actually be safely removed also though, must have accidentally 
left it there when the connector was cleaned up to use Flink's preconditions.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15322116#comment-15322116
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user zentol commented on the issue:

https://github.com/apache/flink/pull/2084
  
The Kinesis connector already uses Flink's Preconditions class.


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15322100#comment-15322100
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

Github user tzulitai commented on the issue:

https://github.com/apache/flink/pull/2084
  
I think the Kinesis connector is missed out as part of this cleanup. Thanks 
for this!


> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-4032) Replace all usage of Guava Preconditions

2016-06-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/FLINK-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15320716#comment-15320716
 ] 

ASF GitHub Bot commented on FLINK-4032:
---

GitHub user zentol opened a pull request:

https://github.com/apache/flink/pull/2084

[FLINK-4032] Replace all usages Guava preconditions

This PR replaces every usage of the Guava Preconditions in Flink with our 
own Preconditions class.

In addition, 
- the guava dependency was completely removed from the RabbitMQ connector
- a checkstyle rules was added preventing further use of guava preconditions

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zentol/flink guava

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/2084.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2084


commit 7bc5099e0fa7731b5fd8ab7d4a32e29c60468bc6
Author: zentol 
Date:   2016-06-08T14:01:19Z

Remove guava dependency from flink-...-rabbitmq

commit 3f30f1f6bdd98b27ff815fbc56d8c9704e1091a6
Author: zentol 
Date:   2016-06-08T14:01:49Z

Replace Preconditions usage in flink-..-elasticsearch2

commit 8e90a16ef75ed4adcd00261b326aa10f04f5ddac
Author: zentol 
Date:   2016-06-08T14:25:26Z

Replace Preconditions usage in flink-table

commit cf61152d703abec9e2a47ecc102d2b148c172add
Author: zentol 
Date:   2016-06-08T14:25:34Z

Replace Preconditions usage in flink-optimizer

commit b6e90150d3dda1b2cd2822e3031a604798f6dcaf
Author: zentol 
Date:   2016-06-08T14:25:45Z

Replace Preconditions usage in flink-runtime-web

commit 910bf63778ba0a0b1b2ec183c66c524c3dd53ffc
Author: zentol 
Date:   2016-06-08T14:25:54Z

Replace Preconditions usage in flink-scala

commit 9012b1dae48ef9aed50e6e2d9f8bd9c59c8abd80
Author: zentol 
Date:   2016-06-08T14:25:58Z

Replace Preconditions usage in flink-yarn

commit 393da586a8ebcbca60d60b958aa21040ae5197d8
Author: zentol 
Date:   2016-06-08T14:26:02Z

Replace Preconditions usage in flink-tests

commit 90723bf1defcd7baf72285b81c4c5732c8a25624
Author: zentol 
Date:   2016-06-08T14:26:13Z

Replace Preconditions usage in flink-streaming-java

commit 5b27a648d363c1130fbff829c00a298b728d0ae7
Author: zentol 
Date:   2016-06-08T14:26:25Z

Replace Preconditions usage in flink-runtime

commit c5ac8b21591e08ce74865d04baeffc344ad7867c
Author: zentol 
Date:   2016-06-08T14:32:20Z

checkstyle rule




> Replace all usage of Guava Preconditions
> 
>
> Key: FLINK-4032
> URL: https://issues.apache.org/jira/browse/FLINK-4032
> Project: Flink
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: Chesnay Schepler
>Assignee: Chesnay Schepler
>Priority: Trivial
> Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)