incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [03/11] More changes, blur-core compile and tests pass.
Date Sun, 24 Mar 2013 20:05:20 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/interface/gen-rb/blur_constants.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur_constants.rb b/interface/gen-rb/blur_constants.rb
index fe44d59..e455224 100644
--- a/interface/gen-rb/blur_constants.rb
+++ b/interface/gen-rb/blur_constants.rb
@@ -1,10 +1,11 @@
 #
-# Autogenerated by Thrift Compiler (0.7.0)
+# Autogenerated by Thrift Compiler (0.9.0)
 #
 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 #
 
+require 'thrift'
 require 'blur_types'
 
-  module Blur
+module Blur
 end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur_types.rb b/interface/gen-rb/blur_types.rb
index d79536a..a9f3fea 100644
--- a/interface/gen-rb/blur_types.rb
+++ b/interface/gen-rb/blur_types.rb
@@ -1,754 +1,758 @@
 #
-# Autogenerated by Thrift Compiler (0.7.0)
+# Autogenerated by Thrift Compiler (0.9.0)
 #
 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 #
 
+require 'thrift'
 
 module Blur
-    module ScoreType
-      SUPER = 0
-      AGGREGATE = 1
-      BEST = 2
-      CONSTANT = 3
-      VALUE_MAP = {0 => "SUPER", 1 => "AGGREGATE", 2 => "BEST", 3 => "CONSTANT"}
-      VALID_VALUES = Set.new([SUPER, AGGREGATE, BEST, CONSTANT]).freeze
-    end
+  module ScoreType
+    SUPER = 0
+    AGGREGATE = 1
+    BEST = 2
+    CONSTANT = 3
+    VALUE_MAP = {0 => "SUPER", 1 => "AGGREGATE", 2 => "BEST", 3 => "CONSTANT"}
+    VALID_VALUES = Set.new([SUPER, AGGREGATE, BEST, CONSTANT]).freeze
+  end
 
-    module QueryState
-      RUNNING = 0
-      INTERRUPTED = 1
-      COMPLETE = 2
-      VALUE_MAP = {0 => "RUNNING", 1 => "INTERRUPTED", 2 => "COMPLETE"}
-      VALID_VALUES = Set.new([RUNNING, INTERRUPTED, COMPLETE]).freeze
-    end
+  module QueryState
+    RUNNING = 0
+    INTERRUPTED = 1
+    COMPLETE = 2
+    VALUE_MAP = {0 => "RUNNING", 1 => "INTERRUPTED", 2 => "COMPLETE"}
+    VALID_VALUES = Set.new([RUNNING, INTERRUPTED, COMPLETE]).freeze
+  end
 
-    module RowMutationType
-      DELETE_ROW = 0
-      REPLACE_ROW = 1
-      UPDATE_ROW = 2
-      VALUE_MAP = {0 => "DELETE_ROW", 1 => "REPLACE_ROW", 2 => "UPDATE_ROW"}
-      VALID_VALUES = Set.new([DELETE_ROW, REPLACE_ROW, UPDATE_ROW]).freeze
-    end
+  module RowMutationType
+    DELETE_ROW = 0
+    REPLACE_ROW = 1
+    UPDATE_ROW = 2
+    VALUE_MAP = {0 => "DELETE_ROW", 1 => "REPLACE_ROW", 2 => "UPDATE_ROW"}
+    VALID_VALUES = Set.new([DELETE_ROW, REPLACE_ROW, UPDATE_ROW]).freeze
+  end
 
-    module RecordMutationType
-      DELETE_ENTIRE_RECORD = 0
-      REPLACE_ENTIRE_RECORD = 1
-      REPLACE_COLUMNS = 2
-      APPEND_COLUMN_VALUES = 3
-      VALUE_MAP = {0 => "DELETE_ENTIRE_RECORD", 1 => "REPLACE_ENTIRE_RECORD", 2 => "REPLACE_COLUMNS", 3 => "APPEND_COLUMN_VALUES"}
-      VALID_VALUES = Set.new([DELETE_ENTIRE_RECORD, REPLACE_ENTIRE_RECORD, REPLACE_COLUMNS, APPEND_COLUMN_VALUES]).freeze
-    end
+  module RecordMutationType
+    DELETE_ENTIRE_RECORD = 0
+    REPLACE_ENTIRE_RECORD = 1
+    REPLACE_COLUMNS = 2
+    APPEND_COLUMN_VALUES = 3
+    VALUE_MAP = {0 => "DELETE_ENTIRE_RECORD", 1 => "REPLACE_ENTIRE_RECORD", 2 => "REPLACE_COLUMNS", 3 => "APPEND_COLUMN_VALUES"}
+    VALID_VALUES = Set.new([DELETE_ENTIRE_RECORD, REPLACE_ENTIRE_RECORD, REPLACE_COLUMNS, APPEND_COLUMN_VALUES]).freeze
+  end
 
-    # BlurException that carries a message plus the original stack
-    # trace (if any).
-    class BlurException < ::Thrift::Exception
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      MESSAGE = 1
-      STACKTRACESTR = 2
+  # BlurException that carries a message plus the original stack
+# trace (if any).
+  class BlurException < ::Thrift::Exception
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    MESSAGE = 1
+    STACKTRACESTR = 2
 
-      FIELDS = {
-        # The message in the exception.
-        MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
-        # The original stack trace (if any).
-        STACKTRACESTR => {:type => ::Thrift::Types::STRING, :name => 'stackTraceStr'}
-      }
+    FIELDS = {
+      # The message in the exception.
+      MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'},
+      # The original stack trace (if any).
+      STACKTRACESTR => {:type => ::Thrift::Types::STRING, :name => 'stackTraceStr'}
+    }
 
-      def struct_fields; FIELDS; end
+    def struct_fields; FIELDS; end
 
