@Override public void setup(RegionCoprocessorEnvironment env) throws IOException { this.env = env; // setup the phoenix codec. Generally, this will just be in standard one, but abstracting here // so we can use it later when generalizing covered indexes Configuration conf = env.getConfiguration(); Class<? extends IndexCodec> codecClass = conf.getClass(CODEC_CLASS_NAME_KEY, null, IndexCodec.class); try { Constructor<? extends IndexCodec> meth = codecClass.getDeclaredConstructor(new Class[0]); meth.setAccessible(true); this.codec = meth.newInstance(); this.codec.initialize(conf, env.getRegion().getRegionInfo().getTable().getName()); } catch (Exception e) { throw new IOException(e); } }
@Override public void setup(RegionCoprocessorEnvironment env) throws IOException { this.env = env; // setup the phoenix codec. Generally, this will just be in standard one, but abstracting here // so we can use it later when generalizing covered indexes Configuration conf = env.getConfiguration(); Class<? extends IndexCodec> codecClass = conf.getClass(CODEC_CLASS_NAME_KEY, null, IndexCodec.class); try { Constructor<? extends IndexCodec> meth = codecClass.getDeclaredConstructor(new Class[0]); meth.setAccessible(true); this.codec = meth.newInstance(); this.codec.initialize(conf, env.getRegion().getRegionInfo().getTable().getName()); } catch (Exception e) { throw new IOException(e); } }
@Override public void setup(RegionCoprocessorEnvironment env) throws IOException { this.env = env; // setup the phoenix codec. Generally, this will just be in standard one, but abstracting here // so we can use it later when generalizing covered indexes Configuration conf = env.getConfiguration(); Class<? extends IndexCodec> codecClass = conf.getClass(CODEC_CLASS_NAME_KEY, null, IndexCodec.class); try { Constructor<? extends IndexCodec> meth = codecClass.getDeclaredConstructor(new Class[0]); meth.setAccessible(true); this.codec = meth.newInstance(); this.codec.initialize(conf, env.getRegionInfo().getStartKey(), env.getRegionInfo().getEndKey(), env.getRegion().getRegionInfo().getTable().getName()); } catch (Exception e) { throw new IOException(e); } }