@Test public void testGetSail() throws Exception { HBaseSailConfig hbsc = new HBaseSailConfig(); hbsc.setCreate(false); hbsc.setPush(false); hbsc.setSplitBits(3); hbsc.setEvaluationTimeout(480); hbsc.setTablespace("testtable"); hbsc.setElasticIndexURL("http: Sail sail = new HBaseSailFactory().getSail(hbsc); assertTrue(sail instanceof HBaseSail); HBaseSail hbs = (HBaseSail)sail; assertFalse(hbs.create); assertFalse(hbs.pushStrategy); assertEquals(3, hbs.splitBits); assertEquals("testtable", hbs.tableName); assertEquals(480, hbs.evaluationTimeout); assertEquals("http: }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } } }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); static final String SAIL_TYPE; }