-      def validate
-      end
-
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # Column is the lowest storage element in Blur, it stores a single name and value pair.
-    class Column
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      NAME = 1
-      VALUE = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # The name of the column.
-        NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
-        # The value to be indexed and stored.
-        VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'}
-      }
+  # Column is the lowest storage element in Blur, it stores a single name and value pair.
+  class Column
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    NAME = 1
+    VALUE = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # The name of the column.
+      NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
+      # The value to be indexed and stored.
+      VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # Records contain a list of columns, multiple columns with the same name are allowed.
-    class Record
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      RECORDID = 1
-      FAMILY = 2
-      COLUMNS = 3
-
-      FIELDS = {
-        # Record id uniquely identifies a record within a single row.
-        RECORDID => {:type => ::Thrift::Types::STRING, :name => 'recordId'},
-        # The family in which this record resides.
-        FAMILY => {:type => ::Thrift::Types::STRING, :name => 'family'},
-        # A list of columns, multiple columns with the same name are allowed.
-        COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Column}}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # Records contain a list of columns, multiple columns with the same name are allowed.
+  class Record
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    RECORDID = 1
+    FAMILY = 2
+    COLUMNS = 3
+
+    FIELDS = {
+      # Record id uniquely identifies a record within a single row.
+      RECORDID => {:type => ::Thrift::Types::STRING, :name => 'recordId'},
+      # The family in which this record resides.
+      FAMILY => {:type => ::Thrift::Types::STRING, :name => 'family'},
+      # A list of columns, multiple columns with the same name are allowed.
+      COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Column}}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # Rows contain a list of records.
-    class Row
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ID = 1
-      RECORDS = 2
-      RECORDCOUNT = 3
-
-      FIELDS = {
-        # The row id.
-        ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
-        # The list records within the row.  If paging is used this list will only
-        # reflect the paged records from the selector.
-        RECORDS => {:type => ::Thrift::Types::LIST, :name => 'records', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Record}},
-        # The total record count for the row.  If paging is used in a selector to page
-        # through records of a row, this count will reflect the entire row.
-        RECORDCOUNT => {:type => ::Thrift::Types::I32, :name => 'recordCount'}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # Rows contain a list of records.
+  class Row
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ID = 1
+    RECORDS = 2
+    RECORDCOUNT = 3
+
+    FIELDS = {
+      # The row id.
+      ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
+      # The list records within the row.  If paging is used this list will only
+# reflect the paged records from the selector.
+      RECORDS => {:type => ::Thrift::Types::LIST, :name => 'records', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Record}},
+      # The total record count for the row.  If paging is used in a selector to page
+# through records of a row, this count will reflect the entire row.
+      RECORDCOUNT => {:type => ::Thrift::Types::I32, :name => 'recordCount'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # Select carries the request for information to be retrieved from the stored columns.
-    class Selector
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      RECORDONLY = 1
-      LOCATIONID = 2
-      ROWID = 3
-      RECORDID = 4
-      COLUMNFAMILIESTOFETCH = 5
-      COLUMNSTOFETCH = 6
-      ALLOWSTALEDATA = 7
-
-      FIELDS = {
-        # Fetch the Record only, not the entire Row.
-        RECORDONLY => {:type => ::Thrift::Types::BOOL, :name => 'recordOnly'},
-        # The location id of the Record or Row to be fetched.
-        LOCATIONID => {:type => ::Thrift::Types::STRING, :name => 'locationId'},
-        # The row id of the Row to be fetched, not to be used with location id.
-        ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowId'},
-        # The record id of the Record to be fetched, not to be used with location id.  However the row id needs to be provided to locate the correct Row with the requested Record.
-        RECORDID => {:type => ::Thrift::Types::STRING, :name => 'recordId'},
-        # The column families to fetch.  If null, fetch all.  If empty, fetch none.
-        COLUMNFAMILIESTOFETCH => {:type => ::Thrift::Types::SET, :name => 'columnFamiliesToFetch', :element => {:type => ::Thrift::Types::STRING}},
-        # The columns in the families to fetch.  If null, fetch all.  If empty, fetch none.
-        COLUMNSTOFETCH => {:type => ::Thrift::Types::MAP, :name => 'columnsToFetch', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET, :element => {:type => ::Thrift::Types::STRING}}},
-        # @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
-        ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData'}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # Select carries the request for information to be retrieved from the stored columns.
+  class Selector
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    RECORDONLY = 1
+    LOCATIONID = 2
+    ROWID = 3
+    RECORDID = 4
+    COLUMNFAMILIESTOFETCH = 5
+    COLUMNSTOFETCH = 6
+    ALLOWSTALEDATA = 7
+
+    FIELDS = {
+      # Fetch the Record only, not the entire Row.
+      RECORDONLY => {:type => ::Thrift::Types::BOOL, :name => 'recordOnly'},
+      # The location id of the Record or Row to be fetched.
+      LOCATIONID => {:type => ::Thrift::Types::STRING, :name => 'locationId'},
+      # The row id of the Row to be fetched, not to be used with location id.
+      ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowId'},
+      # The record id of the Record to be fetched, not to be used with location id.  However the row id needs to be provided to locate the correct Row with the requested Record.
+      RECORDID => {:type => ::Thrift::Types::STRING, :name => 'recordId'},
+      # The column families to fetch.  If null, fetch all.  If empty, fetch none.
+      COLUMNFAMILIESTOFETCH => {:type => ::Thrift::Types::SET, :name => 'columnFamiliesToFetch', :element => {:type => ::Thrift::Types::STRING}},
+      # The columns in the families to fetch.  If null, fetch all.  If empty, fetch none.
+      COLUMNSTOFETCH => {:type => ::Thrift::Types::MAP, :name => 'columnsToFetch', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET, :element => {:type => ::Thrift::Types::STRING}}},
+      # @deprecated This value is no longer used.  This allows the fetch to see the most current data that has been added to the table.
+      ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # FetchRowResult contains row result from a fetch.
-    class FetchRowResult
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ROW = 1
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # The row fetched.
-        ROW => {:type => ::Thrift::Types::STRUCT, :name => 'row', :class => Blur::Row}
-      }
+  # FetchRowResult contains row result from a fetch.
+  class FetchRowResult
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ROW = 1
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # The row fetched.
+      ROW => {:type => ::Thrift::Types::STRUCT, :name => 'row', :class => ::Blur::Row}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # FetchRecordResult contains rowid of the record and the record result from a fetch.
-    class FetchRecordResult
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ROWID = 1
-      RECORD = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # The row id of the record being fetched.
-        ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowid'},
-        # The record fetched.
-        RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => Blur::Record}
-      }
+  # FetchRecordResult contains rowid of the record and the record result from a fetch.
+  class FetchRecordResult
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ROWID = 1
+    RECORD = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # The row id of the record being fetched.
+      ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowid'},
+      # The record fetched.
+      RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => ::Blur::Record}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # FetchResult contains the row or record fetch result based if the Selector was going to fetch the entire row or a single record.
-    class FetchResult
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      EXISTS = 1
-      DELETED = 2
-      TABLE = 3
-      ROWRESULT = 4
-      RECORDRESULT = 5
-
-      FIELDS = {
-        # True if the result exists, false if it doesn't.
-        EXISTS => {:type => ::Thrift::Types::BOOL, :name => 'exists'},
-        # If the row was marked as deleted.
-        DELETED => {:type => ::Thrift::Types::BOOL, :name => 'deleted'},
-        # The table the fetch result came from.
-        TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
-        # The row result if a row was selected form the Selector.
-        ROWRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'rowResult', :class => Blur::FetchRowResult},
-        # The record result if a record was selected form the Selector.
-        RECORDRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'recordResult', :class => Blur::FetchRecordResult}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # FetchResult contains the row or record fetch result based if the Selector was going to fetch the entire row or a single record.
+  class FetchResult
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    EXISTS = 1
+    DELETED = 2
+    TABLE = 3
+    ROWRESULT = 4
+    RECORDRESULT = 5
+
+    FIELDS = {
+      # True if the result exists, false if it doesn't.
+      EXISTS => {:type => ::Thrift::Types::BOOL, :name => 'exists'},
+      # If the row was marked as deleted.
+      DELETED => {:type => ::Thrift::Types::BOOL, :name => 'deleted'},
+      # The table the fetch result came from.
+      TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
+      # The row result if a row was selected form the Selector.
+      ROWRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'rowResult', :class => ::Blur::FetchRowResult},
+      # The record result if a record was selected form the Selector.
+      RECORDRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'recordResult', :class => ::Blur::FetchRecordResult}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # The SimpleQuery object holds the query string (normal Lucene syntax), filters and type of scoring (used when super query is on).
-    class SimpleQuery
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      QUERYSTR = 1
-      SUPERQUERYON = 2
-      TYPE = 3
-      POSTSUPERFILTER = 4
-      PRESUPERFILTER = 5
-
-      FIELDS = {
-        # A Lucene syntax based query.
-        QUERYSTR => {:type => ::Thrift::Types::STRING, :name => 'queryStr'},
-        # If the super query is on, meaning the query will be perform against all the records (joining records in some cases) and the result will be Rows (groupings of Record).
-        SUPERQUERYON => {:type => ::Thrift::Types::BOOL, :name => 'superQueryOn', :default => true},
-        # The scoring type, see the document on ScoreType for explanation of each score type.
-        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :default =>         0, :enum_class => Blur::ScoreType},
-        # The post super filter (normal Lucene syntax), is a filter performed after the join to filter out entire rows from the results.
-        POSTSUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'postSuperFilter'},
-        # The pre super filter (normal Lucene syntax), is a filter performed before the join to filter out records from the results.
-        PRESUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'preSuperFilter'}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-        unless @type.nil? || Blur::ScoreType::VALID_VALUES.include?(@type)
-          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
-        end
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # The SimpleQuery object holds the query string (normal Lucene syntax), filters and type of scoring (used when super query is on).
+  class SimpleQuery
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    QUERYSTR = 1
+    SUPERQUERYON = 2
+    TYPE = 3
+    POSTSUPERFILTER = 4
+    PRESUPERFILTER = 5
+
+    FIELDS = {
+      # A Lucene syntax based query.
+      QUERYSTR => {:type => ::Thrift::Types::STRING, :name => 'queryStr'},
+      # If the super query is on, meaning the query will be perform against all the records (joining records in some cases) and the result will be Rows (groupings of Record).
+      SUPERQUERYON => {:type => ::Thrift::Types::BOOL, :name => 'superQueryOn', :default => true},
+      # The scoring type, see the document on ScoreType for explanation of each score type.
+      TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :default =>       0, :enum_class => ::Blur::ScoreType},
+      # The post super filter (normal Lucene syntax), is a filter performed after the join to filter out entire rows from the results.
+      POSTSUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'postSuperFilter'},
+      # The pre super filter (normal Lucene syntax), is a filter performed before the join to filter out records from the results.
+      PRESUPERFILTER => {:type => ::Thrift::Types::STRING, :name => 'preSuperFilter'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @type.nil? || ::Blur::ScoreType::VALID_VALUES.include?(@type)
+        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
+      end
     end
 
-    # The expert query allows for submission of a serialized query and filter object to be executed against all the queries.
-    class ExpertQuery
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      QUERY = 1
-      FILTER = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # The serialized query.
-        QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true},
-        # The serialized filter.
-        FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true}
-      }
+  # The expert query allows for submission of a serialized query and filter object to be executed against all the queries.
+  class ExpertQuery
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    QUERY = 1
+    FILTER = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # The serialized query.
+      QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true},
+      # The serialized filter.
+      FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # Blur facet.
-    class Facet
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      QUERYSTR = 1
-      MINIMUMNUMBEROFBLURRESULTS = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        QUERYSTR => {:type => ::Thrift::Types::STRING, :name => 'queryStr'},
-        MINIMUMNUMBEROFBLURRESULTS => {:type => ::Thrift::Types::I64, :name => 'minimumNumberOfBlurResults', :default => 9223372036854775807}
-      }
+  # Blur facet.
+  class Facet
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    QUERYSTR = 1
+    MINIMUMNUMBEROFBLURRESULTS = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      QUERYSTR => {:type => ::Thrift::Types::STRING, :name => 'queryStr'},
+      MINIMUMNUMBEROFBLURRESULTS => {:type => ::Thrift::Types::I64, :name => 'minimumNumberOfBlurResults', :default => 9223372036854775807}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class BlurQuery
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      SIMPLEQUERY = 1
-      EXPERTQUERY = 2
-      FACETS = 3
-      SELECTOR = 4
-      ALLOWSTALEDATA = 5
-      USECACHEIFPRESENT = 6
-      START = 7
-      FETCH = 8
-      MINIMUMNUMBEROFRESULTS = 9
-      MAXQUERYTIME = 10
-      UUID = 11
-      USERCONTEXT = 12
-      CACHERESULT = 13
-      STARTTIME = 14
-      MODIFYFILECACHES = 15
-
-      FIELDS = {
-        # 
-        SIMPLEQUERY => {:type => ::Thrift::Types::STRUCT, :name => 'simpleQuery', :class => Blur::SimpleQuery},
-        # 
-        EXPERTQUERY => {:type => ::Thrift::Types::STRUCT, :name => 'expertQuery', :class => Blur::ExpertQuery},
-        # 
-        FACETS => {:type => ::Thrift::Types::LIST, :name => 'facets', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Facet}},
-        # Selector is used to fetch data in the search results, if null only location ids will be fetched.
-        SELECTOR => {:type => ::Thrift::Types::STRUCT, :name => 'selector', :class => Blur::Selector},
-        # @deprecated This value is no longer used.  This allows the query to see the most current data that has been added to the table.
-        ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData', :default => false},
-        # 
-        USECACHEIFPRESENT => {:type => ::Thrift::Types::BOOL, :name => 'useCacheIfPresent', :default => true},
-        # 
-        START => {:type => ::Thrift::Types::I64, :name => 'start', :default => 0},
-        # 
-        FETCH => {:type => ::Thrift::Types::I32, :name => 'fetch', :default => 10},
-        # 
-        MINIMUMNUMBEROFRESULTS => {:type => ::Thrift::Types::I64, :name => 'minimumNumberOfResults', :default => 9223372036854775807},
-        # 
-        MAXQUERYTIME => {:type => ::Thrift::Types::I64, :name => 'maxQueryTime', :default => 9223372036854775807},
-        # 
-        UUID => {:type => ::Thrift::Types::I64, :name => 'uuid'},
-        # 
-        USERCONTEXT => {:type => ::Thrift::Types::STRING, :name => 'userContext'},
-        # 
-        CACHERESULT => {:type => ::Thrift::Types::BOOL, :name => 'cacheResult', :default => true},
-        # 
-        STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime', :default => 0},
-        # 
-        MODIFYFILECACHES => {:type => ::Thrift::Types::BOOL, :name => 'modifyFileCaches', :default => true}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class BlurQuery
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    SIMPLEQUERY = 1
+    EXPERTQUERY = 2
+    FACETS = 3
+    SELECTOR = 4
+    ALLOWSTALEDATA = 5
+    USECACHEIFPRESENT = 6
+    START = 7
+    FETCH = 8
+    MINIMUMNUMBEROFRESULTS = 9
+    MAXQUERYTIME = 10
+    UUID = 11
+    USERCONTEXT = 12
+    CACHERESULT = 13
+    STARTTIME = 14
+    MODIFYFILECACHES = 15
+
+    FIELDS = {
+      # 
+      SIMPLEQUERY => {:type => ::Thrift::Types::STRUCT, :name => 'simpleQuery', :class => ::Blur::SimpleQuery},
+      # 
+      EXPERTQUERY => {:type => ::Thrift::Types::STRUCT, :name => 'expertQuery', :class => ::Blur::ExpertQuery},
+      # 
+      FACETS => {:type => ::Thrift::Types::LIST, :name => 'facets', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Facet}},
+      # Selector is used to fetch data in the search results, if null only location ids will be fetched.
+      SELECTOR => {:type => ::Thrift::Types::STRUCT, :name => 'selector', :class => ::Blur::Selector},
+      # @deprecated This value is no longer used.  This allows the query to see the most current data that has been added to the table.
+      ALLOWSTALEDATA => {:type => ::Thrift::Types::BOOL, :name => 'allowStaleData', :default => false},
+      # 
+      USECACHEIFPRESENT => {:type => ::Thrift::Types::BOOL, :name => 'useCacheIfPresent', :default => true},
+      # 
+      START => {:type => ::Thrift::Types::I64, :name => 'start', :default => 0},
+      # 
+      FETCH => {:type => ::Thrift::Types::I32, :name => 'fetch', :default => 10},
+      # 
+      MINIMUMNUMBEROFRESULTS => {:type => ::Thrift::Types::I64, :name => 'minimumNumberOfResults', :default => 9223372036854775807},
+      # 
+      MAXQUERYTIME => {:type => ::Thrift::Types::I64, :name => 'maxQueryTime', :default => 9223372036854775807},
+      # 
+      UUID => {:type => ::Thrift::Types::I64, :name => 'uuid'},
+      # 
+      USERCONTEXT => {:type => ::Thrift::Types::STRING, :name => 'userContext'},
+      # 
+      CACHERESULT => {:type => ::Thrift::Types::BOOL, :name => 'cacheResult', :default => true},
+      # 
+      STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime', :default => 0},
+      # 
+      MODIFYFILECACHES => {:type => ::Thrift::Types::BOOL, :name => 'modifyFileCaches', :default => true}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # 
-    class BlurResult
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      LOCATIONID = 1
-      SCORE = 2
-      FETCHRESULT = 3
-
-      FIELDS = {
-        # 
-        LOCATIONID => {:type => ::Thrift::Types::STRING, :name => 'locationId'},
-        # 
-        SCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'score'},
-        # 
-        FETCHRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'fetchResult', :class => Blur::FetchResult}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class BlurResult
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    LOCATIONID = 1
+    SCORE = 2
+    FETCHRESULT = 3
+
+    FIELDS = {
+      # 
+      LOCATIONID => {:type => ::Thrift::Types::STRING, :name => 'locationId'},
+      # 
+      SCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'score'},
+      # 
+      FETCHRESULT => {:type => ::Thrift::Types::STRUCT, :name => 'fetchResult', :class => ::Blur::FetchResult}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # 
-    class BlurResults
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      TOTALRESULTS = 1
-      SHARDINFO = 2
-      RESULTS = 3
-      FACETCOUNTS = 4
-      EXCEPTIONS = 5
-      QUERY = 6
-
-      FIELDS = {
-        # 
-        TOTALRESULTS => {:type => ::Thrift::Types::I64, :name => 'totalResults', :default => 0},
-        # 
-        SHARDINFO => {:type => ::Thrift::Types::MAP, :name => 'shardInfo', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
-        # 
-        RESULTS => {:type => ::Thrift::Types::LIST, :name => 'results', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::BlurResult}},
-        # 
-        FACETCOUNTS => {:type => ::Thrift::Types::LIST, :name => 'facetCounts', :element => {:type => ::Thrift::Types::I64}},
-        # 
-        EXCEPTIONS => {:type => ::Thrift::Types::LIST, :name => 'exceptions', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::BlurException}},
-        # 
-        QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => Blur::BlurQuery}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class BlurResults
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    TOTALRESULTS = 1
+    SHARDINFO = 2
+    RESULTS = 3
+    FACETCOUNTS = 4
+    EXCEPTIONS = 5
+    QUERY = 6
+
+    FIELDS = {
+      # 
+      TOTALRESULTS => {:type => ::Thrift::Types::I64, :name => 'totalResults', :default => 0},
+      # 
+      SHARDINFO => {:type => ::Thrift::Types::MAP, :name => 'shardInfo', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I64}},
+      # 
+      RESULTS => {:type => ::Thrift::Types::LIST, :name => 'results', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::BlurResult}},
+      # 
+      FACETCOUNTS => {:type => ::Thrift::Types::LIST, :name => 'facetCounts', :element => {:type => ::Thrift::Types::I64}},
+      # 
+      EXCEPTIONS => {:type => ::Thrift::Types::LIST, :name => 'exceptions', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::BlurException}},
+      # 
+      QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Blur::BlurQuery}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # 
-    class RecordMutation
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      RECORDMUTATIONTYPE = 1
-      RECORD = 2
-
-      FIELDS = {
-        # 
-        RECORDMUTATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'recordMutationType', :enum_class => Blur::RecordMutationType},
-        # 
-        RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => Blur::Record}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-        unless @recordMutationType.nil? || Blur::RecordMutationType::VALID_VALUES.include?(@recordMutationType)
-          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field recordMutationType!')
-        end
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
-    end
+  # 
+  class RecordMutation
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    RECORDMUTATIONTYPE = 1
+    RECORD = 2
+
+    FIELDS = {
+      # 
+      RECORDMUTATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'recordMutationType', :enum_class => ::Blur::RecordMutationType},
+      # 
+      RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => ::Blur::Record}
+    }
 
