aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Khutornenko <ma...@apache.org>
Subject Re: Review Request 47440: RFC for WIP: adding webhook code that can POST events to an endpoint
Date Mon, 23 May 2016 18:00:53 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47440/#review134392
-----------------------------------------------------------




src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 38)
<https://reviews.apache.org/r/47440/#comment199183>

    Would it make sense to move this into WebhookInfo instead?



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 39)
<https://reviews.apache.org/r/47440/#comment199181>

    Can your return this from `initializeConnection()` instead of keeping a global field?



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 42)
<https://reviews.apache.org/r/47440/#comment199178>

    Please, inject `WebhookInfo` and drop `public`.



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 47)
<https://reviews.apache.org/r/47440/#comment199184>

    This can be moved inside try.



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (lines 54 - 55)
<https://reviews.apache.org/r/47440/#comment199185>

    You can inline these. 
    
    Even more compact:
    ```
    webhookInfo.getHeaders().entrySet().forEach(e -> connection.setRequestProperty(e.getKey(),
e.getValue());
    ```



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 58)
<https://reviews.apache.org/r/47440/#comment199187>

    Inline?



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 60)
<https://reviews.apache.org/r/47440/#comment199186>

    +1. Having it called explicitly suggests it's possible to override caching behavior midflight?



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 71)
<https://reviews.apache.org/r/47440/#comment199188>

    Missing comment?



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (line 80)
<https://reviews.apache.org/r/47440/#comment199189>

    This is redundant as it's already done by close().



src/main/java/org/apache/aurora/scheduler/events/Webhook.java (lines 82 - 84)
<https://reviews.apache.org/r/47440/#comment199190>

    Are these InputStream.close() calls necessary? If so, can you have a nested set of auto-closables
instead? E.g.:
    ```
    try(InputStream es = connection.getErrorStream())
    try(Inputstream is = connection.getInputStream())
    try(DataOutputStream wr = ...)
    ...
    ```



src/main/java/org/apache/aurora/scheduler/events/WebhookInfo.java (line 27)
<https://reviews.apache.org/r/47440/#comment199193>

    Please add javadoc


- Maxim Khutornenko


On May 22, 2016, 1:29 p.m., Dmitriy Shirchenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47440/
> -----------------------------------------------------------
> 
> (Updated May 22, 2016, 1:29 p.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Stephan Erb.
> 
> 
> Bugs: AURORA-1683
>     https://issues.apache.org/jira/browse/AURORA-1683
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Looking for some feedback whether I'm on the correct path in adding a webhook. All comments
are welcome!
> 
> 
> Diffs
> -----
> 
>   docs/reference/scheduler-configuration.md f7d676d0ed6bc536f4341dbb9365cf50e8607efb

>   examples/vagrant/upstart/aurora-scheduler.conf 3d9e706de564df5e24cb34265bebc0db1cad11a0

>   src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java 9ebfe230836e88a97bc60092373f72f176a8f6f2

>   src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java 2a4c0665e48d30e0655de00bd7f6f9b49f01eafc

>   src/main/java/org/apache/aurora/scheduler/events/Webhook.java PRE-CREATION 
>   src/main/java/org/apache/aurora/scheduler/events/WebhookInfo.java PRE-CREATION 
>   src/main/java/org/apache/aurora/scheduler/events/WebhookModule.java PRE-CREATION 
>   src/main/resources/org/apache/aurora/scheduler/webhook.json PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/47440/diff/
> 
> 
> Testing
> -------
> 
> Need to fix tests.
> 
> 
> Thanks,
> 
> Dmitriy Shirchenko
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message