Review Board 1.7.22


Patch submitted by Chris McCubbin to add thrift proxy to Accumulo

Review Request #7936 - Created Nov. 7, 2012 and submitted

kturner
trunk
ACCUMULO-482
Reviewers
accumulo
accumulo
Patch submitted by Chris McCubbin to add thrift proxy to Accumulo

 

Diff revision 1 (Latest)

  1. /trunk/proxy/examples/ruby/test_client.rb: Loading...
  2. /trunk/proxy/examples/ruby/thrift.rb: Loading...
  3. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyHarness.java: Loading...
  4. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java: Loading...
  5. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/TestProxyClient.java: Loading...
  6. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/Util.java: Loading...
  7. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloException.java: Loading...
  8. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloProxy.java: Loading...
  9. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloSecurityException.java: Loading...
  10. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/IOException.java: Loading...
  11. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/KeyValueAndPeek.java: Loading...
  12. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/NoMoreEntriesException.java: Loading...
  13. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyIteratorSetting.java: Loading...
  14. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxySystemPermission.java: Loading...
  15. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyTablePermission.java: Loading...
  16. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableExistsException.java: Loading...
  17. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableNotFoundException.java: Loading...
  18. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/UserPass.java: Loading...
  19. /trunk/proxy/src/main/thrift/data.thrift: Loading...
  20. /trunk/proxy/src/main/thrift/proxy.thrift: Loading...
  21. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyInstanceOperations.java: Loading...
  22. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyReadWrite.java: Loading...
  23. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxySecurityOperations.java: Loading...
  24. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyTableOperations.java: Loading...
This diff has been split across 2 pages: < 1 2
/trunk/proxy/examples/ruby/test_client.rb
New File

    
   
1
require 'rubygems'

    
   
2
require 'thrift'

    
   
3
require 'accumulo_proxy'

    
   
4

   

    
   
5
server = ARGV[0] || '192.168.10.163'

    
   
6
port = ARGV[1].to_i || 42424

    
   
7

   

    
   
8
socket = Thrift::Socket.new('192.168.10.163', 42424, 9001)

    
   
9
transport = Thrift::FramedTransport.new(socket)

    
   
10
proto = Thrift::CompactProtocol.new(transport)

    
   
11
proxy = AccumuloProxy::Client.new(proto)

    
   
12
us = UserPass.new({'username'=> 'root', 'password' => 'secret'})

    
   
13

   

    
   
14
# open up the connect

    
   
15
transport.open()

    
   
16

   

    
   
17
# Test if the server is up

    
   
18
puts "Server is up? #{proxy.ping(us)}"

    
   
19

   

    
   
20
# print out a table list

    
   
21
puts "List of tables: #{proxy.tableOperations_list(us).inspect}"

    
   
22

   

    
   
23
testtable = "rubytest"

    
   
24
proxy.tableOperations_create(us,testtable) unless proxy.tableOperations_exists(us,testtable) 

    
   
25

   

    
   
26
key1 = TKey.new({'row' => "row1", 'colFamily' => "cf1", 'colQualifier' => "cq1", 'colVisibility'=> ""})

    
   
27
keyvalue1 = TKeyValue.new({'key' => key1, 'value' => "a"})

    
   
28
key2 = TKey.new({'row' => "row2", 'colFamily' => "cf2", 'colQualifier' => "cq2", 'colVisibility'=> ""})

    
   
29
keyvalue2 = TKeyValue.new({'key' => key2, 'value' => "b"})

    
   
30
proxy.insert(us,testtable,[keyvalue1,keyvalue2])

    
   
31

   

    
   
32
cookie = proxy.createBatchScanner(us,testtable,{},nil,nil)

    
   
33
result = proxy.scanner_next_k(cookie,10)

    
   
34
result.results.each{ |keyvalue| puts "Key: #{keyvalue.key.inspect} Value: #{keyvalue.value}" }

    
   
35

   

    
   
36
transport.close()
/trunk/proxy/examples/ruby/thrift.rb
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyHarness.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/TestProxyClient.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/Util.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloProxy.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloSecurityException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/IOException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/KeyValueAndPeek.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/NoMoreEntriesException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyIteratorSetting.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxySystemPermission.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyTablePermission.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableExistsException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableNotFoundException.java
New File
 
/trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/UserPass.java
New File
 
/trunk/proxy/src/main/thrift/data.thrift
New File
 
/trunk/proxy/src/main/thrift/proxy.thrift
New File
 
/trunk/proxy/src/test/java/org/apache/accumulo/TestProxyInstanceOperations.java
New File
 
/trunk/proxy/src/test/java/org/apache/accumulo/TestProxyReadWrite.java
New File
 
/trunk/proxy/src/test/java/org/apache/accumulo/TestProxySecurityOperations.java
New File
 
/trunk/proxy/src/test/java/org/apache/accumulo/TestProxyTableOperations.java
New File
 
  1. /trunk/proxy/examples/ruby/test_client.rb: Loading...
  2. /trunk/proxy/examples/ruby/thrift.rb: Loading...
  3. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyHarness.java: Loading...
  4. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java: Loading...
  5. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/TestProxyClient.java: Loading...
  6. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/Util.java: Loading...
  7. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloException.java: Loading...
  8. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloProxy.java: Loading...
  9. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/AccumuloSecurityException.java: Loading...
  10. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/IOException.java: Loading...
  11. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/KeyValueAndPeek.java: Loading...
  12. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/NoMoreEntriesException.java: Loading...
  13. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyIteratorSetting.java: Loading...
  14. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxySystemPermission.java: Loading...
  15. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/ProxyTablePermission.java: Loading...
  16. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableExistsException.java: Loading...
  17. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/TableNotFoundException.java: Loading...
  18. /trunk/proxy/src/main/java/org/apache/accumulo/proxy/api/UserPass.java: Loading...
  19. /trunk/proxy/src/main/thrift/data.thrift: Loading...
  20. /trunk/proxy/src/main/thrift/proxy.thrift: Loading...
  21. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyInstanceOperations.java: Loading...
  22. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyReadWrite.java: Loading...
  23. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxySecurityOperations.java: Loading...
  24. /trunk/proxy/src/test/java/org/apache/accumulo/TestProxyTableOperations.java: Loading...
This diff has been split across 2 pages: < 1 2