# # Copyright 2009 The Apache Software Foundation # # 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. # # File passed to org.jruby.Main by bin/hbase. Pollutes jirb with hbase imports # and hbase commands and then loads jirb. Outputs a banner that tells user # where to find help, shell version, and loads up a custom hirb. # TODO: Add 'debug' support (client-side logs show in shell). Add it as # command-line option and as command. # TODO: Interrupt a table creation or a connection to a bad master. Currently # has to time out. Below we've set down the retries for rpc and hbase but # still can be annoying (And there seem to be times when we'll retry for # ever regardless) # TODO: Add support for listing and manipulating catalog tables, etc. # TODO: Encoding; need to know how to go from ruby String to UTF-8 bytes # Run the java magic include and import basic HBase types that will help ease # hbase hacking. include Java # Some goodies for hirb. Should these be left up to the user's discretion? require 'irb/completion' # Add the $HBASE_HOME/lib/ruby OR $HBASE_HOME/src/main/ruby/lib directory # to the ruby load path so I can load up my HBase ruby modules if File.exists?(File.join(File.dirname(__FILE__), "..", "lib", "ruby", "hbase.rb")) $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib", "ruby") else $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "src", "main", "ruby") end # # FIXME: Switch args processing to getopt # # See if there are args for this shell. If any, read and then strip from ARGV # so they don't go through to irb. Output shell 'usage' if user types '--help' cmdline_help = <