bitoffdev commented on a change in pull request #2268:
URL: https://github.com/apache/hbase/pull/2268#discussion_r472221320



##########
File path: hbase-shell/src/main/ruby/hbase/admin.rb
##########
@@ -664,6 +668,40 @@ def alter_status(table_name)
       puts 'Done.'
     end
 
+    
#----------------------------------------------------------------------------------------------
+    # Use our internal logic to convert from "spec string" format to a 
coprocessor descriptor
+    #
+    # Provided for backwards shell compatibility
+    #
+    # @param [String] spec_str
+    # @return [ColumnDescriptor]
+    def coprocessor_descriptor_from_spec_str(spec_str)
+      method = TableDescriptorBuilder.java_class.declared_method_smart 
:toCoprocessorDescriptor
+      method.accessible = true
+      result = method.invoke(nil, spec_str).to_java
+      # unpack java's Optional to be more rubonic
+      return result.isPresent ? result.get : nil
+    end
+
+    
#----------------------------------------------------------------------------------------------
+    # Use CoprocessorDescriptorBuilder to convert a Hash to 
CoprocessorDescriptor
+    #
+    # @param [Hash] spec column descriptor specification
+    # @return [ColumnDescriptor]
+    def coprocessor_descriptor_from_hash(spec)
+      classname = spec['CLASSNAME']

Review comment:
       Makes sense, done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to