http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_constants.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_constants.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_constants.rb new file mode 100644 index 0000000..a504b16 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_constants.rb @@ -0,0 +1,11 @@ +# +# 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_r_p_c_service_types' + +module Blur +end
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_types.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_types.rb new file mode 100644 index 0000000..429e167 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_service_types.rb @@ -0,0 +1,13 @@ +# +# 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_r_p_c_types' +require 'blur_simple_types' + + +module Blur +end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_types.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_types.rb new file mode 100644 index 0000000..3901ca3 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_r_p_c_types.rb @@ -0,0 +1,686 @@ +# +# 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 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 TYPE + # This type uses the StandardAnalyzer for indexing and stores the value. + TEXT = 0 + # This type is indexed as a String (Lucene StringField) as provided and stores the value. +# NOTE: The String is not tokenized, so the String is indexed as a single value. + STRING = 1 + # This type is indexed as an Integer (Lucene IntegerField) as provided and stores the value. + INT = 2 + # This type is indexed as an Long (Lucene LongField) as provided and stores the value. + LONG = 3 + # This type is indexed as an Float (Lucene FloatField) as provided and stores the value. + FLOAT = 4 + # This type is indexed as an Double (Lucene DoubleField) as provided and stores the value. + DOUBLE = 5 + # This type is NOT indexed but stores the value. + BINARY = 6 + VALUE_MAP = {0 => "TEXT", 1 => "STRING", 2 => "INT", 3 => "LONG", 4 => "FLOAT", 5 => "DOUBLE", 6 => "BINARY"} + VALID_VALUES = Set.new([TEXT, STRING, INT, LONG, FLOAT, DOUBLE, BINARY]).freeze + end + + module SortType + # Sort by document score (relevance). Sort values are Float and higher values are at the front. + SCORE = 0 + # Sort by document number (index order). Sort values are Integer and lower values are at the front. + DOC = 1 + # Sort using term values as Strings. Sort values are String and lower values are at the front. + STRING = 2 + # Sort using term values as encoded Integers. Sort values are Integer and lower values are at the front. + INT = 3 + # Sort using term values as encoded Floats. Sort values are Float and lower values are at the front. + FLOAT = 4 + # Sort using term values as encoded Longs. Sort values are Long and lower values are at the front. + LONG = 5 + # Sort using term values as encoded Doubles. Sort values are Double and lower values are at the front. + DOUBLE = 6 + # Sort using term values as encoded Shorts. Sort values are Short and lower values are at the front. + SHORT = 7 + # Sort using term values as encoded Bytes. Sort values are Byte and lower values are at the front. + BYTE = 8 + # Sort using term values as Strings, but comparing by value (using String.compareTo) for all +# comparisons. This is typically slower than {@link #STRING}, which uses ordinals to do the sorting. + STRING_VAL = 9 + # Sort use byte[] index values. + BYTES = 10 + VALUE_MAP = {0 => "SCORE", 1 => "DOC", 2 => "STRING", 3 => "INT", 4 => "FLOAT", 5 => "LONG", 6 => "DOUBLE", 7 => "SHORT", 8 => "BYTE", 9 => "STRING_VAL", 10 => "BYTES"} + VALID_VALUES = Set.new([SCORE, DOC, STRING, INT, FLOAT, LONG, DOUBLE, SHORT, BYTE, STRING_VAL, BYTES]).freeze + end + + module QueryType + STRING = 0 + JSON = 1 + BINARY = 2 + VALUE_MAP = {0 => "STRING", 1 => "JSON", 2 => "BINARY"} + VALID_VALUES = Set.new([STRING, JSON, BINARY]).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 + + 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 validate + end + + ::Thrift::Struct.generate_accessors self + end + + # + class TableStats + include ::Thrift::Struct, ::Thrift::Struct_Union + BYTES = 1 + DOCUMENTCOUNT = 2 + QUERIES = 3 + + FIELDS = { + # + BYTES => {:type => ::Thrift::Types::I64, :name => 'bytes'}, + # + DOCUMENTCOUNT => {:type => ::Thrift::Types::I64, :name => 'documentCount'}, + # + QUERIES => {:type => ::Thrift::Types::I64, :name => 'queries'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # The field schema contains the field's name and type. + class FieldSchema + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + TYPE = 2 + + FIELDS = { + # The name of the field. + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + # The type of the field. + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Blur::TYPE} + } + + def struct_fields; FIELDS; end + + def validate + unless @type.nil? || ::Blur::TYPE::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + # TableSchema contains field information that describes the a table. + class TableSchema + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELDS = 1 + CLUSTER = 2 + + FIELDS = { + # List of field information for a table. + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::FieldSchema}}, + # The cluster name in which this table exists. + CLUSTER => {:type => ::Thrift::Types::STRING, :name => 'cluster'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ClassDefinition + include ::Thrift::Struct, ::Thrift::Struct_Union + CLASSNAME = 1 + ARGUMENTS = 2 + INITFUNCTION = 3 + + FIELDS = { + CLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'className'}, + ARGUMENTS => {:type => ::Thrift::Types::MAP, :name => 'arguments', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING, :binary => true}}, + # user can define its own way to initialize analyzer by providing javascript function. +# This function will always be used if defined. + INITFUNCTION => {:type => ::Thrift::Types::STRING, :name => 'initFunction'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # The analyzer sub type struct holds the sub field name and class definition of +# the sub type. See AnalyzerType for further explanation. + class AnalyzerSubType + include ::Thrift::Struct, ::Thrift::Struct_Union + SUBFIELDNAME = 1 + CLASSDEFINITION = 2 + + FIELDS = { + # The sub field name. + SUBFIELDNAME => {:type => ::Thrift::Types::STRING, :name => 'subFieldName'}, + # The class definition that is to be used. + CLASSDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'classDefinition', :class => ::Blur::ClassDefinition} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # The Analyzer struct allows for defining an alternate analyzer class definition +# with optional analyzer sub types. The sub types allow for indexing a single field +# with several different analyzer while only storing the value once. For example, if +# field "name" was a TEXT type the class definition could be set to Lowercase +# analyzer and the analyzer sub types could be set to Keyword (with a sub field name +# of "name.key") and Standard analyzer (with a sub field name of "name.standard"). Then in +# queries the Lowercase analyzer would be used when "name" is referenced, Keyword +# analyzer would be referenced when "name.key" is referenced and Standard analyzer +# would be referenced when "name.standard" is referenced. + class AnalyzerType + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELDNAME = 1 + CLASSDEFINITION = 2 + ANALYZERSUBTYPES = 3 + + FIELDS = { + # The field that this defined type is to operate against. + FIELDNAME => {:type => ::Thrift::Types::STRING, :name => 'fieldName'}, + # The class definition that is to be used. If this field is null then the +# default behavior of the field is to be used. + CLASSDEFINITION => {:type => ::Thrift::Types::STRUCT, :name => 'classDefinition', :class => ::Blur::ClassDefinition}, + # The analyzer sub types that should be applied. This can be empty or null. + ANALYZERSUBTYPES => {:type => ::Thrift::Types::LIST, :name => 'analyzerSubTypes', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::AnalyzerSubType}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # The analyzer allows for defining of alternate analyzers for the given fields. The TYPE +# enum defines the default field types and the default indexing behavior for each. The +# Analyzer struct allows for defining alternate behavior. Such as a field with a TEXT +# type using a Lowercase Analyzer instead of the default StandardAnalyzer. + class Analyzer + include ::Thrift::Struct, ::Thrift::Struct_Union + ANALYZERTYPES = 1 + + FIELDS = { + # The list of AnalyzerTypes. + ANALYZERTYPES => {:type => ::Thrift::Types::LIST, :name => 'analyzerTypes', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::AnalyzerType}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # + class TableDescriptor + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + ENABLED = 2 + SHARDCOUNT = 3 + STORAGEPATH = 4 + ANALYZER = 5 + READONLY = 6 + DEFAULTFIELDNAME = 7 + PROPERTIES = 8 + + FIELDS = { + # The name of the table. + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + # Is the table enable for queries and updates. + ENABLED => {:type => ::Thrift::Types::BOOL, :name => 'enabled', :default => true}, + # The number of shards in the table. + SHARDCOUNT => {:type => ::Thrift::Types::I32, :name => 'shardCount', :default => 1}, + # The storage path is a HDFS URI for storing all of the indexes. Any valid HDFS +# URI can be used such as hdfs://hostname/path, or file:///path, etc. + STORAGEPATH => {:type => ::Thrift::Types::STRING, :name => 'storagePath'}, + # The analyzer definition for this table. If null the default behavior for each +# field will be used. + ANALYZER => {:type => ::Thrift::Types::STRUCT, :name => 'analyzer', :class => ::Blur::Analyzer}, + # This will only allow queries to be executed on the table. The underlying implementation +# does not open the index for writing, but will refresh the index periodically. + READONLY => {:type => ::Thrift::Types::BOOL, :name => 'readOnly', :default => false}, + # The default field name for any field where the field name is null. + DEFAULTFIELDNAME => {:type => ::Thrift::Types::STRING, :name => 'defaultFieldName', :default => %q"body"}, + # compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache + PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Session + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONID = 1 + TABLENAME = 2 + + FIELDS = { + SESSIONID => {:type => ::Thrift::Types::STRING, :name => 'sessionId'}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class SortField + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELD = 1 + TYPE = 2 + REVERSE = 3 + + FIELDS = { + FIELD => {:type => ::Thrift::Types::STRING, :name => 'field'}, + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Blur::SortType}, + REVERSE => {:type => ::Thrift::Types::BOOL, :name => 'reverse'} + } + + def struct_fields; FIELDS; end + + def validate + unless @type.nil? || ::Blur::SortType::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Sort + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELDS = 1 + + FIELDS = { + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::SortField}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ScoreDoc + include ::Thrift::Struct, ::Thrift::Struct_Union + SCORE = 1 + DOCLOCATION = 2 + FIELDS = 4 + + FIELDS = { + SCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'score'}, + DOCLOCATION => {:type => ::Thrift::Types::I64, :name => 'docLocation'}, + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRING, :binary => true}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # The Query object describes how the query is passed. If the +# type is STRING or JSON the queryString field is used. If +# the BINARY type is used the queryBinary should be used. + class Query + include ::Thrift::Struct, ::Thrift::Struct_Union + TYPE = 1 + QUERYSTRING = 2 + QUERYBINARY = 3 + + FIELDS = { + # The query type. + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Blur::QueryType}, + # The query to be executed. + QUERYSTRING => {:type => ::Thrift::Types::STRING, :name => 'queryString'}, + # The query to be executed. + QUERYBINARY => {:type => ::Thrift::Types::STRING, :name => 'queryBinary', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + unless @type.nil? || ::Blur::QueryType::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class QueryArgs + include ::Thrift::Struct, ::Thrift::Struct_Union + ID = 1 + AFTER = 2 + QUERY = 3 + FILTER = 4 + NUMBERTOFETCH = 5 + AGGREGATERESULTS = 6 + SORT = 7 + DODOCSCORES = 8 + DOMAXSCORE = 9 + SHARDINDEXES = 10 + + FIELDS = { + # Unique id for controlling the given query, leave null for server side assignment. + ID => {:type => ::Thrift::Types::STRING, :name => 'id'}, + # If after is left null then the first N (where N is numberToFetch) +# ScoreDocs are fetched. If after is not null then the first N +# ScoreDocs are fetched that occur after the given ScoreDoc. + AFTER => {:type => ::Thrift::Types::STRUCT, :name => 'after', :class => ::Blur::ScoreDoc}, + # The query to be executed. + QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Blur::Query}, + # Filter to be executed. + FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true}, + # The number of document locations to fetch. + NUMBERTOFETCH => {:type => ::Thrift::Types::I32, :name => 'numberToFetch', :default => 100}, + # If aggregate results is left true then only a single TopFieldDocs +# object will be returned from the search method. It will contain +# only the best documents from the given search with all of the +# shards being sorted and aggregated together. + AGGREGATERESULTS => {:type => ::Thrift::Types::BOOL, :name => 'aggregateResults', :default => true}, + # NOT YET IMPLEMENTED. + SORT => {:type => ::Thrift::Types::STRUCT, :name => 'sort', :class => ::Blur::Sort}, + # NOT YET IMPLEMENTED. Related to sort. + DODOCSCORES => {:type => ::Thrift::Types::BOOL, :name => 'doDocScores', :default => true}, + # Calculate the max score of the search. + DOMAXSCORE => {:type => ::Thrift::Types::BOOL, :name => 'doMaxScore', :default => false}, + # Shard indexes allows the user to specify which shards of the table to execute +# the query against. If left null, all the shards of the table are used. + SHARDINDEXES => {:type => ::Thrift::Types::LIST, :name => 'shardIndexes', :element => {:type => ::Thrift::Types::I32}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # Contains the query status information for a query on a server. + class QueryStatus + include ::Thrift::Struct, ::Thrift::Struct_Union + STARTTIME = 1 + ENDTIME = 2 + CPUTIME = 3 + USERTIME = 4 + COMPLETESHARDS = 5 + TOTALSHARDS = 6 + STATE = 7 + QUERYARGS = 8 + + FIELDS = { + # The startTime as set on the server, this is when the query has started executing. This could be different depending on the server. + STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'}, + # The endTime as set on the server, this is when the query has stopped executing. This could be different depending on the server. + ENDTIME => {:type => ::Thrift::Types::I64, :name => 'endTime'}, + # The amount cpu time spent executing the given query. + CPUTIME => {:type => ::Thrift::Types::I64, :name => 'cpuTime'}, + # The total amount of time spent executing the query. + USERTIME => {:type => ::Thrift::Types::I64, :name => 'userTime'}, + # The number of shards that this server has completed. + COMPLETESHARDS => {:type => ::Thrift::Types::I32, :name => 'completeShards'}, + # The number of shards that this server has to complete. + TOTALSHARDS => {:type => ::Thrift::Types::I32, :name => 'totalShards'}, + # The state of the query. This could be different depending on the server. + STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::Blur::QueryState}, + # The query that is executing. + QUERYARGS => {:type => ::Thrift::Types::STRUCT, :name => 'queryArgs', :class => ::Blur::QueryArgs} + } + + 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 + + class TopFieldDocs + include ::Thrift::Struct, ::Thrift::Struct_Union + SHARDINDEX = 1 + TOTALHITS = 2 + SCOREDOCS = 3 + MAXSCORE = 4 + FIELDS = 5 + + FIELDS = { + SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'}, + TOTALHITS => {:type => ::Thrift::Types::I64, :name => 'totalHits'}, + SCOREDOCS => {:type => ::Thrift::Types::LIST, :name => 'scoreDocs', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::ScoreDoc}}, + MAXSCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'maxScore'}, + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::SortField}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # + class Field + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + VALUE = 2 + TYPE = 3 + BOOST = 4 + + FIELDS = { + # The name of the field. + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + # The value of the field in binary form. If the value is a string, the string should be in UTF-8 format. + VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true}, + # The type of the field, this represents how the data is stored and the default indexing schema for the data. + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Blur::TYPE}, + # The boost of the field. Default of 1.0 for no change to the boost. + BOOST => {:type => ::Thrift::Types::DOUBLE, :name => 'boost', :default => 1} + } + + def struct_fields; FIELDS; end + + def validate + unless @type.nil? || ::Blur::TYPE::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self + end + + class Document + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELDS = 1 + + FIELDS = { + # This list of fields to be indexed. The same field name can be used across fields and the order of the fields will be maintained. + FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Field}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Term + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELD = 1 + BYTES = 2 + + FIELDS = { + # Field name. + FIELD => {:type => ::Thrift::Types::STRING, :name => 'field'}, + # Field values. + BYTES => {:type => ::Thrift::Types::STRING, :name => 'bytes', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class MutateOptions + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + SHARDINDEX = 2 + WAITTOBEVISIBLE = 3 + WRITEAHEADLOG = 4 + + FIELDS = { + # The name of the table. + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + # The index of the shard in the table that the mutate will operate against. + SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'}, + # Setting this to true will cause the mutate call to block until the mutates are visible. + WAITTOBEVISIBLE => {:type => ::Thrift::Types::BOOL, :name => 'waitToBeVisible', :default => false}, + # Whether or not to add this mutation to the write ahead log for recovery of information during a shard server crash. + WRITEAHEADLOG => {:type => ::Thrift::Types::BOOL, :name => 'writeAheadLog', :default => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # Contains a the delete term as well as the documents that will be added to the index shard. + class UpdatePackage + include ::Thrift::Struct, ::Thrift::Struct_Union + TERM = 1 + DOCUMENTS = 2 + + FIELDS = { + # The term that will mark old Documents as deleted before adding the documents. + TERM => {:type => ::Thrift::Types::STRUCT, :name => 'term', :class => ::Blur::Term}, + # The documents to be updated. + DOCUMENTS => {:type => ::Thrift::Types::LIST, :name => 'documents', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Document}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + # Generation keeps a reference to the Lucene generation where a mutate (add/update/delete) +# was performed. This can be used to wait for that generation to be visible. + class Generation + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + SHARDINDEX = 2 + GENERATION = 3 + + FIELDS = { + # The table name for this generation. + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + # The shard index for this generation. + SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'}, + # The Lucene generation. + GENERATION => {:type => ::Thrift::Types::I64, :name => 'generation'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ShardLayout + include ::Thrift::Struct, ::Thrift::Struct_Union + SERVER = 1 + SHARDS = 2 + + FIELDS = { + # The server for this layout. + SERVER => {:type => ::Thrift::Types::STRING, :name => 'server'}, + # A list of shard ids for the given server. + SHARDS => {:type => ::Thrift::Types::LIST, :name => 'shards', :element => {:type => ::Thrift::Types::I32}} + } + + 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/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_constants.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_constants.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_constants.rb new file mode 100644 index 0000000..9374127 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_constants.rb @@ -0,0 +1,11 @@ +# +# 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_simple_types' + +module Blur +end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_types.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_types.rb b/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_types.rb new file mode 100644 index 0000000..4e38e94 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/blur_simple_types.rb @@ -0,0 +1,90 @@ +# +# 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_r_p_c_types' + + +module Blur + class DocumentRecord + include ::Thrift::Struct, ::Thrift::Struct_Union + ID = 1 + DOCUMENT = 2 + + FIELDS = { + ID => {:type => ::Thrift::Types::STRING, :name => 'id'}, + DOCUMENT => {:type => ::Thrift::Types::STRUCT, :name => 'document', :class => ::Blur::Document} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DocumentResult + include ::Thrift::Struct, ::Thrift::Struct_Union + TOTALHITS = 1 + DOCUMENTS = 2 + SCORES = 3 + + FIELDS = { + TOTALHITS => {:type => ::Thrift::Types::I64, :name => 'totalHits'}, + DOCUMENTS => {:type => ::Thrift::Types::LIST, :name => 'documents', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::DocumentRecord}}, + SCORES => {:type => ::Thrift::Types::LIST, :name => 'scores', :element => {:type => ::Thrift::Types::DOUBLE}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DocumentGroup + include ::Thrift::Struct, ::Thrift::Struct_Union + ID = 1 + PRIMEDOC = 2 + DOCUMENTS = 3 + + FIELDS = { + ID => {:type => ::Thrift::Types::STRING, :name => 'id'}, + PRIMEDOC => {:type => ::Thrift::Types::STRUCT, :name => 'primeDoc', :class => ::Blur::DocumentRecord}, + DOCUMENTS => {:type => ::Thrift::Types::LIST, :name => 'documents', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::DocumentRecord}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DocumentGroupResult + include ::Thrift::Struct, ::Thrift::Struct_Union + TOTALHITS = 1 + DOCUMENTS = 2 + SCORES = 3 + + FIELDS = { + TOTALHITS => {:type => ::Thrift::Types::I64, :name => 'totalHits'}, + DOCUMENTS => {:type => ::Thrift::Types::LIST, :name => 'documents', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::DocumentGroup}}, + SCORES => {:type => ::Thrift::Types::LIST, :name => 'scores', :element => {:type => ::Thrift::Types::DOUBLE}} + } + + 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/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/document_group_service.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/document_group_service.rb b/src/distribution/src/main/scripts/interface/gen-rb/document_group_service.rb new file mode 100644 index 0000000..a69d279 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/document_group_service.rb @@ -0,0 +1,210 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'document_service' +require 'blur_simple_types' + +module Blur + module DocumentGroupService + class Client < ::Blur::DocumentService::Client + include ::Thrift::Client + + def searchGroups(table, query) + send_searchGroups(table, query) + return recv_searchGroups() + end + + def send_searchGroups(table, query) + send_message('searchGroups', SearchGroups_args, :table => table, :query => query) + end + + def recv_searchGroups() + result = receive_message(SearchGroups_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'searchGroups failed: unknown result') + end + + def updateGroup(table, group) + send_updateGroup(table, group) + recv_updateGroup() + end + + def send_updateGroup(table, group) + send_message('updateGroup', UpdateGroup_args, :table => table, :group => group) + end + + def recv_updateGroup() + result = receive_message(UpdateGroup_result) + raise result.ex unless result.ex.nil? + return + end + + def deleteGroup(table, id) + send_deleteGroup(table, id) + recv_deleteGroup() + end + + def send_deleteGroup(table, id) + send_message('deleteGroup', DeleteGroup_args, :table => table, :id => id) + end + + def recv_deleteGroup() + result = receive_message(DeleteGroup_result) + raise result.ex unless result.ex.nil? + return + end + + end + + class Processor < ::Blur::DocumentService::Processor + include ::Thrift::Processor + + def process_searchGroups(seqid, iprot, oprot) + args = read_args(iprot, SearchGroups_args) + result = SearchGroups_result.new() + begin + result.success = @handler.searchGroups(args.table, args.query) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'searchGroups', seqid) + end + + def process_updateGroup(seqid, iprot, oprot) + args = read_args(iprot, UpdateGroup_args) + result = UpdateGroup_result.new() + begin + @handler.updateGroup(args.table, args.group) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'updateGroup', seqid) + end + + def process_deleteGroup(seqid, iprot, oprot) + args = read_args(iprot, DeleteGroup_args) + result = DeleteGroup_result.new() + begin + @handler.deleteGroup(args.table, args.id) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'deleteGroup', seqid) + end + + end + + # HELPER FUNCTIONS AND STRUCTURES + + class SearchGroups_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + QUERY = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class SearchGroups_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Blur::DocumentGroupResult}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class UpdateGroup_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + GROUP = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + GROUP => {:type => ::Thrift::Types::STRUCT, :name => 'group', :class => ::Blur::DocumentGroup} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class UpdateGroup_result + include ::Thrift::Struct, ::Thrift::Struct_Union + EX = 1 + + FIELDS = { + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DeleteGroup_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + ID = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + ID => {:type => ::Thrift::Types::STRING, :name => 'id'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DeleteGroup_result + include ::Thrift::Struct, ::Thrift::Struct_Union + EX = 1 + + FIELDS = { + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + end + +end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/gen-rb/document_service.rb ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/gen-rb/document_service.rb b/src/distribution/src/main/scripts/interface/gen-rb/document_service.rb new file mode 100644 index 0000000..86664e8 --- /dev/null +++ b/src/distribution/src/main/scripts/interface/gen-rb/document_service.rb @@ -0,0 +1,209 @@ +# +# 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_simple_types' + +module Blur + module DocumentService + class Client + include ::Thrift::Client + + def searchRecords(table, query) + send_searchRecords(table, query) + return recv_searchRecords() + end + + def send_searchRecords(table, query) + send_message('searchRecords', SearchRecords_args, :table => table, :query => query) + end + + def recv_searchRecords() + result = receive_message(SearchRecords_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'searchRecords failed: unknown result') + end + + def updateRecord(table, record) + send_updateRecord(table, record) + recv_updateRecord() + end + + def send_updateRecord(table, record) + send_message('updateRecord', UpdateRecord_args, :table => table, :record => record) + end + + def recv_updateRecord() + result = receive_message(UpdateRecord_result) + raise result.ex unless result.ex.nil? + return + end + + def deleteRecord(table, id) + send_deleteRecord(table, id) + recv_deleteRecord() + end + + def send_deleteRecord(table, id) + send_message('deleteRecord', DeleteRecord_args, :table => table, :id => id) + end + + def recv_deleteRecord() + result = receive_message(DeleteRecord_result) + raise result.ex unless result.ex.nil? + return + end + + end + + class Processor + include ::Thrift::Processor + + def process_searchRecords(seqid, iprot, oprot) + args = read_args(iprot, SearchRecords_args) + result = SearchRecords_result.new() + begin + result.success = @handler.searchRecords(args.table, args.query) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'searchRecords', seqid) + end + + def process_updateRecord(seqid, iprot, oprot) + args = read_args(iprot, UpdateRecord_args) + result = UpdateRecord_result.new() + begin + @handler.updateRecord(args.table, args.record) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'updateRecord', seqid) + end + + def process_deleteRecord(seqid, iprot, oprot) + args = read_args(iprot, DeleteRecord_args) + result = DeleteRecord_result.new() + begin + @handler.deleteRecord(args.table, args.id) + rescue ::Blur::BlurException => ex + result.ex = ex + end + write_result(result, oprot, 'deleteRecord', seqid) + end + + end + + # HELPER FUNCTIONS AND STRUCTURES + + class SearchRecords_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + QUERY = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class SearchRecords_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Blur::DocumentResult}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class UpdateRecord_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + RECORD = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + RECORD => {:type => ::Thrift::Types::STRUCT, :name => 'record', :class => ::Blur::DocumentRecord} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class UpdateRecord_result + include ::Thrift::Struct, ::Thrift::Struct_Union + EX = 1 + + FIELDS = { + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DeleteRecord_args + include ::Thrift::Struct, ::Thrift::Struct_Union + TABLE = 1 + ID = 2 + + FIELDS = { + TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}, + ID => {:type => ::Thrift::Types::STRING, :name => 'id'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class DeleteRecord_result + include ::Thrift::Struct, ::Thrift::Struct_Union + EX = 1 + + FIELDS = { + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + end + +end http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/11f5141c/src/distribution/src/main/scripts/interface/genAndReplace.sh ---------------------------------------------------------------------- diff --git a/src/distribution/src/main/scripts/interface/genAndReplace.sh b/src/distribution/src/main/scripts/interface/genAndReplace.sh index 860716c..4b4d3e5 100755 --- a/src/distribution/src/main/scripts/interface/genAndReplace.sh +++ b/src/distribution/src/main/scripts/interface/genAndReplace.sh @@ -19,7 +19,9 @@ rm ../../../../../../src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/* rm -r gen-java/ gen-perl/ gen-rb/ gen-html/ -thrift --gen html --gen perl --gen java --gen rb Blur.thrift +thrift --gen html --gen perl --gen java --gen rb BlurSimple.thrift +thrift --gen html --gen perl --gen java --gen rb BlurRPC.thrift +thrift --gen html --gen perl --gen java --gen rb BlurRPCService.thrift for f in gen-java/org/apache/blur/thrift/generated/*.java; do awk -v f="apache.header" 'BEGIN {while (getline < f) txt=txt $0 "\n"} /package org\.apache\.blur\.thrift\.generated;/ {sub("package org.apache.blur.thrift.generated;", txt)} 1' $f > $f.new rm $f
