incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [3/4] git commit: Got everything working with 0.2 except for terms due to a bug
Date Sat, 07 Sep 2013 01:26:34 GMT
Got everything working with 0.2 except for terms due to a bug


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/551cce68
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/551cce68
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/551cce68

Branch: refs/heads/master
Commit: 551cce682ac60081edc9ffb1867d75d0be322edd
Parents: dc8acc0
Author: Chris Rohr <crohr@nearinfinity.com>
Authored: Fri Sep 6 21:26:03 2013 -0400
Committer: Chris Rohr <crohr@nearinfinity.com>
Committed: Fri Sep 6 21:26:03 2013 -0400

----------------------------------------------------------------------
 contrib/blur-console/blur-admin/Gemfile.lock    |    6 +-
 .../app/assets/javascripts/blur_table/table.js  |    2 +-
 .../templates/blur_table/hosts.jst.ejs          |   30 +-
 .../templates/blur_table/schema.jst.ejs         |    7 +-
 .../blur-admin/app/models/blur_query.rb         |    4 +-
 .../blur-admin/app/models/blur_table.rb         |   16 +-
 .../blur-admin/app/models/search.rb             |   14 +-
 .../config/initializers/blur_instrumentation.rb |   43 +
 ...031155_change_blur_queries_uuid_to_string.rb |   14 +
 ...4130250_increase_size_of_query_times_json.rb |   14 +
 .../blur-console/blur-admin/lib/thrift/blur.rb  | 2825 +++++++++++-------
 .../blur-admin/lib/thrift/blur_constants.rb     |   20 +-
 .../blur-admin/lib/thrift/blur_types.rb         | 1249 ++++----
 .../collectors/blur/table/SchemaCollector.java  |    6 +-
 .../org/apache/blur/agent/types/Column.java     |    2 +-
 15 files changed, 2613 insertions(+), 1639 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/Gemfile.lock
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/Gemfile.lock b/contrib/blur-console/blur-admin/Gemfile.lock
index 53b4810..a957ffb 100644
--- a/contrib/blur-console/blur-admin/Gemfile.lock
+++ b/contrib/blur-console/blur-admin/Gemfile.lock
@@ -149,9 +149,9 @@ GEM
       eventmachine (>= 0.12.6)
       rack (>= 1.0.0)
     thor (0.14.6)
