Skip to content

Commit

Permalink
small udf fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Jan 22, 2016
1 parent 38e23d8 commit 2247587
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 63 deletions.
1 change: 0 additions & 1 deletion cmd/kapacitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ func doDisable(args []string) error {
if rp.Error != "" {
return errors.New(rp.Error)
}
return nil
}
return nil
}
Expand Down
17 changes: 10 additions & 7 deletions udf/agent/py/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from threading import Lock, Thread
from Queue import Queue
import io
import traceback

import logging
logger = logging.getLogger()
Expand All @@ -23,19 +24,19 @@
#
# To write Points/Batches back to the Agent/Kapacitor use the Agent.write_response method, which is thread safe.
class Handler(object):
def info():
def info(self):
pass
def init(init_req):
def init(self, init_req):
pass
def snapshot():
def snapshot(self):
pass
def restore(restore_req):
def restore(self, restore_req):
pass
def begin_batch():
def begin_batch(self):
pass
def point():
def point(self):
pass
def end_batch(end_req):
def end_batch(self, end_req):
pass


Expand Down Expand Up @@ -122,11 +123,13 @@ def _read_loop(self):
except EOF:
break
except Exception as e:
traceback.print_exc()
error = "error processing request of type %s: %s" % (msg, e)
logger.error(error)
response = udf_pb2.Response()
response.error.error = error
self.write_response(response)
break

# Indicates the end of a file/stream has been reached.
class EOF(Exception):
Expand Down
Loading

0 comments on commit 2247587

Please sign in to comment.