-    # 
-    class RowMutation
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      TABLE = 1
-      ROWID = 2
-      WAL = 3
-      ROWMUTATIONTYPE = 4
-      RECORDMUTATIONS = 5
-      WAITTOBEVISIBLE = 6
-
-      FIELDS = {
-        # The that that the row mutation is to act upon.
-        TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
-        # The row id that the row mutation is to act upon.
-        ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowId'},
-        # Write ahead log, by default all updates are written to a write ahead log before the update is applied.  That way if a failure occurs before the index is committed the WAL can be replayed to recover any data that could have been lost.
-        WAL => {:type => ::Thrift::Types::BOOL, :name => 'wal', :default => true},
-        ROWMUTATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'rowMutationType', :enum_class => Blur::RowMutationType},
-        RECORDMUTATIONS => {:type => ::Thrift::Types::LIST, :name => 'recordMutations', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::RecordMutation}},
-        # On mutate waits for the mutation to be visible to queries and fetch requests.
-        WAITTOBEVISIBLE => {:type => ::Thrift::Types::BOOL, :name => 'waitToBeVisible', :default => false}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-        unless @rowMutationType.nil? || Blur::RowMutationType::VALID_VALUES.include?(@rowMutationType)
-          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field rowMutationType!')
-        end
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @recordMutationType.nil? || ::Blur::RecordMutationType::VALID_VALUES.include?(@recordMutationType)
+        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field recordMutationType!')
       end
