Skip to content

Commit

Permalink
Merge branch 'release/1.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
fedelemantuano committed Mar 5, 2017
2 parents c0a31ea + a87a3a2 commit d6981ca
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 19 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ SpamScope will check on it to decide if mail/attachment is already analyzed or n

## Usage
SpamScope comes with four topologies:
- debug
- elasticsearch
- redis
- testing
- spamscope_debug
- spamscope_elasticsearch
- spamscope_redis
- spamscope_testing

and a general configuration file `spamscope.example.yml` in `conf/` folder.


If you want submit SpamScope topology use `spamscope-topology submit` tool. For more details `spamscope-topology submit -h`:

```
$ spamscope-topology submit --topology {debug,elasticsearch,redis,testing}
$ spamscope-topology submit --topology {spamscope_debug,spamscope_elasticsearch,spamscope_redis,spamscope_testing}
```

There are some options that you can use.
Expand Down
9 changes: 9 additions & 0 deletions conf/templates/commons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"order": 10,
"template": "*",
"settings": {
"index.codec": "best_compression",
"index.number_of_replicas": 0,
"index.refresh_interval": "5s"
}
}
2 changes: 1 addition & 1 deletion conf/templates/spamscope.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"order": 10,
"order": 0,
"template": "spamscope_*-*",
"settings": {
"analysis": {
Expand Down
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(defproject spamscope "1.4.0-SNAPSHOT"
(defproject spamscope "1.4.4-SNAPSHOT"
:resource-paths ["_resources"]
:target-path "_build"
:min-lein-version "2.0.0"
:jvm-opts ["-client"]
:dependencies [[org.apache.storm/storm-core "1.0.2"]
[org.apache.storm/flux-core "1.0.2"]]
:dependencies [[org.apache.storm/storm-core "1.0.3"]
[org.apache.storm/flux-core "1.0.3"]]
:jar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
:uberjar-exclusions [#"log4j\.properties" #"org\.apache\.storm\.(?!flux)" #"trident" #"META-INF" #"meta-inf" #"\.yaml"]
)
2 changes: 1 addition & 1 deletion src/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ usage: spamscope-topology submit [-h] [-g {debug,elasticsearch,redis,testing}]
optional arguments:
-h, --help show this help message and exit
-g {debug,elasticsearch,redis,testing}, --topology {debug,elasticsearch,redis,testing}
-g {spamscope_debug,spamscope_elasticsearch,spamscope_redis,spamscope_testing}, --topology {spamscope_debug,spamscope_elasticsearch,spamscope_redis,spamscope_testing}
SpamScope topology.
-w WORKERS, --workers WORKERS
Apache Storm workers for your topology.
Expand Down
9 changes: 5 additions & 4 deletions src/cli/spamscope_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
"%(asctime)s - %(funcName)s - %(levelname)s - %(message)s")
"[%(asctime)s] [%(levelname)s] [%(funcName)s] %(message)s")
ch.setFormatter(formatter)
log.addHandler(ch)

Expand Down Expand Up @@ -142,15 +142,16 @@ def update_template(client_host, max_retry, template_path, template_name):
for i in range(1, max_retry):
try:
es.indices.put_template(name=template_name, body=body)
log.info("Updating template done")
log.info("Updating template {!r} done".format(template_name))
return

except (ConnectionError, NotFoundError):
log.warning(
"Updating template failed. Waiting for {} sec".format(i))
"Updating template {!r} failed. Waiting for {} sec".format(
template_name, i))
time.sleep(i)

log.error("Updating template definitely failed")
log.error("Updating template {!r} definitely failed".format(template_name))


def main():
Expand Down
7 changes: 3 additions & 4 deletions src/cli/spamscope_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def get_args():
submit.add_argument(
"-g",
"--topology",
choices=["debug", "elasticsearch", "redis", "testing"],
choices=["spamscope_debug", "spamscope_elasticsearch",
"spamscope_redis", "spamscope_testing"],
default="debug",
help="SpamScope topology.",
dest="topology")
Expand Down Expand Up @@ -124,9 +125,7 @@ def submit_topology(topology, nr_worker, tick, max_pending,

args = shlex.split(command_line)
proc = Popen(args, stderr=STDOUT)
outs, errs = proc.communicate()
print(outs)
print(errs)
_, _ = proc.communicate()


def main():
Expand Down
2 changes: 1 addition & 1 deletion src/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from os.path import join

__version__ = "v1.4.2"
__version__ = "v1.4.4"
__configuration_path__ = "/etc/spamscope"

__defaults__ = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d6981ca

Please sign in to comment.