-    thrift (0.8.0)
-    thrift_client (0.8.1)
-      thrift (~> 0.8.0)
+    thrift (0.9.1)
+    thrift_client (0.9.2)
+      thrift (~> 0.9.0)
     tilt (1.3.3)
     treetop (1.4.10)
       polyglot

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/assets/javascripts/blur_table/table.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/assets/javascripts/blur_table/table.js b/contrib/blur-console/blur-admin/app/assets/javascripts/blur_table/table.js
index 3ebb903..e8faa7b 100644
--- a/contrib/blur-console/blur-admin/app/assets/javascripts/blur_table/table.js
+++ b/contrib/blur-console/blur-admin/app/assets/javascripts/blur_table/table.js
@@ -120,7 +120,7 @@ var TableView = Backbone.View.extend({
       url: Routes.hosts_blur_table_path(this.model.get('id'), {format: 'json'}) ,
       success: _.bind(function(data){
         var host_modal = $(JST['templates/blur_table/hosts']({table: this.model, hosts: data}));
-        this.setup_filter_tree(host_modal);
+        this.setup_filter_tree(host_modal.find('.table_info_tree'));
         $().popup({
           title: 'Additional Host/Shard Info',
           titleClass: 'title',

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
b/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
index 2ef4989..c0cf38b 100644
--- a/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
+++ b/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/hosts.jst.ejs
@@ -17,20 +17,22 @@
     under the License.
 -->
 <% if (hosts) { %>
-  <div class="hosts table_info_tree">
-    <b>Hosts</b>
-    <ul>
-      <% _.each(hosts, function(shards, host){ %>
-        <li class="host" id="<%= host %>">
-          <a href=""><%= host %></a>
-          <ul>
-            <% _.each(shards, function(shard){ %>
-              <li class="shard"><%= shard %></li>
-            <% }); %>
-          </ul>
-        </li>
-      <% }); %>
-    </ul>
+  <div class="host_wrap">
+    <h4>Hosts</h4>
+    <div class="hosts table_info_tree">
+      <ul>
+        <% _.each(hosts, function(shards, host){ %>
+          <li>
+            <a href=""><%= host %></a>
+            <ul>
+              <% _.each(shards, function(shard){ %>
+                <li><%= shard %></li>
+              <% }); %>
+            </ul>
+          </li>
+        <% }); %>
+      </ul>
+    </div>
   </div>
 <% } else { %>
   <div>Not Available</div>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
b/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
index e8e6ec8..7a5c71b 100644
--- a/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
+++ b/contrib/blur-console/blur-admin/app/assets/javascripts/templates/blur_table/schema.jst.ejs
@@ -25,17 +25,16 @@
       <ul>
         <% _.each(schema, function(family){ %>
           <li>
-            <a href="#"><%= family.name + ' (' + table.get('table_analyzer') + ')'%></a>
+            <a href="#"><%= family.name %></a>
             <ul>
               <% _.each(family.columns, function(column){ %>
                 <li>
                   <a href="#"><%= column.name %></a>
                   <ul>
-                    <li><a href="#">Has Data?: <%= column.live %></a></li>
                     <li><a href="#">Searchable?: <%= column.searchable %></a></li>
-                    <li><a href="#">Analyzer: <%= column.analyzer %></a></li>
+                    <li><a href="#">Type: <%= column.analyzer %></a></li>
                     <li><a href="#">Full Text?: <%= column.fullText %></a></li>
-                    <% if(column.live && column.searchable) { %>
+                    <% if(column.searchable) { %>
                       <li data-family_name="<%= family.name%>" data-column_name="<%=
column.name %>">
                         <a href="#">
                           <span class="terms" data-family-name="<%= family.name %>"
data-column-name="<%= column.name %>">

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/models/blur_query.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/models/blur_query.rb b/contrib/blur-console/blur-admin/app/models/blur_query.rb
index 5353cc7..8262036 100644
--- a/contrib/blur-console/blur-admin/app/models/blur_query.rb
+++ b/contrib/blur-console/blur-admin/app/models/blur_query.rb
@@ -22,7 +22,9 @@ class BlurQuery < ActiveRecord::Base
 
   def cancel
     begin
-      BlurThriftClient.client(blur_table.zookeeper.blur_urls).cancelQuery self.blur_table.table_name,
self.uuid
+      ActiveSupport::Notifications.instrument "cancel.blur", :urls => blur_table.zookeeper.blur_urls,
:table => self.blur_table.table_name, :uuid => self.uuid do
+        BlurThriftClient.client(blur_table.zookeeper.blur_urls).cancelQuery self.blur_table.table_name,
self.uuid
+      end
       return true
     rescue Exception => e
       logger.error "Exception in BlurQueries.cancel:"

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/models/blur_table.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/models/blur_table.rb b/contrib/blur-console/blur-admin/app/models/blur_table.rb
index 6e7895f..37e1832 100644
--- a/contrib/blur-console/blur-admin/app/models/blur_table.rb
+++ b/contrib/blur-console/blur-admin/app/models/blur_table.rb
@@ -80,12 +80,16 @@ class BlurTable < ActiveRecord::Base
   end
 
   def terms(blur_urls,family,column,startWith,size)
-    BlurThriftClient.client(blur_urls).terms(self.table_name, family, column, startWith,
size)
+    ActiveSupport::Notifications.instrument "terms.blur", :urls => blur_urls, :family
=> family, :column => column, :starter => startWith, :size => size do
+      BlurThriftClient.client(blur_urls).terms(self.table_name, family, column, startWith,
size)
+    end
   end
 
   def enable(blur_urls)
     begin
-      BlurThriftClient.client(blur_urls).enableTable self.table_name
+      ActiveSupport::Notifications.instrument "enable.blur", :urls => blur_urls, :table
=> self.table_name do
+        BlurThriftClient.client(blur_urls).enableTable self.table_name
+      end
     ensure
       return self.is_enabled?
     end
@@ -93,7 +97,9 @@ class BlurTable < ActiveRecord::Base
 
   def disable(blur_urls)
     begin
-      BlurThriftClient.client(blur_urls).disableTable self.table_name
+      ActiveSupport::Notifications.instrument "disable.blur", :urls => blur_urls, :table
=> self.table_name do
+        BlurThriftClient.client(blur_urls).disableTable self.table_name
+      end
     ensure
       return self.is_disabled?
     end
@@ -101,7 +107,9 @@ class BlurTable < ActiveRecord::Base
 
   def blur_destroy(underlying=false, blur_urls)
     begin
-      BlurThriftClient.client(blur_urls).removeTable self.table_name, underlying
+      ActiveSupport::Notifications.instrument "destroy.blur", :urls => blur_urls, :table
=> self.table_name, :underlying => underlying do
+        BlurThriftClient.client(blur_urls).removeTable self.table_name, underlying
+      end
       return true
     rescue
       return false

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/app/models/search.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/app/models/search.rb b/contrib/blur-console/blur-admin/app/models/search.rb
index 90351f9..1fb04f4 100644
--- a/contrib/blur-console/blur-admin/app/models/search.rb
+++ b/contrib/blur-console/blur-admin/app/models/search.rb
@@ -21,15 +21,15 @@ class Search < ActiveRecord::Base
   attr_accessor :column_object
 
   def blur_query
-    b = Blur::BlurQuery.new( :simpleQuery  => Blur::SimpleQuery.new(:queryStr => query,
-                      :superQueryOn => super_query?),
+    b = Blur::BlurQuery.new( :query  => Blur::Query.new(:query => query,
+                      :rowQuery => super_query?),
                       :fetch        => fetch,
                       :start        => offset,
-                      :uuid         => Time.now.to_i*1000 + rand(1000),
+                      #:uuid         => Time.now.to_i*1000 + rand(1000),
                       :selector     => selector,
                       :userContext  => User.find(user_id).username)
-    b.simpleQuery.postSuperFilter = post_filter if !post_filter.blank?
-    b.simpleQuery.preSuperFilter = pre_filter if !pre_filter.blank?
+    b.query.rowFilter = post_filter if !post_filter.blank?
+    b.query.recordFilter = pre_filter if !pre_filter.blank?
     b
   end
 
@@ -62,7 +62,9 @@ class Search < ActiveRecord::Base
                         :recordOnly            => record_only?
   end
   def fetch_results(table_name, blur_urls)
-    BlurThriftClient.client(blur_urls).query(table_name, blur_query)
+    ActiveSupport::Notifications.instrument "search.blur", :urls => blur_urls, :table
=> table_name, :query => blur_query.query.query do
+      BlurThriftClient.client(blur_urls).query(table_name, blur_query)
+    end
   end
 
   def schema(blur_table)

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/config/initializers/blur_instrumentation.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/config/initializers/blur_instrumentation.rb b/contrib/blur-console/blur-admin/config/initializers/blur_instrumentation.rb
new file mode 100644
index 0000000..edf661f
--- /dev/null
+++ b/contrib/blur-console/blur-admin/config/initializers/blur_instrumentation.rb
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+ActiveSupport::Notifications.subscribe "search.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Query", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:table]}] #{payload[:query]} - #{payload[:urls]}")
+end
+
+ActiveSupport::Notifications.subscribe "terms.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Terms", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:family]}.#{payload[:column]}] #{payload[:starter]}
(#{payload[:size]}) - #{payload[:urls]}")
+end
+
+ActiveSupport::Notifications.subscribe "enable.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Enable Table", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:table]}] - #{payload[:urls]}")
+end
+
+ActiveSupport::Notifications.subscribe "disable.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Disable Table", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:table]}] - #{payload[:urls]}")
+end
+
+ActiveSupport::Notifications.subscribe "destroy.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Destroy Table", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:table]}] (Underlying: #{payload[:underlying]})
- #{payload[:urls]}")
+end
+
+ActiveSupport::Notifications.subscribe "cancel.blur" do |name, start, finish, id, payload|
+  item_name = '%s (%dms)' % ["Blur Cancel Query", (finish - start)]
+  Rails.logger.debug("  #{item_name}  [#{payload[:table]}] #{payload[:uuid]} - #{payload[:urls]}")
+end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/db/migrate/20130829031155_change_blur_queries_uuid_to_string.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/db/migrate/20130829031155_change_blur_queries_uuid_to_string.rb
b/contrib/blur-console/blur-admin/db/migrate/20130829031155_change_blur_queries_uuid_to_string.rb
index ed3577f..08613ae 100644
--- a/contrib/blur-console/blur-admin/db/migrate/20130829031155_change_blur_queries_uuid_to_string.rb
+++ b/contrib/blur-console/blur-admin/db/migrate/20130829031155_change_blur_queries_uuid_to_string.rb
@@ -1,3 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
 class ChangeBlurQueriesUuidToString < ActiveRecord::Migration
   def up
     change_column :blur_queries, :uuid, :string

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/551cce68/contrib/blur-console/blur-admin/db/migrate/20130904130250_increase_size_of_query_times_json.rb
----------------------------------------------------------------------
diff --git a/contrib/blur-console/blur-admin/db/migrate/20130904130250_increase_size_of_query_times_json.rb
b/contrib/blur-console/blur-admin/db/migrate/20130904130250_increase_size_of_query_times_json.rb
index 5658ed1..ba9a21e 100644
--- a/contrib/blur-console/blur-admin/db/migrate/20130904130250_increase_size_of_query_times_json.rb
+++ b/contrib/blur-console/blur-admin/db/migrate/20130904130250_increase_size_of_query_times_json.rb
@@ -1,3 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
 class IncreaseSizeOfQueryTimesJson < ActiveRecord::Migration
   def up
     change_column :blur_queries, :times, :text


Mime
View raw message