+    end
 
-      ::Thrift::Struct.generate_accessors self
+    ::Thrift::Struct.generate_accessors self
+  end
+
+  # 
+  class RowMutation
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    TABLE = 1
+    ROWID = 2
+    WAL = 3
+    ROWMUTATIONTYPE = 4
+    RECORDMUTATIONS = 5
+    WAITTOBEVISIBLE = 6
+
+    FIELDS = {
+      # The that that the row mutation is to act upon.
+      TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
+      # The row id that the row mutation is to act upon.
+      ROWID => {:type => ::Thrift::Types::STRING, :name => 'rowId'},
+      # Write ahead log, by default all updates are written to a write ahead log before the update is applied.  That way if a failure occurs before the index is committed the WAL can be replayed to recover any data that could have been lost.
+      WAL => {:type => ::Thrift::Types::BOOL, :name => 'wal', :default => true},
+      ROWMUTATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'rowMutationType', :enum_class => ::Blur::RowMutationType},
+      RECORDMUTATIONS => {:type => ::Thrift::Types::LIST, :name => 'recordMutations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::RecordMutation}},
+      # On mutate waits for the mutation to be visible to queries and fetch requests.
+      WAITTOBEVISIBLE => {:type => ::Thrift::Types::BOOL, :name => 'waitToBeVisible', :default => false}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @rowMutationType.nil? || ::Blur::RowMutationType::VALID_VALUES.include?(@rowMutationType)
+        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field rowMutationType!')
+      end
     end
 
-    # 
-    class CpuTime
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      CPUTIME = 1
-      REALTIME = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # 
-        CPUTIME => {:type => ::Thrift::Types::I64, :name => 'cpuTime'},
-        # 
-        REALTIME => {:type => ::Thrift::Types::I64, :name => 'realTime'}
-      }
+  # 
+  class CpuTime
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    CPUTIME = 1
+    REALTIME = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # 
+      CPUTIME => {:type => ::Thrift::Types::I64, :name => 'cpuTime'},
+      # 
+      REALTIME => {:type => ::Thrift::Types::I64, :name => 'realTime'}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class BlurQueryStatus
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      QUERY = 1
-      CPUTIMES = 2
-      COMPLETESHARDS = 3
-      TOTALSHARDS = 4
-      STATE = 5
-      UUID = 6
-
-      FIELDS = {
-        # 
-        QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => Blur::BlurQuery},
-        # 
-        CPUTIMES => {:type => ::Thrift::Types::MAP, :name => 'cpuTimes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Blur::CpuTime}},
-        # 
-        COMPLETESHARDS => {:type => ::Thrift::Types::I32, :name => 'completeShards'},
-        # 
-        TOTALSHARDS => {:type => ::Thrift::Types::I32, :name => 'totalShards'},
-        # 
-        STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => Blur::QueryState},
-        # 
-        UUID => {:type => ::Thrift::Types::I64, :name => 'uuid'}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-        unless @state.nil? || Blur::QueryState::VALID_VALUES.include?(@state)
-          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
-        end
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class BlurQueryStatus
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    QUERY = 1
+    CPUTIMES = 2
+    COMPLETESHARDS = 3
+    TOTALSHARDS = 4
+    STATE = 5
+    UUID = 6
+
+    FIELDS = {
+      # 
+      QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Blur::BlurQuery},
+      # 
+      CPUTIMES => {:type => ::Thrift::Types::MAP, :name => 'cpuTimes', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::CpuTime}},
+      # 
+      COMPLETESHARDS => {:type => ::Thrift::Types::I32, :name => 'completeShards'},
+      # 
+      TOTALSHARDS => {:type => ::Thrift::Types::I32, :name => 'totalShards'},
+      # 
+      STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::Blur::QueryState},
+      # 
+      UUID => {:type => ::Thrift::Types::I64, :name => 'uuid'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @state.nil? || ::Blur::QueryState::VALID_VALUES.include?(@state)
+        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!')
+      end
     end
 
-    # 
-    class TableStats
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      TABLENAME = 1
-      BYTES = 2
-      RECORDCOUNT = 3
-      ROWCOUNT = 4
-      QUERIES = 5
-
-      FIELDS = {
-        # 
-        TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'},
-        # 
-        BYTES => {:type => ::Thrift::Types::I64, :name => 'bytes'},
-        # 
-        RECORDCOUNT => {:type => ::Thrift::Types::I64, :name => 'recordCount'},
-        # 
-        ROWCOUNT => {:type => ::Thrift::Types::I64, :name => 'rowCount'},
-        # 
-        QUERIES => {:type => ::Thrift::Types::I64, :name => 'queries'}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class TableStats
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    TABLENAME = 1
+    BYTES = 2
+    RECORDCOUNT = 3
+    ROWCOUNT = 4
+    QUERIES = 5
+
+    FIELDS = {
+      # 
+      TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'},
+      # 
+      BYTES => {:type => ::Thrift::Types::I64, :name => 'bytes'},
+      # 
+      RECORDCOUNT => {:type => ::Thrift::Types::I64, :name => 'recordCount'},
+      # 
+      ROWCOUNT => {:type => ::Thrift::Types::I64, :name => 'rowCount'},
+      # 
+      QUERIES => {:type => ::Thrift::Types::I64, :name => 'queries'}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # 
-    class Schema
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      TABLE = 1
-      COLUMNFAMILIES = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # 
-        TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
-        # 
-        COLUMNFAMILIES => {:type => ::Thrift::Types::MAP, :name => 'columnFamilies', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET, :element => {:type => ::Thrift::Types::STRING}}}
-      }
+  # 
+  class Schema
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    TABLE = 1
+    COLUMNFAMILIES = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # 
+      TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'},
+      # 
+      COLUMNFAMILIES => {:type => ::Thrift::Types::MAP, :name => 'columnFamilies', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::SET, :element => {:type => ::Thrift::Types::STRING}}}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class AlternateColumnDefinition
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ANALYZERCLASSNAME = 1
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # 
-        ANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'analyzerClassName'}
-      }
+  # 
+  class AlternateColumnDefinition
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ANALYZERCLASSNAME = 1
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # 
+      ANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'analyzerClassName'}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class ColumnDefinition
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ANALYZERCLASSNAME = 1
-      FULLTEXTINDEX = 2
-      ALTERNATECOLUMNDEFINITIONS = 3
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        ANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'analyzerClassName', :default => %q"org.apache.lucene.analysis.standard.StandardAnalyzer"},
-        FULLTEXTINDEX => {:type => ::Thrift::Types::BOOL, :name => 'fullTextIndex'},
-        ALTERNATECOLUMNDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'alternateColumnDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Blur::AlternateColumnDefinition}}
-      }
+  # 
+  class ColumnDefinition
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ANALYZERCLASSNAME = 1
+    FULLTEXTINDEX = 2
+    ALTERNATECOLUMNDEFINITIONS = 3
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      ANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'analyzerClassName', :default => %q"org.apache.lucene.analysis.standard.StandardAnalyzer"},
+      FULLTEXTINDEX => {:type => ::Thrift::Types::BOOL, :name => 'fullTextIndex'},
+      ALTERNATECOLUMNDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'alternateColumnDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::AlternateColumnDefinition}}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class ColumnFamilyDefinition
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      DEFAULTDEFINITION = 1
-      COLUMNDEFINITIONS = 2
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # 
-        DEFAULTDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'defaultDefinition', :class => Blur::ColumnDefinition},
-        # 
-        COLUMNDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'columnDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Blur::ColumnDefinition}}
-      }
+  # 
+  class ColumnFamilyDefinition
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    DEFAULTDEFINITION = 1
+    COLUMNDEFINITIONS = 2
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # 
+      DEFAULTDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'defaultDefinition', :class => ::Blur::ColumnDefinition},
+      # 
+      COLUMNDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'columnDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::ColumnDefinition}}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class AnalyzerDefinition
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      DEFAULTDEFINITION = 1
-      FULLTEXTANALYZERCLASSNAME = 2
-      COLUMNFAMILYDEFINITIONS = 3
-
-      FIELDS = {
-        # 
-        DEFAULTDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'defaultDefinition', :class => Blur::ColumnDefinition},
-        # 
-        FULLTEXTANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'fullTextAnalyzerClassName', :default => %q"org.apache.lucene.analysis.standard.StandardAnalyzer"},
-        # 
-        COLUMNFAMILYDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'columnFamilyDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Blur::ColumnFamilyDefinition}}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class AnalyzerDefinition
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    DEFAULTDEFINITION = 1
+    FULLTEXTANALYZERCLASSNAME = 2
+    COLUMNFAMILYDEFINITIONS = 3
+
+    FIELDS = {
+      # 
+      DEFAULTDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'defaultDefinition', :class => ::Blur::ColumnDefinition},
+      # 
+      FULLTEXTANALYZERCLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'fullTextAnalyzerClassName', :default => %q"org.apache.lucene.analysis.standard.StandardAnalyzer"},
+      # 
+      COLUMNFAMILYDEFINITIONS => {:type => ::Thrift::Types::MAP, :name => 'columnFamilyDefinitions', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::ColumnFamilyDefinition}}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
-    # 
-    class ColumnPreCache
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      PRECACHECOLS = 1
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      FIELDS = {
-        # This map sets what column families and columns to prefetch into block cache on shard open.
-        PRECACHECOLS => {:type => ::Thrift::Types::LIST, :name => 'preCacheCols', :element => {:type => ::Thrift::Types::STRING}}
-      }
+  # 
+  class ColumnPreCache
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    PRECACHECOLS = 1
 
