Skip to content

Commit

Permalink
Better defaults for Druid endpoints and better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 16, 2015
1 parent 9d61ee2 commit 8aa97f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions panoramix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,11 @@ class Cluster(Model, AuditMixinNullable):
cluster_name = Column(String(250), unique=True)
coordinator_host = Column(String(256))
coordinator_port = Column(Integer)
coordinator_endpoint = Column(String(256))
coordinator_endpoint = Column(
String(256), default='druid/coordinator/v1/metadata')
broker_host = Column(String(256))
broker_port = Column(Integer)
broker_endpoint = Column(String(256))
broker_endpoint = Column(String(256), default='druid/v2')
metadata_last_refreshed = Column(DateTime)

def __repr__(self):
Expand Down
8 changes: 7 additions & 1 deletion panoramix/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,13 @@ def dashboard(self, id_):
def refresh_datasources(self):
session = db.session()
for cluster in session.query(models.Cluster).all():
cluster.refresh_datasources()
try:
cluster.refresh_datasources()
except Exception as e:
flash(
"Error while processing cluster '{}'".format(cluster),
"alert")
return redirect('/clustermodelview/list/')
cluster.metadata_last_refreshed = datetime.now()
flash(
"Refreshed metadata from cluster "
Expand Down

0 comments on commit 8aa97f7

Please sign in to comment.