Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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.
 
 package org.apache.hadoop.hbase.security.visibility;
 
 
Manages singleton instance of VisibilityLabelService
 
 
   private static final Log LOG = LogFactory.getLog(VisibilityLabelServiceManager.class);
 
   public static final String VISIBILITY_LABEL_SERVICE_CLASS =
       "hbase.regionserver.visibility.label.service.class";
 
   private volatile VisibilityLabelService visibilityLabelService = null;
   private String vlsClazzName = null;
 
 
   }
 
   public static VisibilityLabelServiceManager getInstance() {
     return ;
   }

  

Parameters:
conf
Returns:
singleton instance of VisibilityLabelService. The FQCN of the implementation class can be specified using "hbase.regionserver.visibility.label.service.class".
Throws:
java.io.IOException When VLS implementation, as specified in conf, can not be loaded.
 
     String vlsClassName = conf.get(,
     if (this. != null) {
       checkForClusterLevelSingleConf(vlsClassName);
       return this.;
     }
     synchronized (this) {
       if (this. != null) {
         checkForClusterLevelSingleConf(vlsClassName);
         return this.;
       }
       this. = vlsClassName;
       try {
         this. = (VisibilityLabelService) ReflectionUtils.newInstance(
             Class.forName(vlsClassName), conf);
       } catch (ClassNotFoundException e) {
         throw new IOException(e);
       }
       return this.;
     }
   }
 
   private void checkForClusterLevelSingleConf(String vlsClassName) {
     assert this. != null;
     if (!this..equals(vlsClassName)) {
       .warn("Trying to use table specific value for config "
           + "'hbase.regionserver.visibility.label.service.class' which is not supported."
           + " Will use the cluster level VisibilityLabelService class " + this.);
     }
   }

  

Returns:
singleton instance of VisibilityLabelService.
Throws:
java.lang.IllegalStateException if this called before initialization of singleton instance.
 
     // By the time this method is called, the singleton instance of visibilityLabelService should
     // have been created. And it will be created as getVisibilityLabelService(Configuration conf)
     // is called from VC#start() and that will be the 1st thing core code do with any CP.
     if (this. == null) {
       throw new IllegalStateException("VisibilityLabelService not yet instantiated");
     }
    return this.;
  }
New to GrepCode? Check out our FAQ X