You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/19 18:11:20 UTC

[GitHub] [accumulo-proxy] mikewalch opened a new pull request #15: Updated Ruby client code and documentation

mikewalch opened a new pull request #15: Updated Ruby client code and documentation
URL: https://github.com/apache/accumulo-proxy/pull/15
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo-proxy] mikewalch merged pull request #15: Updated Ruby client code and documentation

Posted by GitBox <gi...@apache.org>.
mikewalch merged pull request #15: Updated Ruby client code and documentation
URL: https://github.com/apache/accumulo-proxy/pull/15
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo-proxy] mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation

Posted by GitBox <gi...@apache.org>.
mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation
URL: https://github.com/apache/accumulo-proxy/pull/15#discussion_r360462337
 
 

 ##########
 File path: README.md
 ##########
 @@ -68,6 +68,21 @@ vim example.py
 pipenv run python2 example.py
 ```
 
+# Create an Accumulo client using Ruby
+
+Run the command below to create an example Ruby client:
+
+```bash
+mkdir accumulo-client/
+cd accumulo-client/
+cp /path/to/accumulo-proxy/src/main/ruby/Gemfile .
+vim Gemfile # Set correct path
+cp /path/to/accumulo-proxy/src/main/ruby/client.rb .
+gem install bundler
 
 Review comment:
   Ruby 2.5.5 is the default for my OS so I am going to leave it there

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo-proxy] mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation

Posted by GitBox <gi...@apache.org>.
mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation
URL: https://github.com/apache/accumulo-proxy/pull/15#discussion_r360455672
 
 

 ##########
 File path: src/main/ruby/Gemfile
 ##########
 @@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+source "https://rubygems.org"
+gem 'thrift', '0.11.0.0'
+gem 'accumulo', :path => "/path/to/accumulo-proxy/src/main/ruby/accumulo"
 
 Review comment:
   I put it in the Gemfile

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [accumulo-proxy] mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation

Posted by GitBox <gi...@apache.org>.
mikewalch commented on a change in pull request #15: Updated Ruby client code and documentation
URL: https://github.com/apache/accumulo-proxy/pull/15#discussion_r360462588
 
 

 ##########
 File path: src/main/ruby/client.rb
 ##########
 @@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'thrift'
+require 'accumulo_proxy'
+
+server = ARGV[0] || 'localhost'
+
+socket = Thrift::Socket.new(server, 42424, 9001)
+transport = Thrift::FramedTransport.new(socket)
+proto = Thrift::CompactProtocol.new(transport)
+proxy = Accumulo::AccumuloProxy::Client.new(proto)
+
+# open up the connect
+transport.open()
+
+# Test if the server is up
+login = proxy.login('root', {'password' => 'secret'})
 
 Review comment:
   Good idea. I created #16 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services