@BeforeClass public static void setUpBeforeClass() throws Exception { // no cluster List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { basePath = System.getProperty("basedir"); // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); //Setup RegionServer Groups TEST_UTIL.getConfiguration().set( HConstants.HBASE_MASTER_LOADBALANCER_CLASS, RSGroupBasedLoadBalancer.class.getName()); TEST_UTIL.getConfiguration().set( CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, RSGroupAdminEndpoint.class.getName()); TEST_UTIL.startMiniCluster(4); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add(basePath+"/src/main/ruby"); loadPaths.add(basePath+"/src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setBoolean("hbase.quota.enabled", true); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Below settings are necessary for task monitor test. TEST_UTIL.getConfiguration().setInt(HConstants.MASTER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setBoolean(HConstants.REGIONSERVER_INFO_PORT_AUTO, true); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
protected void acquireRakeReference() { ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); System.setProperty("jruby.native.enabled", "false"); // Problem with cl w/ jnr + jffi container = new ScriptingContainer(); // FIXME: This needs to be replaced by something which does not assume CWD container.setLoadPaths(Arrays.asList("lib")); container.runScriptlet("require 'ant/tasks/raketasks'"); rakeWrapper = container.runScriptlet("RakeWrapper.new"); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } }
protected void acquireRakeReference() { ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); System.setProperty("jruby.native.enabled", "false"); // Problem with cl w/ jnr + jffi container = new ScriptingContainer(); // FIXME: This needs to be replaced by something which does not assume CWD container.setLoadPaths(Arrays.asList("lib")); container.runScriptlet("require 'ant/tasks/raketasks'"); rakeWrapper = container.runScriptlet("RakeWrapper.new"); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } }
protected void acquireRakeReference() { ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); System.setProperty("jruby.native.enabled", "false"); // Problem with cl w/ jnr + jffi container = new ScriptingContainer(); // FIXME: This needs to be replaced by something which does not assume CWD container.setLoadPaths(Arrays.asList("lib")); container.runScriptlet("require 'ant/tasks/raketasks'"); rakeWrapper = container.runScriptlet("RakeWrapper.new"); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } }
ScriptingContainer sc = new ScriptingContainer(); sc.setLoadPaths(Arrays.asList("folder1", "folder2")); File server = new File("server.rb"); sc.runScriptlet(new FileReader(server), server.getName());
protected void acquireRakeReference() { ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); System.setProperty("jruby.native.enabled", "false"); // Problem with cl w/ jnr + jffi container = new ScriptingContainer(); // FIXME: This needs to be replaced by something which does not assume CWD container.setLoadPaths(Arrays.asList("lib")); container.runScriptlet("require 'ant/tasks/raketasks'"); rakeWrapper = container.runScriptlet("RakeWrapper.new"); } finally { Thread.currentThread().setContextClassLoader(prevClassLoader); } }
@SuppressWarnings("unchecked") @Override protected void setup(Context context) throws IOException, InterruptedException { String source = context.getConfiguration().get("source"); this.rubyContainer = new ScriptingContainer(LocalContextScope.CONCURRENT); this.rubyContainer.setLoadPaths(getGemPaths()); this.rubyReceiver = rubyContainer.runScriptlet(source); if (context.getConfiguration().get("params") != null) { params = new HashMap<String, Object>(); params = (Map<String, Object>) JSONValue.parse(context.getConfiguration().get("params")); } if(StringUtils.isNotBlank(context.getConfiguration().get(com.hmsonline.virgil.mapreduce.JobSpawner.MAP_EMIT_FLAG_STR))) { emitter = new Emitter(context); } else { emitter = null; } } }
@SuppressWarnings("unchecked") @Override protected void setup(Context context) throws IOException, InterruptedException { String source = context.getConfiguration().get("source"); this.rubyContainer = new ScriptingContainer(LocalContextScope.CONCURRENT); this.rubyContainer.setLoadPaths(getGemPaths()); this.rubyReceiver = rubyContainer.runScriptlet(source); if (context.getConfiguration().get("params") != null) { params = new HashMap<String, Object>(); params = (Map<String, Object>) JSONValue.parse(context.getConfiguration().get("params")); } reduceRawDataFlag = StringUtils.isNotBlank(context.getConfiguration().get(com.hmsonline.virgil.mapreduce.JobSpawner.REDUCE_RAW_DATA_FLAG_STR)); }
@BeforeClass public static void setUpBeforeClass() throws Exception { // no cluster List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { // no cluster List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { basePath = System.getProperty("basedir"); // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); //Setup RegionServer Groups TEST_UTIL.getConfiguration().set( HConstants.HBASE_MASTER_LOADBALANCER_CLASS, RSGroupBasedLoadBalancer.class.getName()); TEST_UTIL.getConfiguration().set( CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, RSGroupAdminEndpoint.class.getName()); TEST_UTIL.startMiniCluster(1,4); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add(basePath+"/src/main/ruby"); loadPaths.add(basePath+"/src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setBoolean("hbase.quota.enabled", true); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Below settings are necessary for task monitor test. TEST_UTIL.getConfiguration().setInt(HConstants.MASTER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setBoolean(HConstants.REGIONSERVER_INFO_PORT_AUTO, true); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { basePath = System.getProperty("basedir"); // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); //Setup RegionServer Groups TEST_UTIL.getConfiguration().set( HConstants.HBASE_MASTER_LOADBALANCER_CLASS, RSGroupBasedLoadBalancer.class.getName()); TEST_UTIL.getConfiguration().set( CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, RSGroupAdminEndpoint.class.getName()); TEST_UTIL.startMiniCluster(1,4); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add(basePath+"/src/main/ruby"); loadPaths.add(basePath+"/src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }
@BeforeClass public static void setUpBeforeClass() throws Exception { // Start mini cluster TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100); TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250); TEST_UTIL.getConfiguration().setBoolean("hbase.quota.enabled", true); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6); TEST_UTIL.getConfiguration().setBoolean(CoprocessorHost.ABORT_ON_ERROR_KEY, false); TEST_UTIL.getConfiguration().setInt("hfile.format.version", 3); // Below settings are necessary for task monitor test. TEST_UTIL.getConfiguration().setInt(HConstants.MASTER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_INFO_PORT, 0); TEST_UTIL.getConfiguration().setBoolean(HConstants.REGIONSERVER_INFO_PORT_AUTO, true); // Security setup configuration SecureTestUtil.enableSecurity(TEST_UTIL.getConfiguration()); VisibilityTestUtil.enableVisiblityLabels(TEST_UTIL.getConfiguration()); TEST_UTIL.startMiniCluster(); // Configure jruby runtime List<String> loadPaths = new ArrayList<>(2); loadPaths.add("src/main/ruby"); loadPaths.add("src/test/ruby"); jruby.setLoadPaths(loadPaths); jruby.put("$TEST_CLUSTER", TEST_UTIL); System.setProperty("jruby.jit.logging.verbose", "true"); System.setProperty("jruby.jit.logging", "true"); System.setProperty("jruby.native.verbose", "true"); }