/** * @param conf * @return singleton instance of {@link VisibilityLabelService}. The FQCN of the implementation * class can be specified using "hbase.regionserver.visibility.label.service.class". * @throws IOException When VLS implementation, as specified in conf, can not be loaded. */ public VisibilityLabelService getVisibilityLabelService(Configuration conf) throws IOException { String vlsClassName = conf.get(VISIBILITY_LABEL_SERVICE_CLASS, DefaultVisibilityLabelServiceImpl.class.getCanonicalName()).trim(); if (this.visibilityLabelService != null) { checkForClusterLevelSingleConf(vlsClassName); return this.visibilityLabelService; } synchronized (this) { if (this.visibilityLabelService != null) { checkForClusterLevelSingleConf(vlsClassName); return this.visibilityLabelService; } this.vlsClazzName = vlsClassName; try { this.visibilityLabelService = (VisibilityLabelService) ReflectionUtils.newInstance( Class.forName(vlsClassName), conf); } catch (ClassNotFoundException e) { throw new IOException(e); } return this.visibilityLabelService; } }
/** * @param conf * @return singleton instance of {@link VisibilityLabelService}. The FQCN of the implementation * class can be specified using "hbase.regionserver.visibility.label.service.class". * @throws IOException When VLS implementation, as specified in conf, can not be loaded. */ public VisibilityLabelService getVisibilityLabelService(Configuration conf) throws IOException { String vlsClassName = conf.get(VISIBILITY_LABEL_SERVICE_CLASS, DefaultVisibilityLabelServiceImpl.class.getCanonicalName()).trim(); if (this.visibilityLabelService != null) { checkForClusterLevelSingleConf(vlsClassName); return this.visibilityLabelService; } synchronized (this) { if (this.visibilityLabelService != null) { checkForClusterLevelSingleConf(vlsClassName); return this.visibilityLabelService; } this.vlsClazzName = vlsClassName; try { this.visibilityLabelService = (VisibilityLabelService) ReflectionUtils.newInstance( Class.forName(vlsClassName), conf); } catch (ClassNotFoundException e) { throw new IOException(e); } return this.visibilityLabelService; } }