-      def struct_fields; FIELDS; end
+    FIELDS = {
+      # This map sets what column families and columns to prefetch into block cache on shard open.
+      PRECACHECOLS => {:type => ::Thrift::Types::LIST, :name => 'preCacheCols', :element => {:type => ::Thrift::Types::STRING}}
+    }
 
-      def validate
-      end
+    def struct_fields; FIELDS; end
 
-      ::Thrift::Struct.generate_accessors self
+    def validate
     end
 
-    # 
-    class TableDescriptor
-      include ::Thrift::Struct, ::Thrift::Struct_Union
-      ISENABLED = 1
-      ANALYZERDEFINITION = 2
-      SHARDCOUNT = 3
-      TABLEURI = 4
-      COMPRESSIONCLASS = 5
-      COMPRESSIONBLOCKSIZE = 6
-      CLUSTER = 7
-      NAME = 8
-      SIMILARITYCLASS = 9
-      BLOCKCACHING = 10
-      BLOCKCACHINGFILETYPES = 11
-      READONLY = 12
-      COLUMNPRECACHE = 13
-
-      FIELDS = {
-        # 
-        ISENABLED => {:type => ::Thrift::Types::BOOL, :name => 'isEnabled', :default => true},
-        # 
-        ANALYZERDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'analyzerDefinition', :class => Blur::AnalyzerDefinition},
-        # 
-        SHARDCOUNT => {:type => ::Thrift::Types::I32, :name => 'shardCount', :default => 1},
-        # 
-        TABLEURI => {:type => ::Thrift::Types::STRING, :name => 'tableUri'},
-        # 
-        COMPRESSIONCLASS => {:type => ::Thrift::Types::STRING, :name => 'compressionClass', :default => %q"org.apache.hadoop.io.compress.DefaultCodec"},
-        # 
-        COMPRESSIONBLOCKSIZE => {:type => ::Thrift::Types::I32, :name => 'compressionBlockSize', :default => 32768},
-        # 
-        CLUSTER => {:type => ::Thrift::Types::STRING, :name => 'cluster', :default => %q"default"},
-        # 
-        NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
-        # 
-        SIMILARITYCLASS => {:type => ::Thrift::Types::STRING, :name => 'similarityClass'},
-        # 
-        BLOCKCACHING => {:type => ::Thrift::Types::BOOL, :name => 'blockCaching', :default => true},
-        # 
-        BLOCKCACHINGFILETYPES => {:type => ::Thrift::Types::SET, :name => 'blockCachingFileTypes', :element => {:type => ::Thrift::Types::STRING}},
-        # If a table is set to be readonly, that means that mutates through Thrift are NOT allowed.  However
-        # updates through MapReduce are allowed and in fact they are only allowed if the table is in readOnly mode.
-        READONLY => {:type => ::Thrift::Types::BOOL, :name => 'readOnly', :default => false},
-        # Sets what column families and columns to prefetch into block cache on shard open.
-        COLUMNPRECACHE => {:type => ::Thrift::Types::STRUCT, :name => 'columnPreCache', :class => Blur::ColumnPreCache}
-      }
-
-      def struct_fields; FIELDS; end
-
-      def validate
-      end
+    ::Thrift::Struct.generate_accessors self
+  end
 
-      ::Thrift::Struct.generate_accessors self
+  # 
+  class TableDescriptor
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    ISENABLED = 1
+    ANALYZERDEFINITION = 2
+    SHARDCOUNT = 3
+    TABLEURI = 4
+    COMPRESSIONCLASS = 5
+    COMPRESSIONBLOCKSIZE = 6
+    CLUSTER = 7
+    NAME = 8
+    SIMILARITYCLASS = 9
+    BLOCKCACHING = 10
+    BLOCKCACHINGFILETYPES = 11
+    READONLY = 12
+    COLUMNPRECACHE = 13
+    TABLEPROPERTIES = 14
+
+    FIELDS = {
+      # 
+      ISENABLED => {:type => ::Thrift::Types::BOOL, :name => 'isEnabled', :default => true},
+      # 
+      ANALYZERDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'analyzerDefinition', :class => ::Blur::AnalyzerDefinition},
+      # 
+      SHARDCOUNT => {:type => ::Thrift::Types::I32, :name => 'shardCount', :default => 1},
+      # 
+      TABLEURI => {:type => ::Thrift::Types::STRING, :name => 'tableUri'},
+      # 
+      COMPRESSIONCLASS => {:type => ::Thrift::Types::STRING, :name => 'compressionClass', :default => %q"org.apache.hadoop.io.compress.DefaultCodec"},
+      # 
+      COMPRESSIONBLOCKSIZE => {:type => ::Thrift::Types::I32, :name => 'compressionBlockSize', :default => 32768},
+      # 
+      CLUSTER => {:type => ::Thrift::Types::STRING, :name => 'cluster', :default => %q"default"},
+      # 
+      NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
+      # 
+      SIMILARITYCLASS => {:type => ::Thrift::Types::STRING, :name => 'similarityClass'},
+      # 
+      BLOCKCACHING => {:type => ::Thrift::Types::BOOL, :name => 'blockCaching', :default => true},
+      # 
+      BLOCKCACHINGFILETYPES => {:type => ::Thrift::Types::SET, :name => 'blockCachingFileTypes', :element => {:type => ::Thrift::Types::STRING}},
+      # If a table is set to be readonly, that means that mutates through Thrift are NOT allowed.  However
+# updates through MapReduce are allowed and in fact they are only allowed if the table is in readOnly mode.
+      READONLY => {:type => ::Thrift::Types::BOOL, :name => 'readOnly', :default => false},
+      # Sets what column families and columns to prefetch into block cache on shard open.
+      COLUMNPRECACHE => {:type => ::Thrift::Types::STRUCT, :name => 'columnPreCache', :class => ::Blur::ColumnPreCache},
+      # Properties, used to override default settings on a per table basis.
+      TABLEPROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'tableProperties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
     end
 
