This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a588c53
initial checkin
Crim 2fe8172
move sideline generation into own DocTask
Crim 1f7ec14
Add script to generate docs
Crim 5f63b8a
merge master into branch
Crim d161fb6
Fix javadoc errors
Crim bf61c5e
Add hook to site goal
Crim 48b7f09
Updated README
Crim 9e80aaf
Move kafka metrics into own namespace
Crim bc0b352
First pass generating metric documentation
Crim 4660e68
re-generated README
Crim 62adeb0
Add categories to everything
Crim eff3966
Swap out delimiters with something thats hidden from view
Crim 132d16a
Rename Metrics to SpoutMetrics for DynamicSpout metric definition
Crim bcf8d99
add defaults for SidelineConfig, move Annotation class
Crim 12e8288
general cleanup
Crim b62bc6b
Regenerate README, update license URL
Crim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
## Generally speaking, you should instead run `mvn clean site` to generate the documentation. | ||
|
||
## Fail if any command fails | ||
set -e | ||
|
||
## Build package | ||
mvn package -DskipTests=true | ||
|
||
## Build DynamicSpout docs | ||
java -cp target/*jar-with-dependencies.jar com.salesforce.storm.spout.dynamic.config.DocTask | ||
|
||
## Build KafkaConsumer docs | ||
java -cp target/*jar-with-dependencies.jar com.salesforce.storm.spout.dynamic.kafka.DocTask | ||
|
||
## Build Sideline docs | ||
java -cp target/*jar-with-dependencies.jar com.salesforce.storm.spout.sideline.config.DocTask |
62 changes: 62 additions & 0 deletions
62
src/main/java/com/salesforce/storm/spout/documentation/ClassSpec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright (c) 2017, Salesforce.com, Inc. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the | ||
* following conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
* disclaimer. | ||
* | ||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following | ||
* disclaimer in the documentation and/or other materials provided with the distribution. | ||
* | ||
* * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products | ||
* derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
package com.salesforce.storm.spout.documentation; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Define a Class instance to generate documentation from. | ||
*/ | ||
public class ClassSpec { | ||
private final Class clazz; | ||
private final Map<String, Object> defaults; | ||
|
||
/** | ||
* Constructor. | ||
* @param clazz Class to generate documentation for. | ||
* @param defaults Default values for each option. | ||
*/ | ||
public ClassSpec(final Class clazz, final Map<String, Object> defaults) { | ||
this.clazz = clazz; | ||
this.defaults = defaults; | ||
} | ||
|
||
public ClassSpec(final Class clazz) { | ||
this(clazz, new HashMap<>()); | ||
} | ||
|
||
/** | ||
* @return Configured class instance. | ||
*/ | ||
public Class getClazz() { | ||
return clazz; | ||
} | ||
|
||
public Map<String, Object> getDefaults() { | ||
return defaults; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unnecessary to me. Why not just force the classes that we want to generate docs for to use an interface that includes a setDefaults/getDefaults method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just trying to change as little as possible for a first pass. I think we need to think about how/what things like SpoutConfig actually look like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^-- as part of a larger work item review those and come up with a plan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I dig ya, I just feel like adding an interface that's like
DefaultableConfig
or something would be cleaner on the implementation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I think we need to come up with concrete config classes instead of maps, and add that as part of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to create a follow up issue to create concrete config classes for DynamicSpout, SidelineSpout (if needed), and KafkaConsumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at adding an interface but currently we use static methods to setDefaults(). So before we could apply an interface over it, we'd first need to refactor SpoutConfig / SidelineConfig into being instantiated into an instance.
I think this is better pushed off to the specific issue/work around configs, see #80