+    ::Thrift::Struct.generate_accessors self
   end
+
+end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index 8a6fca2..f00c940 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -55,6 +55,7 @@ import org.apache.blur.manager.status.QueryStatusManager;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.metrics.BlurMetrics;
 import org.apache.blur.metrics.QueryMetrics;
+import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.thrift.BException;
 import org.apache.blur.thrift.MutationHelper;
 import org.apache.blur.thrift.generated.BlurException;
@@ -99,7 +100,6 @@ import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.search.FilteredQuery;
-import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
@@ -178,11 +178,11 @@ public class IndexManager {
       LOG.error("Unknown error while trying to get the correct index reader for selector [{0}].", e, selector);
       throw new BException(e.getMessage(), e);
     }
-    IndexReader reader = null;
+    IndexSearcherClosable searcher = null;
     try {
-      reader = index.getIndexReader();
+      searcher = index.getIndexReader();
       long s = System.nanoTime();
-      fetchRow(reader, table, selector, fetchResult);
+      fetchRow(searcher.getIndexReader(), table, selector, fetchResult);
       _queryMetrics.recordDataFetch(System.nanoTime() - s, getRecordCount(fetchResult));
       if (_blurMetrics != null) {
         if (fetchResult.rowResult != null) {
@@ -198,12 +198,12 @@ public class IndexManager {
       LOG.error("Unknown error while trying to fetch row.", e);
       throw new BException(e.getMessage(), e);
     } finally {
-      if (reader != null) {
+      if (searcher != null) {
         // this will allow for closing of index
         try {
-          reader.decRef();
+          searcher.close();
         } catch (IOException e) {
-          LOG.error("Unknown error trying to call decRef on reader [{0}]", e, reader);
+          LOG.error("Unknown error trying to call close on searcher [{0}]", e, searcher);
         }
       }
     }
@@ -229,9 +229,8 @@ public class IndexManager {
     if (blurIndex == null) {
       throw new BlurException("Shard [" + shardName + "] is not being servered by this shardserver.", null);
     }
-    IndexReader reader = blurIndex.getIndexReader();
+    IndexSearcherClosable searcher = blurIndex.getIndexReader();
     try {
-      IndexSearcher searcher = new IndexSearcher(reader);
       BooleanQuery query = new BooleanQuery();
       if (selector.recordOnly) {
         query.add(new TermQuery(new Term(RECORD_ID, recordId)), Occur.MUST);
@@ -255,7 +254,7 @@ public class IndexManager {
       }
     } finally {
       // this will allow for closing of index
-      reader.decRef();
+      searcher.close();
     }
   }
 
@@ -517,12 +516,12 @@ public class IndexManager {
       @Override
       public Long call(Entry<String, BlurIndex> input) throws Exception {
         BlurIndex index = input.getValue();
-        IndexReader reader = index.getIndexReader();
+        IndexSearcherClosable searcher = index.getIndexReader();
         try {
-          return recordFrequency(reader, columnFamily, columnName, value);
+          return recordFrequency(searcher.getIndexReader(), columnFamily, columnName, value);
         } finally {
           // this will allow for closing of index
-          reader.decRef();
+          searcher.close();
         }
       }
     }).merge(new Merger<Long>() {
@@ -550,12 +549,12 @@ public class IndexManager {
       @Override
       public List<String> call(Entry<String, BlurIndex> input) throws Exception {
         BlurIndex index = input.getValue();
-        IndexReader reader = index.getIndexReader();
+        IndexSearcherClosable searcher = index.getIndexReader();
         try {
-          return terms(reader, columnFamily, columnName, startWith, size);
+          return terms(searcher.getIndexReader(), columnFamily, columnName, startWith, size);
         } finally {
           // this will allow for closing of index
-          reader.decRef();
+          searcher.close();
         }
       }
     }).merge(new Merger<List<String>>() {
@@ -606,9 +605,9 @@ public class IndexManager {
     schema.columnFamilies = new TreeMap<String, Set<String>>();
     Map<String, BlurIndex> blurIndexes = _indexServer.getIndexes(table);
     for (BlurIndex blurIndex : blurIndexes.values()) {
-      IndexReader reader = blurIndex.getIndexReader();
+      IndexSearcherClosable searcher = blurIndex.getIndexReader();
       try {
-        FieldInfos mergedFieldInfos = MultiFields.getMergedFieldInfos(reader);
+        FieldInfos mergedFieldInfos = MultiFields.getMergedFieldInfos(searcher.getIndexReader());
         for (FieldInfo fieldInfo : mergedFieldInfos) {
           String fieldName = fieldInfo.name;
           int index = fieldName.indexOf('.');
@@ -625,7 +624,7 @@ public class IndexManager {
         }
       } finally {
         // this will allow for closing of index
-        reader.decRef();
+        searcher.close();
       }
     }
     return schema;
@@ -938,15 +937,14 @@ public class IndexManager {
       _status.attachThread();
       try {
         BlurIndex index = entry.getValue();
-        IndexReader reader = index.getIndexReader();
+        IndexSearcherClosable searcher = index.getIndexReader();
         String shard = entry.getKey();
         // @TODO need to add escapable rewriter
         // IndexReader escapeReader = EscapeRewrite.wrap(reader, _running);
         // IndexSearcher searcher = new IndexSearcher(escapeReader);
-        IndexSearcher searcher = new IndexSearcher(reader);
         searcher.setSimilarity(_indexServer.getSimilarity(_table));
         Query rewrite = searcher.rewrite((Query) _query.clone());
-        return new BlurResultIterableSearcher(_running, rewrite, _table, shard, searcher, _selector, reader);
+        return new BlurResultIterableSearcher(_running, rewrite, _table, shard, searcher, _selector, searcher.getIndexReader());
       } finally {
         _blurMetrics.queriesInternal.incrementAndGet();
         _status.deattachThread();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/AbstractIndexServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/AbstractIndexServer.java b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/AbstractIndexServer.java
index b9e0e6b..3644d96 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/AbstractIndexServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/AbstractIndexServer.java
@@ -21,6 +21,7 @@ import java.util.Map;
 
 import org.apache.blur.manager.IndexServer;
 import org.apache.blur.manager.writer.BlurIndex;
+import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.utils.BlurConstants;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.IndexSearcher;
@@ -33,13 +34,13 @@ public abstract class AbstractIndexServer implements IndexServer {
     long recordCount = 0;
     Map<String, BlurIndex> indexes = getIndexes(table);
     for (Map.Entry<String, BlurIndex> index : indexes.entrySet()) {
-      IndexReader indexReader = null;
+      IndexSearcherClosable searcher = null;
       try {
-        indexReader = index.getValue().getIndexReader();
-        recordCount += indexReader.numDocs();
+        searcher = index.getValue().getIndexReader();
+        recordCount += searcher.getIndexReader().numDocs();
       } finally {
-        if (indexReader != null) {
-          indexReader.decRef();
+        if (searcher != null) {
+          searcher.close();
         }
       }
     }
@@ -50,13 +51,13 @@ public abstract class AbstractIndexServer implements IndexServer {
     long rowCount = 0;
     Map<String, BlurIndex> indexes = getIndexes(table);
     for (Map.Entry<String, BlurIndex> index : indexes.entrySet()) {
-      IndexReader indexReader = null;
+      IndexSearcherClosable searcher = null;
       try {
-        indexReader = index.getValue().getIndexReader();
-        rowCount += getRowCount(indexReader);
+        searcher = index.getValue().getIndexReader();
+        rowCount += getRowCount(searcher.getIndexReader());
       } finally {
-        if (indexReader != null) {
-          indexReader.decRef();
+        if (searcher != null) {
+          searcher.close();
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/CloseableExecutorService.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/CloseableExecutorService.java b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/CloseableExecutorService.java
new file mode 100644
index 0000000..e5d3647
--- /dev/null
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/CloseableExecutorService.java
@@ -0,0 +1,20 @@
+package org.apache.blur.manager.indexserver;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.concurrent.ExecutorService;
+
+public class CloseableExecutorService implements Closeable {
+
+  private ExecutorService executor;
+
+  public CloseableExecutorService(ExecutorService executor) {
+    this.executor = executor;
+  }
+
+  @Override
+  public void close() throws IOException {
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
index 6d0c8ea..e435310 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/DistributedIndexServer.java
@@ -44,15 +44,18 @@ import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.search.FairSimilarity;
 import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
+import org.apache.blur.lucene.store.refcounter.IndexInputCloser;
 import org.apache.blur.manager.BlurFilterCache;
 import org.apache.blur.manager.clusterstatus.ClusterStatus;
 import org.apache.blur.manager.clusterstatus.ZookeeperPathConstants;
 import org.apache.blur.manager.writer.BlurIndex;
-import org.apache.blur.manager.writer.BlurIndexCloser;
-import org.apache.blur.manager.writer.BlurIndexReader;
 import org.apache.blur.manager.writer.BlurIndexRefresher;
 import org.apache.blur.manager.writer.BlurNRTIndex;
+import org.apache.blur.manager.writer.SharedMergeScheduler;
 import org.apache.blur.metrics.BlurMetrics;
+import org.apache.blur.server.IndexSearcherClosable;
+import org.apache.blur.server.ShardContext;
+import org.apache.blur.server.TableContext;
 import org.apache.blur.store.blockcache.BlockDirectory;
 import org.apache.blur.store.blockcache.Cache;
 import org.apache.blur.store.hdfs.BlurLockFactory;
@@ -107,7 +110,6 @@ public class DistributedIndexServer extends AbstractIndexServer {
   // set internally
   private Timer _timerCacheFlush;
   private ExecutorService _openerService;
-  private BlurIndexCloser _closer;
   private Timer _timerTableWarmer;
   private BlurFilterCache _filterCache;
   private AtomicBoolean _running = new AtomicBoolean();
@@ -115,9 +117,11 @@ public class DistributedIndexServer extends AbstractIndexServer {
   private BlurIndexWarmup _warmup = new DefaultBlurIndexWarmup();
   private IndexDeletionPolicy _indexDeletionPolicy;
   private DirectoryReferenceFileGC _gc;
-  private long _timeBetweenCommits = TimeUnit.SECONDS.toMillis(60);
-  private long _timeBetweenRefreshs = TimeUnit.MILLISECONDS.toMillis(500);
   private WatchChildren _watchOnlineShards;
+  
+  private SharedMergeScheduler _mergeScheduler;
+  private IndexInputCloser _closer = null;
+  private ExecutorService _searchExecutor = null;
 
   public static interface ReleaseReader {
     void release() throws IOException;
@@ -126,10 +130,14 @@ public class DistributedIndexServer extends AbstractIndexServer {
   public void init() throws KeeperException, InterruptedException, IOException {
     BlurUtil.setupZookeeper(_zookeeper, _cluster);
     _openerService = Executors.newThreadPool("shard-opener", _shardOpenerThreadCount);
-    _closer = new BlurIndexCloser();
-    _closer.init();
     _gc = new DirectoryReferenceFileGC();
     _gc.init();
+    
+    // @TODO allow for configuration of these
+    _mergeScheduler = new SharedMergeScheduler();
+    _searchExecutor = Executors.newThreadPool("internal-search", 16);
+    _closer = new IndexInputCloser();
+    _closer.init();
     setupFlushCacheTimer();
     String lockPath = BlurUtil.lockForSafeMode(_zookeeper, getNodeName(), _cluster);
     try {
@@ -489,6 +497,9 @@ public class DistributedIndexServer extends AbstractIndexServer {
 //        throw new IOException(e);
 //      }
     }
+    
+    TableContext tableContext = TableContext.create(descriptor);
+    ShardContext shardContext = ShardContext.create(tableContext, shard);
 
     Directory dir;
     boolean blockCacheEnabled = _clusterStatus.isBlockCacheEnabled(_cluster, table);
@@ -501,32 +512,20 @@ public class DistributedIndexServer extends AbstractIndexServer {
 
     BlurIndex index;
     if (_clusterStatus.isReadOnly(true, _cluster, table)) {
-      BlurIndexReader reader = new BlurIndexReader();
-      reader.setCloser(_closer);
-      reader.setAnalyzer(getAnalyzer(table));
-      reader.setDirectory(dir);
-      reader.setRefresher(_refresher);
-      reader.setShard(shard);
-      reader.setTable(table);
-      reader.setIndexDeletionPolicy(_indexDeletionPolicy);
-      reader.setSimilarity(getSimilarity(table));
-      reader.init();
-      index = reader;
+//      BlurIndexReader reader = new BlurIndexReader();
+//      reader.setCloser(_closer);
+//      reader.setAnalyzer(getAnalyzer(table));
+//      reader.setDirectory(dir);
+//      reader.setRefresher(_refresher);
+//      reader.setShard(shard);
+//      reader.setTable(table);
+//      reader.setIndexDeletionPolicy(_indexDeletionPolicy);
+//      reader.setSimilarity(getSimilarity(table));
+//      reader.init();
+//      index = reader;
+      throw new RuntimeException("not impl");
     } else {
-      BlurNRTIndex writer = new BlurNRTIndex();
-      writer.setAnalyzer(getAnalyzer(table));
-      writer.setDirectory(dir);
-      writer.setShard(shard);
-      writer.setTable(table);
-      writer.setSimilarity(getSimilarity(table));
-      writer.setTimeBetweenCommits(_timeBetweenCommits);
-      writer.setTimeBetweenRefreshs(_timeBetweenRefreshs);
-      writer.setWalPath(walTablePath);
-      writer.setConfiguration(_configuration);
-      writer.setIndexDeletionPolicy(_indexDeletionPolicy);
-      writer.setCloser(_closer);
-      writer.setGc(_gc);
-      writer.init();
+      BlurNRTIndex writer = new BlurNRTIndex(shardContext, _mergeScheduler, _closer, dir, _gc, _searchExecutor);
       index = writer;
     }
     _filterCache.opening(table, shard, index);
@@ -535,13 +534,14 @@ public class DistributedIndexServer extends AbstractIndexServer {
   }
 
   private BlurIndex warmUp(BlurIndex index, TableDescriptor table, String shard) throws IOException {
-    final IndexReader reader = index.getIndexReader();
+    final IndexSearcherClosable searcher = index.getIndexReader();
+    IndexReader reader = searcher.getIndexReader();
     warmUpAllSegments(reader);
     _warmup.warmBlurIndex(table, shard, reader, index.isClosed(), new ReleaseReader() {
       @Override
       public void release() throws IOException {
         // this will allow for closing of index
-        reader.decRef();
+        searcher.close();
       }
     });
 
@@ -808,10 +808,6 @@ public class DistributedIndexServer extends AbstractIndexServer {
     _blurMetrics = blurMetrics;
   }
 
-  public void setCloser(BlurIndexCloser closer) {
-    _closer = closer;
-  }
-
   public void setZookeeper(ZooKeeper zookeeper) {
     _zookeeper = zookeeper;
   }
@@ -831,14 +827,6 @@ public class DistributedIndexServer extends AbstractIndexServer {
   public void setIndexDeletionPolicy(IndexDeletionPolicy indexDeletionPolicy) {
     _indexDeletionPolicy = indexDeletionPolicy;
   }
-
-  public void setTimeBetweenCommits(long timeBetweenCommits) {
-    _timeBetweenCommits = timeBetweenCommits;
-  }
-
-  public void setTimeBetweenRefreshs(long timeBetweenRefreshs) {
-    _timeBetweenRefreshs = timeBetweenRefreshs;
-  }
   
   public void setClusterName(String cluster) {
     _cluster = cluster;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
index 041eb2a..3f17bdb 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/indexserver/LocalIndexServer.java
@@ -30,18 +30,25 @@ import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import org.apache.blur.analysis.BlurAnalyzer;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.search.FairSimilarity;
+import org.apache.blur.lucene.store.refcounter.DirectoryReferenceFileGC;
+import org.apache.blur.lucene.store.refcounter.IndexInputCloser;
 import org.apache.blur.manager.writer.BlurIndex;
-import org.apache.blur.manager.writer.BlurIndexCloser;
 import org.apache.blur.manager.writer.BlurNRTIndex;
-import org.apache.hadoop.conf.Configuration;
+import org.apache.blur.manager.writer.SharedMergeScheduler;
+import org.apache.blur.server.ShardContext;
+import org.apache.blur.server.TableContext;
+import org.apache.blur.thrift.generated.TableDescriptor;
+import org.apache.blur.utils.BlurConstants;
+import org.apache.blur.utils.BlurUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.compress.CompressionCodec;
-import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.analysis.util.CharArraySet;
@@ -53,29 +60,53 @@ import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MMapDirectory;
 
+import com.google.common.io.Closer;
+
 public class LocalIndexServer extends AbstractIndexServer {
 
   private final static Log LOG = LogFactory.getLog(LocalIndexServer.class);
 
-  private Map<String, Map<String, BlurIndex>> _readersMap = new ConcurrentHashMap<String, Map<String, BlurIndex>>();
-  private File _localDir;
-  private BlurIndexCloser _closer;
-  private int _blockSize = 65536;
-  private CompressionCodec _compression = new DefaultCodec();
-  private Path _walPath;
-  private Configuration _configuration = new Configuration();
+  private final Map<String, Map<String, BlurIndex>> _readersMap = new ConcurrentHashMap<String, Map<String, BlurIndex>>();
+  private final SharedMergeScheduler _mergeScheduler;
+  private final IndexInputCloser _indexInputCloser;
+  private final DirectoryReferenceFileGC _gc;
+  private final ExecutorService _searchExecutor;
+  private final TableContext _tableContext;
+  private final Closer _closer;
+
+  public LocalIndexServer(TableDescriptor tableDescriptor) throws IOException {
+    _closer = Closer.create();
+    _tableContext = TableContext.create(tableDescriptor);
+    _mergeScheduler = new SharedMergeScheduler();
+    _indexInputCloser = new IndexInputCloser();
+    _indexInputCloser.init();
+    _gc = new DirectoryReferenceFileGC();
+    _gc.init();
+    _searchExecutor = Executors.newCachedThreadPool();
+    _closer.register(_mergeScheduler);
+    _closer.register(_indexInputCloser);
+    _closer.register(_gc);
+    _closer.register(new CloseableExecutorService(_searchExecutor));
+
+    getIndexes(_tableContext.getTable());
+  }
 
-  public LocalIndexServer(File file, Path walPath) {
-    _localDir = file;
-    _localDir.mkdirs();
-    _closer = new BlurIndexCloser();
-    _closer.init();
-    _walPath = walPath;
+  @Override
+  public void close() {
+    try {
+      _closer.close();
+    } catch (IOException e) {
+      LOG.error("Unknown error", e);
+    }
+    for (String table : _readersMap.keySet()) {
+      close(_readersMap.get(table));
+    }
   }
 
   @Override
   public BlurAnalyzer getAnalyzer(String table) {
-    return new BlurAnalyzer(new StandardAnalyzer(LUCENE_VERSION, new CharArraySet(LUCENE_VERSION, new HashSet<String>(), false)));
+    return new BlurAnalyzer(new StandardAnalyzer(LUCENE_VERSION, new CharArraySet(LUCENE_VERSION,
+        new HashSet<String>(), false)));
   }
 
   @Override
@@ -94,7 +125,7 @@ public class LocalIndexServer extends AbstractIndexServer {
   public Map<String, BlurIndex> getIndexes(String table) throws IOException {
     Map<String, BlurIndex> tableMap = _readersMap.get(table);
     if (tableMap == null) {
-      tableMap = openFromDisk(table);
+      tableMap = openFromDisk();
       _readersMap.put(table, tableMap);
     }
     return tableMap;
@@ -105,14 +136,6 @@ public class LocalIndexServer extends AbstractIndexServer {
     return new FairSimilarity();
   }
 
-  @Override
-  public void close() {
-    _closer.close();
-    for (String table : _readersMap.keySet()) {
-      close(_readersMap.get(table));
-    }
-  }
-
   private void close(Map<String, BlurIndex> map) {
     for (BlurIndex index : map.values()) {
       try {
@@ -123,19 +146,22 @@ public class LocalIndexServer extends AbstractIndexServer {
     }
   }
 
-  private Map<String, BlurIndex> openFromDisk(String table) throws IOException {
-    File tableFile = new File(_localDir, table);
+  private Map<String, BlurIndex> openFromDisk() throws IOException {
+    String table = _tableContext.getDescriptor().getName();
+    Path tablePath = _tableContext.getTablePath();
+    File tableFile = new File(tablePath.toUri());
     if (tableFile.isDirectory()) {
       Map<String, BlurIndex> shards = new ConcurrentHashMap<String, BlurIndex>();
-      for (File f : tableFile.listFiles()) {
-        if (f.isDirectory()) {
-          MMapDirectory directory = new MMapDirectory(f);
-          if (!DirectoryReader.indexExists(directory)) {
-            new IndexWriter(directory, new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer())).close();
-          }
-          String shardName = f.getName();
-          shards.put(shardName, openIndex(table, shardName, directory));
+      int shardCount = _tableContext.getDescriptor().getShardCount();
+      for (int i = 0; i < shardCount; i++) {
+        String shardName = BlurUtil.getShardName(BlurConstants.SHARD_PREFIX, i);
+        File file = new File(tableFile, shardName);
+        file.mkdirs();
+        MMapDirectory directory = new MMapDirectory(file);
+        if (!DirectoryReader.indexExists(directory)) {
+          new IndexWriter(directory, new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer())).close();
         }
+        shards.put(shardName, openIndex(table, shardName, directory));
       }
       return shards;
     }
@@ -143,17 +169,8 @@ public class LocalIndexServer extends AbstractIndexServer {
   }
 
   private BlurIndex openIndex(String table, String shard, Directory dir) throws CorruptIndexException, IOException {
-    BlurNRTIndex index = new BlurNRTIndex();
-    index.setAnalyzer(getAnalyzer(table));
-    index.setDirectory(dir);
-    index.setShard(shard);
-    index.setSimilarity(getSimilarity(table));
-    index.setTable(table);
-    index.setWalPath(new Path(new Path(_walPath, table), shard));
-    index.setConfiguration(_configuration);
-    index.setCloser(_closer);
-    index.setTimeBetweenRefreshs(25);
-    index.init();
+    ShardContext shardContext = ShardContext.create(_tableContext, shard);
+    BlurNRTIndex index = new BlurNRTIndex(shardContext, _mergeScheduler, _indexInputCloser, dir, _gc, _searchExecutor);
     return index;
   }
 
@@ -166,7 +183,8 @@ public class LocalIndexServer extends AbstractIndexServer {
   public List<String> getShardList(String table) {
     try {
       List<String> result = new ArrayList<String>();
-      File tableFile = new File(_localDir, table);
+      Path tablePath = _tableContext.getTablePath();
+      File tableFile = new File(new File(tablePath.toUri()), table);
       if (tableFile.isDirectory()) {
         for (File f : tableFile.listFiles()) {
           if (f.isDirectory()) {
@@ -187,22 +205,12 @@ public class LocalIndexServer extends AbstractIndexServer {
 
   @Override
   public String getTableUri(String table) {
-    return new File(_localDir, table).toURI().toString();
+    return _tableContext.getTablePath().toUri().toString();
   }
 
   @Override
   public int getShardCount(String table) {
-    return getShardList(table).size();
-  }
-
-  @Override
-  public int getCompressionBlockSize(String table) {
-    return _blockSize;
-  }
-
-  @Override
-  public CompressionCodec getCompressionCodec(String table) {
-    return _compression;
+    return _tableContext.getDescriptor().getShardCount();
   }
 
   @Override
@@ -226,4 +234,14 @@ public class LocalIndexServer extends AbstractIndexServer {
     }
     return size;
   }
+
+  @Override
+  public CompressionCodec getCompressionCodec(String table) {
+    throw new RuntimeException("Should not be used.");
+  }
+
+  @Override
+  public int getCompressionBlockSize(String table) {
+    throw new RuntimeException("Should not be used.");
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java b/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
index b758f11..9808803 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
@@ -25,9 +25,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.blur.analysis.BlurAnalyzer;
+import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexDeletionPolicy;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy;
 import org.apache.lucene.index.TieredMergePolicy;
@@ -78,10 +78,11 @@ public abstract class AbstractBlurIndex extends BlurIndex {
   }
 
   @Override
-  public IndexReader getIndexReader() throws IOException {
-    IndexReader indexReader = _indexReaderRef.get();
-    indexReader.incRef();
-    return indexReader;
+  public IndexSearcherClosable getIndexReader() throws IOException {
+    throw new RuntimeException("not impl");
+//    IndexReader indexReader = _indexReaderRef.get();
+//    indexReader.incRef();
+//    return indexReader;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f4c3cc19/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
index 97dc448..23c3241 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndex.java
@@ -19,8 +19,8 @@ package org.apache.blur.manager.writer;
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.apache.blur.server.IndexSearcherClosable;
 import org.apache.blur.thrift.generated.Row;
-import org.apache.lucene.index.IndexReader;
 
 public abstract class BlurIndex {
 
@@ -28,7 +28,7 @@ public abstract class BlurIndex {
 
   public abstract void deleteRow(boolean waitToBeVisible, boolean wal, String rowId) throws IOException;
 
-  public abstract IndexReader getIndexReader() throws IOException;
+  public abstract IndexSearcherClosable getIndexReader() throws IOException;
 
   public abstract void close() throws IOException;
 


Mime
View raw message